Data Structures and Algorithms Quiz

Quiz
•
Computers
•
University
•
Medium
Social Media
Used 9+ 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
CP - Quiz 01

Quiz
•
University
20 questions
Techies's Question Set for Club Day

Quiz
•
University
15 questions
DS Module 3 Linked List

Quiz
•
University
15 questions
Seatwork (SEQUENTIAL CONTAINER TYPES) data structure

Quiz
•
University
20 questions
New DSC Quiz

Quiz
•
University
20 questions
Data Structure

Quiz
•
University
25 questions
Kuis PD M11

Quiz
•
University
16 questions
Algoritma dan Struktur Data

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University