Arrays, Stacks & Queues Basics

Practice core linear structures: arrays, stacks, and queues. Ideal for students and interview prep.

10

Questions

00

Attempts

00

Passed

00

Failed

00

Likes

30

Views

00

Shares

Arrays, Stacks & Queues Basics
QUESTION NO 01
Share
Which data structure uses FIFO (First In, First Out)?

Answer: Queue
A queue removes elements in the order they were added — FIFO.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 02
Share
Which data structure uses LIFO (Last In, First Out)?

Answer: Stack
A stack pops the most recently pushed item — LIFO.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 03
Share
Average time complexity of binary search on a sorted array is?

Answer: O(log n)
Binary search halves the search space each step, giving O(log n).
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 04
Share
A linked list stores elements as?

Answer: Nodes with data and pointers
Each node holds data and a reference/pointer to the next node.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 05
Share
Which traversal visits left subtree, root, then right subtree?

Answer: Inorder
Inorder is left → root → right.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 06
Share
A hash table ideally provides average lookup time of?

Answer: O(1)
With a good hash function and load factor, average lookup is O(1).
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 07
Share
Which sorting algorithm has average time complexity O(n log n)?

Answer: Merge sort
Merge sort divides and merges in O(n log n) average and worst case.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 08
Share
In a binary tree, each node has at most how many children?

Answer: 2
By definition a binary tree node has 0, 1, or 2 children.
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 09
Share
Dijkstra's algorithm finds?

Answer: Shortest paths from a source in a weighted graph
Dijkstra computes shortest paths from one source (non-negative weights).
302 Quizzes
2930 Questions
00 Likes
QUESTION NO 10
Share
Space complexity of an in-place algorithm is typically?

Answer: O(1) extra space
In-place algorithms use constant (or very small) extra memory beyond the input.
302 Quizzes
2930 Questions
00 Likes

Published By

Shahzad Mahota

@shahzad-mahota

WAS THIS QUIZ HELPFUL?
Please help us improve by giving us your feedback.
WAS THIS QUIZ HELPFUL?
Quiz complete See your shareable result poster
View result