Data Structures and Algorithms Quiz
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Social Media
Used 9+ times
FREE Resource
Enhance your content in a minute
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

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
16 questions
Python Basics
Quiz
•
KG - University
17 questions
Graph Theory Data Structures
Quiz
•
University
20 questions
Responsi PL 2021/2022
Quiz
•
University
15 questions
DCN1A - OSI & TCP/IP MODEL
Quiz
•
University
18 questions
Programming in C language
Quiz
•
12th Grade - University
17 questions
Java Collection Framework
Quiz
•
University
20 questions
Manipuler des bases de données
Quiz
•
University
21 questions
Quizzz 1.0
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
