The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+1 vote

The running time of MAX_HEAPIFY on a subtree of size n rooted at a given node i is the Thete(1) time to fix up the relationships among the element A[i] , A[LEFT(i)] and A[RIGHT(i)] , plus the time to run the MAX_HEAPIFY on subtree rooted at one of the children of node i .

**The children's subtree each have size at most (2n/3) - the worst case occurs when the level of the tree is exactly half full and therefore we can describe the running time of MAX_HEAPIFY by the recurrence -**

**T(n) <= T(2n/3) + theta(1)**

Could anyone explain the bold lines in detail ?

- 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,743 users