Sumanth Lingala
BAN USER
Employee at None
Questions (1)
Comments (4)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
@Nikhil:
Can you explain how to generate using catalan numbers ???
Comment hidden because of low score. Click to expand.
0
of 0 vote
Declare an bucket of size k. Then insert the element into appropriate bucket.
initialize bucket to zero
for(i = 0 ; i < n; i++)
{
bucket[inputarray[i]] ++;
if(bucket[inputarray[i]] == 2)
return the element, position and continue to find next repeating element
}
Time: Linear
Comment hidden because of low score. Click to expand.
0
of 0 vote
how about splay trees ?????
build using splay trees and then enumerate and display 10% of them.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
dont you think it should be a binary heap ????
- Sumanth Lingala February 27, 2010