Advanced Problem Solving:
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
Constraints: 1 <= B,L,R <= 10^9
[Link] 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
[Link] of the list
[Link] of the list
[Link] maximum value in the list
[Link] minimum value in the list
[Link] need not to be a binary tree?
[Link] tree
[Link]
[Link]-Tree
D.B-Tree
3. Which data structure is required to convert
arithmetic expression in infix to its equivalent postfix notation?
A. Queue
B. Linked list
C. Binary search tree
D. None of above
4. Binary search algorithm cannot be applied to …
A. sorted linked list
B. sorted binary trees
C. sorted linear array
D. pointer array
5. Complexity of linear search algorithm is ………
A. O(n)
B. O(logn)
C. O(n2)
6
Advanced Problem Solving:
Binary Search
Assignment Solutions
Assignment Solutions
Assignment Solutions
1.
JavaScript:
Live code- [Link]
6
Assignment Solutions
2.
JavaScript:
Live code- [Link]
1 A character of the data that binary search uses but the linear search ignore, is
AOrder of the list
BLength of the list
CThe maximum value in the list
DThe minimum value in the list
Ans : A
[Link] need not to be a binary tree?
ASearch tree
BHeap
CAVL-Tree
DB-Tree
Ans: D
3. Which data structure is required to convert
arithmetic expression in infix to its equivalent postfix notation?
(A) Queue
(B) Linked list
(C) Binary search tree
(D) None of above
Ans: D
6
Assignment Solutions
4. Binary search algorithm cannot be applied to …
A. sorted linked list
B. sorted binary trees
C. sorted linear array
D. pointer array
Ans : A
5. Complexity of linear search algorithm is ………
A. O(n)
B. O(logn)
C. O(n2)
D. O(n logn)
Ans: A