samant.bit
BAN USER
- 0of 0 votes
AnswersWe are given a list of numbers A= {5,9,12,16,25,30,45} and their fixed probability of occurance P={0.22,0.18,0.20,0.05,0.25,0.02,0.08} where sum(p) =1. The problem is to arrange the numbers in a binary search tree in a way that minimizes the expected total access time. Note: In a binary search tree, number of comparisions needed to access element at depth d is (1+d)
- samant.bit in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Dynamic Programming - 0of 0 votes
AnswersFind the best way to cut a rod of length N units into smaller pieces such that we get maximum benefit. The prices for each smaller pieces of rod is given for cut of length from 1 to N.
- samant.bit in India
Example
Length |1 2 3 4 5 6 7 8
-----------------------------------------
price |1 5 8 9 10 17 17 20| Report Duplicate | Flag | PURGE
Directi Software Engineer / Developer - 0of 0 votes
AnswersHow will you perform the preorder and inorder traversal of binary trees without using recursion. Basically he asked first to write a method to perform iterative preorder tree traversal and then iterative inorder tree traversal.
- samant.bit in India| Report Duplicate | Flag | PURGE
Cisco Systems Software Engineer / Developer Algorithm