Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

University

20 Qs

quiz-placeholder

Similar activities

PROGRAMMING IN C AND DATA STRUCTURES - UNIT V

PROGRAMMING IN C AND DATA STRUCTURES - UNIT V

University

20 Qs

DataStructure

DataStructure

University

15 Qs

Assessment Questions for Informatics

Assessment Questions for Informatics

10th Grade - University

20 Qs

CSE316_Unit01_Quiz01

CSE316_Unit01_Quiz01

University

20 Qs

Data Structures

Data Structures

University - Professional Development

20 Qs

ITEDAT Endterm Quiz #2

ITEDAT Endterm Quiz #2

University

20 Qs

Stacks and Queues Quiz

Stacks and Queues Quiz

University

15 Qs

special mid exams in ITE6

special mid exams in ITE6

University

20 Qs

Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

Assessment

Quiz

Computers

University

Medium

Created by

Social Media

Used 9+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

What is the time complexity of accessing an element in an array by index?

O(1)

O(n)

O(log n)

O(n²)

2.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

Which of the following is true about arrays in C/C++?

Arrays can dynamically grow

Indexing starts from 1

Array size must be known at compile time

Arrays are always initialized automatically

3.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

What will arr[5] return if arr has only 5 elements?

The 5th element

The 6th element

Compilation error

Runtime error only in C++

4.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

Which data structure is best for implementing multiple stacks in a single array?

Queue

Linked List

Two pointer method

Binary Tree

5.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

What’s the default garbage value in uninitialized array elements (in C++)?

0

-1

Random/Undefined

NULL

6.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

Which is true about singly linked lists?

Nodes have pointers to both previous and next

Searching is O(1)

Insertion at head is O(1)

Memory is contiguous

7.

MULTIPLE CHOICE QUESTION

45 sec • 5 pts

What is stored in the last node of a singly linked list?

Pointer to head

NULL

Next element

Garbage

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?