Advanced Problem Solving Binary Search
Advanced Problem Solving Binary Search
Binary Search
Assignment Questions
Assignment Questions
Assignment -Question
1.N rectangles of the same size are supplied to you: B in width and L in length. It is necessary to determine the
smallest square into which these rectangles can be completely packed. (It's worth noting that rectangles can't
be rotated or adjusted.)
Sample input: B = 2, L = 3, R = 10
Sample output: 9
2.Given an N-dimensional array of sorted elements, where each element appears twice and only one element
appears once. Find the unique element that takes less than O(n) time.
1. A character of the data that binary search uses but the linear search ignore, is
A.Search tree
B.Heap
C.AVL-Tree
D.B-Tree
A. Queue
B. Linked list
D. None of above
D. pointer array
A. O(n)
B. O(logn)
C. O(n2)
6
Advanced Problem Solving:
Binary Search
Assignment Solutions
Assignment Solutions
Assignment Solutions
1.
JavaScript:
6
Assignment Solutions
2.
JavaScript:
Ans : A
ASearch tree
BHeap
CAVL-Tree
DB-Tree
Ans: D
(A) Queue
Ans: D
6
Assignment Solutions
D. pointer array
Ans : A
A. O(n)
B. O(logn)
C. O(n2)
D. O(n logn)
Ans: A