C949 - Data Structure and Algorithms Practice Test

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:33 PM on 4/13/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

Which data structure follows the "First-In-First-Out" (FIFO) principle?

a. Stack

b. Queue

c. Linked List

d. Tree

Queue

2
New cards

Which sorting algorithm has a worst-case time complexity of O(n^2)?

a. Bubble Sort

b. Merge Sort

c. Quick Sort

d. Insertion Sort

Bubble Sort

3
New cards

In a binary search tree (BST), what is the property of the left child compared to the parent node?

a. It is greater than the parent node.

b. It is less than the parent node.

c. It is equal to the parent node.

d. There is no specific relationship.

It is less than the parent node.

4
New cards

Which data structure provides constant-time average-case insertion, deletion, and retrieval operations?

a. Array

b. Linked List

c. Hash Table

d. Stack

Hash Table

5
New cards

Which algorithm is used to find the shortest path between nodes in a graph? a. Breadth-First Search (BFS)

b. Depth-First Search (DFS)

c. Dijkstra's Algorithm

d. Bellman-Ford Algorithm

Dijkstra's Algorithm

6
New cards

Which data structure uses the "Last-In-First-Out" (LIFO) principle?

a. Queue

b. Heap

c. Stack

d. Hash Table

Stack

7
New cards

Which sorting algorithm has the best average-case time complexity?

a. Bubble Sort

b. Selection Sort

c. Insertion Sort

d. Quick Sort

Quick Sort

8
New cards

Which data structure is based on a hierarchical relationship between elements?

a. Stack

b. Queue

c. Linked List

d. Tree

Tree

9
New cards

Which algorithm is used to traverse a binary tree in an in-order manner?

a. Depth-First Search (DFS)

b. Breadth-First Search (BFS)

c. Preorder Traversal

d. Inorder Traversal

Inorder Traversal

10
New cards

Which data structure is used to implement a priority queue?

a. Queue

b. Stack

c. Heap

d. Linked List

Heap

11
New cards

Which sorting algorithm has the best worst-case time complexity of O(n log n)?

a. Bubble Sort

b. Merge Sort

c. Selection Sort

d. Insertion Sort

Merge Sort

12
New cards

In a binary search tree (BST), what is the property of the right child compared to the parent node?

a. It is greater than the parent node.

b. It is less than the parent node.

c. It is equal to the parent node.

d. There is no specific relationship.

It is greater than the parent node.

13
New cards

Which data structure is suitable for implementing a stack?

a. Array

b. Linked List

c. Hash Table

d. Heap

Linked List

14
New cards

Which algorithm is used to find the minimum spanning tree in a weighted graph?

a. Breadth-First Search (BFS)

b. Depth-First Search (DFS)

c. Dijkstra's Algorithm

d. Prim's Algorithm

Prim's Algorithm

15
New cards

Which data structure allows efficient insertion, deletion, and retrieval operations with a time complexity of O(1)?

a. Array

b. Linked List

c. Hash Table

d. Stack

Hash Table

16
New cards

Which sorting algorithm works by repeatedly finding the maximum element and moving it to the end?

a. Bubble Sort

b. Quick Sort

c. Insertion Sort

d. Merge Sort

Bubble Sort

17
New cards

Which data structure is used to represent a hierarchical relationship between elements with a single parent and multiple children?

a. Stack

b. Queue

c. Linked List

d. Tree

Tree

18
New cards

Which algorithm is used to traverse a binary tree in a post-order manner?

a. Depth-First Search (DFS)

b. Breadth-First Search (BFS)

c. Preorder Traversal

d. Postorder Traversal

Postorder Traversal

19
New cards

What is the purpose of analyzing algorithms?

a. To understand their implementation details

b. To determine their runtime complexity

c. To optimize their memory usage

d. To improve their user interface

To determine their runtime complexity

20
New cards

Which of the following is NOT a characteristic of an algorithm?

a. Finiteness

