Search Header Logo

Data Structures and Algorithms Quiz

Authored by Social Media

Computers

University

Used 9+ times

Data Structures and Algorithms Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?