Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

University

20 Qs

quiz-placeholder

Similar activities

Queues

Queues

University

20 Qs

Queue Data Structures

Queue Data Structures

University

24 Qs

special mid exams in ITE6

special mid exams in ITE6

University

20 Qs

Data Structure Quiz1

Data Structure Quiz1

University

20 Qs

QUEUE

QUEUE

University

17 Qs

AS Computing: Data Structures

AS Computing: Data Structures

10th Grade - University

15 Qs

Stacks and Queues Quiz

Stacks and Queues Quiz

University

15 Qs

Knowledge Knockout[Quiz Round](2nd-4th years)

Knowledge Knockout[Quiz Round](2nd-4th years)

University

15 Qs

Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

Assessment

Quiz

Computers

University

Medium

Created by

Social Media

Used 8+ 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?