b. Determinism

c. Adaptability

d. Input and Output

Adaptability

21
New cards

What is the worst-case time complexity of a linear search algorithm?

a. O(1)

b. O(log n)

c. O(n)

d. O(n^2)

O(n)

22
New cards

Which algorithmic paradigm divides a problem into smaller subproblems and solves them independently?

a. Greedy algorithm

b. Divide and conquer

c. Dynamic programming

d. Backtracking

Divide and conquer

23
New cards

Which sorting algorithm has an average-case time complexity of O(n log n)? a. Bubble sort

b. Selection sort

c. Insertion sort

d. Merge sort

Merge sort

24
New cards

What is the purpose of Big O notation in algorithm analysis?

a. To represent the best-case time complexity of an algorithm

b. To compare the performance of different algorithms

c. To estimate the actual runtime of an algorithm

d. To count the number of operations in an algorithm

To compare the performance of different algorithms

25
New cards

What is the primary data structure used in a depth-first search (DFS) algorithm?

a. Stack

b. Queue

c. Linked list

d. Heap

Stack

26
New cards

Which algorithm is used to find the shortest path between nodes in a weighted graph?

a. Breadth-first search (BFS)

b. Depth-first search (DFS)

c. Dijkstra's algorithm

d. Prim's algorithm

Dijkstra's algorithm

27
New cards

Which technique involves reducing a problem to smaller subproblems and solving them recursively?

a. Greedy technique

b. Divide and conquer

c. Backtracking

d. Dynamic programming

Divide and conquer

28
New cards

What is the purpose of an algorithm's pseudocode?

a. To serve as an executable program

b. To provide a formal specification of the algorithm

c. To generate random test cases for the algorithm

d. To analyze the memory usage of the algorithm

To provide a formal specification of the algorithm

29
New cards

Which of the following is NOT a common algorithmic paradigm?

a. Greedy algorithm

b. Divide and conquer

c. Backtracking

d. Sequential search

Sequential search

30
New cards

What is the time complexity of a binary search algorithm?

a. O(1)

b. O(log n)

c. O(n)

d. O(n^2)

O(log n)

31
New cards

Which algorithm is used to find the maximum sum of a subarray in an array?

a. Breadth-first search (BFS)

b. Depth-first search (DFS)

c. Dijkstra's algorithm

d. Kadane's algorithm

Kadane's algorithm

32
New cards

What does the term "in-place" mean in the context of sorting algorithms?

a. The algorithm sorts the elements in ascending order.

b. The algorithm rearranges the elements without using additional memory.

c. The algorithm modifies the input array directly.

d. The algorithm guarantees the best-case time complexity.

The algorithm rearranges the elements without using additional memory.

33
New cards

Which algorithm is used to find the shortest path in an unweighted graph?

a. Breadth-first search (BFS)

b. Depth-first search (DFS)

c. Dijkstra's algorithm

d. Bellman-Ford algorithm

Breadth-first search (BFS)

34
New cards

What is the purpose of analyzing the space complexity of an algorithm?

a. To determine the best-case time complexity of the algorithm

b. To estimate the actual runtime of the algorithm

c. To analyze the memory usage of the algorithm

d. To optimize the algorithm's execution speed

To analyze the memory usage of the algorithm

35
New cards

Which data structure is typically used to implement a queue?

a. Array

b. Linked list

c. Stack

d. Hash table

Linked list

36
New cards

What is the purpose of a sentinel node in a linked list?

a. To mark the beginning of the linked list

b. To indicate the end of the linked list

c. To store a special value in the linked list

d. There is no such thing as a sentinel node

To indicate the end of the linked list

37
New cards

Which algorithm is used to find the longest common subsequence between two sequences?

a. Breadth-first search (BFS)

b. Depth-first search (DFS)

c. Dijkstra's algorithm

d. Longest Common Subsequence (LCS) algorithm

Longest Common Subsequence (LCS) algorithm