2. Describe how the concept of a Binary Search Tree (BST) is an example of both a greedy algorithm and a divide & conquer algorithm?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
2. Describe how the concept of a Binary Search Tree (BST) is an example of both a
greedy algorithm and a divide & conquer algorithm?
Transcribed Image Text:2. Describe how the concept of a Binary Search Tree (BST) is an example of both a greedy algorithm and a divide & conquer algorithm?
Expert Solution
Step 1

Greedy Binary Search Tree 

are not destined to be ideal, yet they are destined to be almost ideal. Other unmistakable, almost ideal, tree developments are found in Mehlhorn [1975, 1977] and in Horibe and Nemetz [1979]. An examination of all these and different calculations for the age of almost ideal twofold inquiry trees shows up in Korsh [1982]. The verification that the accompanying voracious strategy yields almost ideal trees is in Korsh [1981]. 

In building an almost ideal double hunt tree by the ravenous technique, the software engineer should guarantee that the arrangement is a paired pursuit tree. Taking a gander at the ideal tree found by the previous segment's calculation will give the thought behind the ravenous tree development. Think about the tree being produced by making the subtrees , consistently, beginning with the subtree with k4 at its root and finishing with the last ideal tree. Each subtree has its worth (the amount of its loads) related with it.

Example - Activity Selection 

Issue: for a given arrangement of exercises a1 ... an, every ai utilizing an asset solely in span [si, fi), discover a timetable that boost the quantity of viable exercises. 

Dynamic programming arrangement: think about Sij, the arrangement of all exercises viable with ai and aj where fi < sj, at that point at last choose the size of the greatest viable subset of S0,n+1. For each Sij, the size of the greatest viable subset can be acquired by experiencing all ak in the set, so to recursively diminish the issue to Sik and Skj. 

Avaricious arrangement: recursively discover the movement that is viable with the current timetable while having the most punctual completion time, and add it into the timetable. 

The arrangement can be end up being ideal: the most punctual completed movement should be in the ideal arrangement. 

A recursive calculation at first called as Recursively-Activity-Selector(s, f, 0, n+1), with the exercises arranged by finish time.

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY