Complexity Analysis (Big O) - Advanced Concepts

Download Q&A
Q. What is the space complexity of a recursive depth-first search (DFS) on a binary tree?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. What is the time complexity of breadth-first search (BFS) on a graph?
  • A. O(V + E)
  • B. O(V)
  • C. O(E)
  • D. O(V^2)
Q. What is the time complexity of inserting an element into a priority queue implemented with a binary heap?
  • A. O(1)
  • B. O(log n)
  • C. O(n)
  • D. O(n log n)
Q. What is the time complexity of the bubble sort algorithm in the worst case?
  • A. O(n)
  • B. O(n log n)
  • C. O(n^2)
  • D. O(log n)
Q. What is the time complexity of the quicksort algorithm in the average case?
  • A. O(n)
  • B. O(n log n)
  • C. O(n^2)
  • D. O(log n)
Showing 1 to 5 of 5 (1 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely