Construct BST from given preorder traversal Given preorder traversal of a binary search tree, construct the BST. For example, if t...
Tuesday, 24 October 2017
Sunday, 22 October 2017
Babylonian method for square root
Babylonian method for square root Algorithm: This method can be derived from (but predates) Newton–Raphson method. 1 Start with an ...
Tuesday, 17 October 2017
External Sorting
External Sorting: Example of multiway external sorting Ta1: 17, 3, 29, 56, 24, 18, 4, 9, 10, 6, 45, 36, 11, 43 Assume that we have thre...
External Sorting
External Sorting Example of Two-Way Sorting: N = 14, M = 3 (14 records on tape Ta1, memory capacity: 3 records.) Ta1: 17, 3, 29, 56, 2...
Tuesday, 3 October 2017
get right most bit
XOR=XOR & ~(XOR-1); example : xor=7 (0...0111) binary rep xor-1=6(0...0110) ~(xor-1)=(11....1001) xor&~(xor-1)=(00....0001) g...