Algorithm 1 - Constructing the BST
ConstructBST
{
foreach flyer // n flyers
{
insert flyer in the BST // O(log n) or O(n) worst case
}
}
---------------------------------------------------------
Algorithm 2 - Picking
input: array A[1..n] with elements sorted in non-crescent oreder
N, the number of elements in the array
output: array B[1..log n] with (log n) higher flyers
Picking
{
total = log N
for i =1 to total
{
B[i] = A[i]
}
}
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
firstswap challenge | 20 | 68 | |
maven example error | 3 | 53 | |
varialbe initialization | 11 | 30 | |
tomcat administrtor | 12 | 34 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
19 Experts available now in Live!