Question

Draw a binary decision tree for searching a four-element ordered list by sequantial search. (explain each...

Draw a binary decision tree for searching a four-element ordered list by sequantial search. (explain each step in thorough detail.)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

This is a very straightforward question. Use the obvious observation that sequential search in a sorted array can be stopped as soon as an element larger than the search key is encountered.

You can go also with the second different decision tree.

For this idea, you just made the right skewed tree so that the sorted list could be easily traversed sequentially.

As given list contains sorted element, and we have to search an element among them, so just by traversing the following tree,

check

if required element == A[0] then go to left side and terminate.

else check required element == A[1] then go to its left side and terminate.

else check required element == A[2] then go to its left side and terminate.

else check required element == A[3] then go to its left side and terminate.

else element is not found in the list.

By following this, we can construct decision tree as follows:

Please give thumbsup, if you like it. Thanks.

Add a comment
Know the answer?
Add Answer to:
Draw a binary decision tree for searching a four-element ordered list by sequantial search. (explain each...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A Binary Search Tree is a binary tree where nodes are ordered in the following way:...

    A Binary Search Tree is a binary tree where nodes are ordered in the following way: each node contains one key (also known as data) the keys in the left subtree are less than the key in its parent node the keys in the right subtree are greater than the key in its parent node duplicate keys are not allowed Create a Binary Search Tree inserting the following list of numbers in order from left to right. 10,          6,           4,            8,            18,          15,          21 Please type...

  • C++ : Implement the ordered list type using a pointer-based binary search tree. The elements of...

    C++ : Implement the ordered list type using a pointer-based binary search tree. The elements of the class's lists are integers, but it should be easy to change this type. The class should implement the following operations on ordered lists of its element type: Initialize a list to be empty (the default constructor). A destructor that deletes the dynamic memory in the tree that represents a list. Re-initialize an existing list to be empty. Insert a value into a list,...

  • A collection of nodes is arranged as a binary search tree ordered on the field INFO which contain...

    A collection of nodes is arranged as a binary search tree ordered on the field INFO which contains distinct positive integers for each of the nodes. In addition to INFO, LLINK and RLINK, each node has three other fields CLASS SUCC and PRED CLASS is an information field containing a single letter that denotes the class to which the node belongs (there being up to 26 classes). The nodes in each class are arranged as a doubly-linked circular list with...

  • The binary search algorithm from Chapter 9 is a very efficient algorithm for searching an ordered...

    The binary search algorithm from Chapter 9 is a very efficient algorithm for searching an ordered list. The algorithm (in pseudocode) is as follows: highIndex - the maximum index of the part of the list being searched lowIndex - the minimum index of the part of the list being searched target -- the item being searched for //look in the middle middleIndex = (highIndex + lowIndex) / 2 if the list element at the middleIndex is the target return the...

  • 14. (10 points) Using a binary search tree algorithm, draw and explain the tree that describes the following sentence. Discrete math is fun but sometimes hard. 14. (10 points) Using a binary...

    14. (10 points) Using a binary search tree algorithm, draw and explain the tree that describes the following sentence. Discrete math is fun but sometimes hard. 14. (10 points) Using a binary search tree algorithm, draw and explain the tree that describes the following sentence. Discrete math is fun but sometimes hard.

  • Let TB and T2-3 be, respectively, a classical binary search tree and a 2-3 tree constructed...

    Let TB and T2-3 be, respectively, a classical binary search tree and a 2-3 tree constructed for the same list of keys inserted in the corresponding trees in the same order. True or false: Searching for the same key in T2-3 always takes fewer or the same number of key comparisons as searching in Tg?

  • In C++ Given a pointer to the root of a binary search tree (has left, right,...

    In C++ Given a pointer to the root of a binary search tree (has left, right, and parent pointers as well as a data section ) write a function (or functions) which will return an STL list (you should not define this class, it’s already included) with all of the values from the tree in sorted order. Your code should run in theta(N) time. for the second part,.given a pointer to the first node of a linked list, you are...

  • Starting with an empty binary search tree, insert each of the following keys and rotate it...

    Starting with an empty binary search tree, insert each of the following keys and rotate it to the root in the specified order: 6   1   18   7   15 Starting with an empty red-black binary search tree, insert the following keys in order:: 12   5   23   9   19   2   21   18   7 Show the tree immediately after you insert each key, and after each time you deal with one of the book's cases 1, 2, or 3 (that is, if dealing with one case leads to another, show the additional case as a...

  • Q1: How many levels your binary search tree has (including level 0)? Is the binary search...

    Q1: How many levels your binary search tree has (including level 0)? Is the binary search tree you created height balanced? 2.1 Click the animations “Binary Search Tree”. Click “Insert” button to insert the following elements in the sequence, “50, 20, 30, 70, 90, 80, 40, 10, 5, 60, 85, 95”. http://algoanim.ide.sk/index.php?page=showanim&id=44 Q2: What is the insertion process of the binary search tree? The new identical element is inserted as left or right child of the existing same value? 2.3...

  • Typed please. There are some basic requirements for the binary search tree data structure with regard...

    Typed please. There are some basic requirements for the binary search tree data structure with regard to how the left and right sub-tree key values must compare to the current node. This is the fundamental reason this data structure works well for searching. Can you explain how this relates to the searching the structure?

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT