Data Structures and Algorithms
This quiz covers fundamental concepts and algorithms in Data Structures and Algorithms.
Questions
Which data structure is used to store a collection of unique elements in no particular order?
- Array
- Linked List
- Stack
- Set
What is the time complexity of searching for an element in a sorted array using binary search?
- O(n)
- O(log n)
- O(n^2)
- O(1)
Which sorting algorithm is known for its divide-and-conquer approach?
- Bubble Sort
- Selection Sort
- Merge Sort
- Insertion Sort
What is the worst-case time complexity of the insertion sort algorithm?
- O(n)
- O(n^2)
- O(log n)
- O(1)
Which data structure is used to implement a queue, where elements are added at one end (rear) and removed from the other end (front)?
- Array
- Linked List
- Stack
- Queue
What is the time complexity of finding the minimum element in a binary heap?
- O(n)
- O(log n)
- O(n^2)
- O(1)
Which data structure is used to represent a collection of nodes connected by edges, where each node has a unique identifier?
- Array
- Linked List
- Graph
- Tree
What is the time complexity of the depth-first search (DFS) algorithm on a graph with V vertices and E edges?
- O(V)
- O(E)
- O(V + E)
- O(V * E)
Which sorting algorithm is known for its ability to sort a list of numbers in place?
- Bubble Sort
- Selection Sort
- Merge Sort
- Quick Sort
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?
- O(1)
- O(log n)
- O(n)
- O(n^2)
Which data structure is used to implement a stack, where elements are added and removed from the same end?
- Array
- Linked List
- Stack
- Queue
What is the time complexity of the breadth-first search (BFS) algorithm on a graph with V vertices and E edges?
- O(V)
- O(E)
- O(V + E)
- O(V * E)
Which sorting algorithm is known for its ability to sort a list of numbers in a stable manner?
- Bubble Sort
- Selection Sort
- Merge Sort
- Quick Sort
What is the time complexity of finding an element in a balanced binary search tree with n nodes?
- O(n)
- O(log n)
- O(n^2)
- O(1)
Which data structure is used to implement a priority queue, where elements are served based on their priority?
- Array
- Linked List
- Stack
- Priority Queue