Lesson 2.3.1b

2.3.1b Traversal of data structures and standard sorting, search and shortest-path algorithms Quiz: OCR Computer Science, Unit 8

20 questions

In partnership with Revision Ninja

Lesson 2.3.1b, Traversal of data structures and standard sorting, search and shortest-path algorithms: 20 multiple choice questions for the OCR Computer Science (H446), Unit 8: Algorithms, written with Revision Ninja.

Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.

Host this setFree Play

The 20 questions

  1. What is the worst-case time complexity of a binary search on a sorted array?

    • O(n)
    • O(log n)
    • O(n^2)
    • O(1)
  2. Which data structure is used to implement a Breadth-First Search on a graph?

    • Linked list
    • Array
    • Queue
    • Stack
  3. Which tree traversal order visits the root node before visiting any child nodes?

    • In-order
    • Breadth-first
    • Post-order
    • Pre-order
  4. What traversal of a Binary Search Tree outputs node values in ascending sorted order?

    • Level-order
    • Post-order
    • In-order
    • Pre-order
  5. Which algorithm uses a heuristic function alongside path cost to find the shortest path?

    • Breadth-first search
    • Binary search
    • Dijkstra's algorithm
    • A* search
  6. What is the average-case time complexity of the merge sort algorithm?

    • O(log n)
    • O(n^2)
    • O(n log n)
    • O(n)
  7. Which tree traversal algorithm is commonly used to safely delete an entire binary tree?

    • In-order
    • Pre-order
    • Breadth-first
    • Post-order
  8. Which search algorithm requires the dataset to be sorted before execution?

    • Linear search
    • Breadth-first search
    • Binary search
    • Depth-first search
  9. Which data structure is primarily used to implement a Depth-First Search?

    • Priority queue
    • Queue
    • Hash table
    • Stack
  10. What is the best-case time complexity of an insertion sort on an already sorted array?

    • O(1)
    • O(n log n)
    • O(n^2)
    • O(n)
  11. Which algorithm calculates the shortest path from a starting node in a weighted graph?

    • Binary search
    • Bubble sort
    • Kruskal's algorithm
    • Dijkstra's algorithm
  12. What is the worst-case time complexity of the quick sort algorithm?

    • O(log n)
    • O(n log n)
    • O(n^2)
    • O(n)
  13. Which sorting algorithm repeatedly steps through a list, comparing and swapping adjacent items?

    • Merge sort
    • Bubble sort
    • Binary insertion sort
    • Quick sort
  14. What is the worst-case time complexity of a linear search through an array?

    • O(n)
    • O(log n)
    • O(n^2)
    • O(1)
  15. What sequence of operations defines a pre-order binary tree traversal?

    • Right, Root, Left
    • Left, Root, Right
    • Left, Right, Root
    • Root, Left, Right
  16. Which algorithm approach breaks a sorting problem into smaller sub-problems before combining solutions?

    • Backtracking
    • Greedy approach
    • Divide and conquer
    • Dynamic programming
  17. Which graph traversal algorithm explores all neighbours at the present depth before moving deeper?

    • Breadth-First Search
    • Depth-First Search
    • Binary Search
    • Linear Search
  18. What sequence of operations defines a post-order binary tree traversal?

    • Root, Left, Right
    • Left, Root, Right
    • Right, Left, Root
    • Left, Right, Root
  19. Which heuristic-based search algorithm is widely used in pathfinding for video game maps?

    • Depth-first search
    • Dijkstra's algorithm
    • Linear search
    • A* search
  20. What is the worst-case space complexity of a recursive Depth-First Search call stack?

    • O(h)
    • O(1)
    • O(n^2)
    • O(2^n)

All OCR Computer Science quizzes