• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Segment Trees and Binary Indexed Trees Quiz CIP

Question 1

What is the time complexity of building a segment tree?

  • O( n^2 )

  • O( n )

  • O(n log n)

  • O( log n )

Question 2

What is the time complexity of querying a range in a segment tree?

  • O(1) 

  • O(log n) 

  • O(n log n)

  • O(n) 

Question 3

Which of the following operations can be performed on a segment tree?

  • Minimum value in a range 

  • Maximum value in a range

  • Sum of values in a range

  • All of the above

Question 4

What is the maximum number of nodes in a segment tree of size n?

  • n

  • n^2

  • n^3

  • n log n

Question 5

Which data structure is used to store a binary indexed tree?

  • Array

  • Linked List

  • Heap

  • Stack

Question 6

What is the space complexity of a binary indexed tree?

  • O( n^2 )

  • O( n log n )

  • O( n )

  • None of these

Question 7

What is the time complexity of updating a single element in a binary indexed tree?

  • O(1)

  • O( n )

  • O( n log n )

  • O( log n )

Question 8

Is a binary indexed tree a balanced tree structure? 

  • Yes

  • No

  • It depends upon the implementation

  • None of the above

Question 9

Which of the following operations can be performed on a binary indexed tree?

  • Minimum value in a range

  • Maximum value in a range

  • Sum of values in a range

  • All of the above

Question 10

What is the time complexity of querying a range in a binary indexed tree?

  • O(1)

  • O(log n)

  • O(n log n)

  • O(n)

There are 10 questions to complete.

Last Updated :
Take a part in the ongoing discussion