Data Structures and Algorithms

This quiz covers fundamental concepts and algorithms in Data Structures and Algorithms.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which data structure is used to store a collection of unique elements in no particular order?

  1. Array
  2. Linked List
  3. Stack
  4. Set
Question 2 Multiple Choice (Single Answer)

What is the time complexity of searching for an element in a sorted array using binary search?

  1. O(n)
  2. O(log n)
  3. O(n^2)
  4. O(1)
Question 3 Multiple Choice (Single Answer)

Which sorting algorithm is known for its divide-and-conquer approach?

  1. Bubble Sort
  2. Selection Sort
  3. Merge Sort
  4. Insertion Sort
Question 4 Multiple Choice (Single Answer)

What is the worst-case time complexity of the insertion sort algorithm?

  1. O(n)
  2. O(n^2)
  3. O(log n)
  4. O(1)
Question 5 Multiple Choice (Single Answer)

Which data structure is used to implement a queue, where elements are added at one end (rear) and removed from the other end (front)?

  1. Array
  2. Linked List
  3. Stack
  4. Queue
Question 6 Multiple Choice (Single Answer)

What is the time complexity of finding the minimum element in a binary heap?

  1. O(n)
  2. O(log n)
  3. O(n^2)
  4. O(1)
Question 7 Multiple Choice (Single Answer)

Which data structure is used to represent a collection of nodes connected by edges, where each node has a unique identifier?

  1. Array
  2. Linked List
  3. Graph
  4. Tree
Question 8 Multiple Choice (Single Answer)

What is the time complexity of the depth-first search (DFS) algorithm on a graph with V vertices and E edges?

  1. O(V)
  2. O(E)
  3. O(V + E)
  4. O(V * E)
Question 9 Multiple Choice (Single Answer)

Which sorting algorithm is known for its ability to sort a list of numbers in place?

  1. Bubble Sort
  2. Selection Sort
  3. Merge Sort
  4. Quick Sort
Question 10 Multiple Choice (Single Answer)

What is the time complexity of finding an element in a hash table with n key-value pairs using the linear probing collision resolution strategy?

  1. O(1)
  2. O(log n)
  3. O(n)
  4. O(n^2)
Question 11 Multiple Choice (Single Answer)

Which data structure is used to implement a stack, where elements are added and removed from the same end?

  1. Array
  2. Linked List
  3. Stack
  4. Queue
Question 12 Multiple Choice (Single Answer)

What is the time complexity of the breadth-first search (BFS) algorithm on a graph with V vertices and E edges?

  1. O(V)
  2. O(E)
  3. O(V + E)
  4. O(V * E)
Question 13 Multiple Choice (Single Answer)

Which sorting algorithm is known for its ability to sort a list of numbers in a stable manner?

  1. Bubble Sort
  2. Selection Sort
  3. Merge Sort
  4. Quick Sort
Question 14 Multiple Choice (Single Answer)

What is the time complexity of finding an element in a balanced binary search tree with n nodes?

  1. O(n)
  2. O(log n)
  3. O(n^2)
  4. O(1)
Question 15 Multiple Choice (Single Answer)

Which data structure is used to implement a priority queue, where elements are served based on their priority?

  1. Array
  2. Linked List
  3. Stack
  4. Priority Queue