The Gateway to Computer Science Excellence
0 votes
75 views
in a sorted array of n distinct  element finding i th largest element take o(1)  .   true / false
in Programming by Boss (10.6k points)
retagged by | 75 views
0
True.
0
yes, can u explain ?
0
if i is as large as n then ?
+1
then we can just do it , by putting it's index number directly

1 Answer

0 votes
It is true as the ith element is equal to array[i] which takes O(1)
by Junior (659 points)
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
50,737 questions
57,291 answers
198,211 comments
104,903 users