Unit 5 - Practice Quiz

CSE357 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. Stack
B. Queue
C. Linked List
D. Tree

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

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

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

A. Random access to elements
B. Dynamic size and efficient insertion/deletion
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. Singly Linked List
B. Circular Singly Linked List
C. Doubly Linked List
D. Priority List

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

A. Void pointer
B. Null 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. Queue
B. Stack
C. Tree
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. Queue
B. Heap
C. Stack
D. Hash Table

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

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

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

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

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

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

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

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

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. Inorder
B. Preorder
C. Postorder
D. Level Order

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

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

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. 0
B. 1
C. 2
D. Any value

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. Heap
D. Hash Map

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

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

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

A.
B. (or weight)
C.
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. Finding the Shortest Path from a source node to all other nodes
C. Topological Sorting
D. Detecting cycles in a graph

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

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

27 Topological Sort is applicable to which type of graph?

A. Undirected Cyclic Graph
B. Directed Acyclic Graph (DAG)
C. Undirected Acyclic Graph
D. Any Directed 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. From right to left
B. From left to right on the last level
C. Randomly
D. Only on the left side

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. Linked List
C. Heap
D. Stack

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

A. Less than or equal to its children
B. Greater 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. Collision
C. Overflow
D. Clustering

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

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

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

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

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

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

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. Preorder
B. Inorder
C. Postorder
D. Level Order

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. Left-Child, Right-Sibling
B. Parent Pointer
C. Adjacency Matrix
D. Heap Array

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

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

45 A graph is considered connected if:

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

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

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

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. Queue
B. Stack
C. Linked List
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. 1
B. 2
C. 3
D. 4

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

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