Yes right

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

0 votes

$(1)$ In a binary heap with $'n'$ elements with the smallest element at the root, the $7th$ smallest element can be found in time?

$A)\theta(nlogn)$ $B)\theta(n)$ $C)\theta(logn)$ $D)\theta(1)$

$(2)$ In binary max heap containing $'n'$ numbers, the smallest element can be found in time?

$A)\theta(n)$ $B)\theta(logn)$ $C)\theta(loglogn)$ $D)\theta(1)$

$(3)$ Consider the process of inserting an element into a max heap. If we perform a binary search on the path from new leaf to root, find the position of a newly inserted element, the number of comparisons performed are____________

$(4)$ We have a binary heap on $'n'$ elements and wish to insert $'n'$ more elements(not necessarily one after another) into this heap. The total time required for this is?

$A)\theta(logn)$ $B)\theta(n)$ $A)\theta(nlogn)$ $A)\theta(n^{2})$

$A)\theta(nlogn)$ $B)\theta(n)$ $C)\theta(logn)$ $D)\theta(1)$

$(2)$ In binary max heap containing $'n'$ numbers, the smallest element can be found in time?

$A)\theta(n)$ $B)\theta(logn)$ $C)\theta(loglogn)$ $D)\theta(1)$

$(3)$ Consider the process of inserting an element into a max heap. If we perform a binary search on the path from new leaf to root, find the position of a newly inserted element, the number of comparisons performed are____________

$(4)$ We have a binary heap on $'n'$ elements and wish to insert $'n'$ more elements(not necessarily one after another) into this heap. The total time required for this is?

$A)\theta(logn)$ $B)\theta(n)$ $A)\theta(nlogn)$ $A)\theta(n^{2})$

0

To find 1 smallest it will take 1 comparison

to find 2 smallest

2 smallest is either the left child of root or right child of root

For 3 smallest only 3 elements are participating in competition i e left child of 2 smallest or right child of 2 smallest or looser of 2 level

in this manner by constant conparison we can find the kth smallest in O (1) time

to find 2 smallest

2 smallest is either the left child of root or right child of root

For 3 smallest only 3 elements are participating in competition i e left child of 2 smallest or right child of 2 smallest or looser of 2 level

in this manner by constant conparison we can find the kth smallest in O (1) time

- All categories
- General Aptitude 1.6k
- Engineering Mathematics 7.3k
- Digital Logic 2.7k
- Programming & DS 4.9k
- Algorithms 4.2k
- Theory of Computation 5.4k
- Compiler Design 2.1k
- Databases 4k
- CO & Architecture 3.5k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.5k
- Admissions 570
- Exam Queries 566
- Tier 1 Placement Questions 23
- Job Queries 70
- Projects 18

48,756 questions

52,850 answers

183,548 comments

68,745 users