Data Structures and Algorithms Quiz

Quiz
•
Computers
•
University
•
Medium
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
Similar Resources on Wayground
15 questions
Knowledge Knockout[Quiz Round](2nd-4th years)

Quiz
•
University
20 questions
Data Structure

Quiz
•
University
20 questions
Quiz 1_DSA

Quiz
•
University
16 questions
Linked List and Arrays in JAVA

Quiz
•
University
20 questions
Hashing

Quiz
•
University
17 questions
Linked Lists

Quiz
•
University
15 questions
DATA STRUCTURES QUIZ

Quiz
•
University
15 questions
Stacks and Queues Quiz

Quiz
•
University
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade