Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

University

20 Qs

quiz-placeholder

Similar activities

DESAINGRAFIS 4

DESAINGRAFIS 4

12th Grade - University

15 Qs

Lab Activity 7

Lab Activity 7

University

15 Qs

PSP Module-4

PSP Module-4

University

20 Qs

DSA5541 Quiz 1 TRI 2210

DSA5541 Quiz 1 TRI 2210

University

20 Qs

C Programming Unit-1 Test-2

C Programming Unit-1 Test-2

University

20 Qs

TEST1.PY

TEST1.PY

10th Grade - University

20 Qs

PYTHON-QUIZ-2023

PYTHON-QUIZ-2023

University

17 Qs

GEMATMW - Cryptography

GEMATMW - Cryptography

University - Professional Development

16 Qs

Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Social Media

Used 9+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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?

Discover more resources for Computers