in Written Exam
497 views
0 votes
0 votes
There is a height-balanced tree T storing n elements. The greatest element smaller than x in T is called the predecessor of s in T. Given any positive number k, we wish to compute k predecessors of x in T. What is the time complexity of the best algorithm that can do this task?

A. O(k + log n)

B. O(k log n)

C. O(log(n + k))

D. O(n + k)
in Written Exam
497 views

4 Comments

How?
0
0
@srestha ,please provide your solution.
0
0
1 predecessor find we can do in logn times

k predecessor we can find in klogn

rt?
0
0

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true