Unit 5: Data Structures - Practice Quiz

CSE357 — Combinatorial Studies 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 Which of the following data structures is considered a non-linear data structure?

A. Queue
B. Tree
C. Stack
D. Linked List

2 In the context of algorithm analysis, which notation represents the asymptotic upper bound of the time requirement?

A. Little oh ()
B. Big Omega ()
C. Big Oh ()
D. Big Theta ()

3 What is the primary advantage of a Linked List over an Array?

A. Dynamic size and efficient insertion/deletion
B. Random access to elements
C. Memory locality
D. Lower memory overhead per element

4 In a Singly Linked List, what is the time complexity to access the element?

A.
B.
C.
D.

5 Which type of Linked List allows traversal in both forward and backward directions?

A. Doubly Linked List
B. Priority List
C. Singly Linked List
D. Circular Singly Linked List

6 A pointer in a linked list that does not point to any valid memory location is generally referred to as:

A. Null pointer
B. Void pointer
C. Dangling pointer
D. Wild pointer

7 If a circular linked list has a pointer to the last node, what is the time complexity to insert a node at the beginning of the list?

A.
B.
C.
D.

8 Which data structure follows the LIFO (Last In, First Out) principle?

A. Tree
B. Queue
C. Stack
D. Graph

9 What is the result of evaluating the postfix expression: ?

A. 13
B. 16
C. 10
D. 20

10 Which data structure is implicitly used by the system to handle function calls and recursion?

A. Stack
B. Heap
C. Hash Table
D. Queue

11 In a Queue implemented using a circular array of size , the condition for the queue being full is:

A. rear == N - 1
B. (front + 1) % N == rear
C. front == rear
D. (rear + 1) % N == front

12 Which operation removes an element from the front of a Queue?

A. Dequeue
B. Push
C. Enqueue
D. Pop

13 A double-ended queue (Deque) allows insertion and deletion at:

A. Only the rear
B. Both the front and the rear
C. The middle
D. Only the front

14 Implementing a Queue using two Stacks requires how many stacks?

A. 4
B. 1
C. 2
D. 3

15 What is the maximum number of nodes in a binary tree of height (where the root is at height 0)?

A.
B.
C.
D.

16 Which tree traversal visits the root node, then the left subtree, and finally the right subtree?

A. Preorder
B. Postorder
C. Level Order
D. Inorder

17 In a Binary Search Tree (BST), the Inorder traversal produces:

A. Nodes in sorted non-increasing order
B. Nodes in sorted non-decreasing order
C. Nodes based on their level
D. Random order

18 What is the worst-case time complexity for searching in an unbalanced Binary Search Tree?

A.
B.
C.
D.

19 An AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than:

A. 2
B. Any value
C. 0
D. 1

20 The number of edges in a tree with nodes is always:

A.
B.
C.
D.

21 Which data structure is commonly used to implement Breadth-First Search (BFS) in a graph?

A. Stack
B. Queue
C. Hash Map
D. Heap

22 Which data structure is commonly used to implement Depth-First Search (DFS) in a graph?

A. Stack
B. Tree
C. Priority Queue
D. Queue

23 In a graph represented by an Adjacency Matrix , if there is an edge between vertex and vertex , then:

A.
B.
C. (or weight)
D.

24 What is the space complexity of an Adjacency List representation for a graph with vertices and edges?

A.
B.
C.
D.

25 Dijkstra's algorithm is used for:

A. Finding the Minimum Spanning Tree
B. Detecting cycles in a graph
C. Topological Sorting
D. Finding the Shortest Path from a source node to all other nodes

26 Which algorithm is used to find the Minimum Spanning Tree (MST) of a graph?

A. Floyd-Warshall
B. DFS
C. Binary Search
D. Kruskal's Algorithm

27 Topological Sort is applicable to which type of graph?

A. Any Directed Graph
B. Undirected Cyclic Graph
C. Directed Acyclic Graph (DAG)
D. Undirected Acyclic Graph

28 In an undirected graph, the sum of the degrees of all vertices is equal to:

A. The number of edges
B.
C.
D.

29 A complete binary tree has a property that it is filled:

A. Only on the left side
B. From right to left
C. Randomly
D. From left to right on the last level

30 How many different binary trees can be constructed with distinct nodes?

A.
B.
C.
D.

31 Which data structure is best suited for implementing a Priority Queue?

A. Array
B. Heap
C. Linked List
D. Stack

32 In a Max-Heap, the value of a parent node is always:

A. Greater than or equal to its children
B. Less than or equal to its children
C. Equal to the sum of its children
D. Half of the left child

33 If a binary heap is stored in an array (0-indexed), the left child of the node at index is located at:

A.
B.
C.
D.

34 What is the time complexity to insert a new element into a binary heap with elements?

A.
B.
C.
D.

35 Heap Sort has a worst-case time complexity of:

A.
B.
C.
D.

36 A situation where two different keys map to the same index in a Hash Table is called:

A. Rehashing
B. Clustering
C. Collision
D. Overflow

37 Which of the following is a technique to resolve hash collisions?

A. Chaining
B. Binary Search
C. Merge Sort
D. Heapify

38 In Open Addressing, which probing method calculates the interval between probes using a second hash function?

A. Double Hashing
B. Quadratic Probing
C. Separate Chaining
D. Linear Probing

39 The Load Factor () of a hash table is defined as:

A. Size of largest chain
B. Number of collisions / Number of buckets
C. Number of buckets / Number of elements
D. Number of elements / Number of buckets

40 What is the average time complexity for Search, Insert, and Delete operations in a well-implemented Hash Table?

A.
B.
C.
D.

41 Which traversal of a Binary Search Tree (BST) sorts the elements?

A. Inorder
B. Postorder
C. Level Order
D. Preorder

42 What is the height of a balanced binary search tree with nodes?

A.
B.
C.
D.

43 Converting a general tree to a binary tree typically involves the representation:

A. Parent Pointer
B. Heap Array
C. Left-Child, Right-Sibling
D. Adjacency Matrix

44 Which of the following data structures is most appropriate for a dictionary implementation (looking up definitions by words)?

A. Queue
B. Hash Table
C. Linked List
D. Stack

45 A graph is considered connected if:

A. Every vertex has degree 1
B. It is a complete graph
C. There are no cycles
D. There is a path between every pair of vertices

46 In a binary heap, the 'Heapify' operation usually takes time proportional to:

A. The height of the tree
B. Constant time
C.
D. The number of nodes

47 The post-fix form of the expression is:

A.
B.
C.
D.

48 Which data structure is used to check for balanced parentheses in an expression?

A. Linked List
B. Queue
C. Stack
D. Binary Tree

49 Deletion of a node from a Doubly Linked List involves changing how many pointers (assuming the node is not head/tail)?

A. 3
B. 1
C. 2
D. 4

50 In the context of Hashing, what is a 'Perfect Hash Function'?

A. A function that maps every key to a distinct integer with no collisions
B. A function with load factor 1.0
C. A function that uses cryptographic security
D. A function that is very fast to compute