Question

what is the common between binary search tree and B tree? Can all the binary search tree be considered a special case of some vaild B tree why or why not?

Answer #1

The common difference between binary search tree and B tree is that, in binary tree there is no ordering of the nodes whereas in binary search tree the nodes are ordered in a way such that the left subtree is lesser than the parent nodes and the parent nodes are less than the right sub tree.

Yes, all binary search tree can be considered a special case of same valid B tree because of the following reasons:

1) Every nodes in the tree has a key value which is different from all the values present in tree

2) Left sub trees are smaller than nodes which infact smaller than the right sub tree.

3) In order to allow more than two child nodes the B tree generalises the Binary search tree

If you liked the solution then give a thumbs up ? it will be really appreciated ?

a) Design a recursive linear-time algorithm that tests whether a
binary tree is a binary search tree. Describe your algorithm in
English or with a simple pseudocode program. b) (3 bonus pts.)
Extend the algorithm in a) to test whether a binary tree is an AVL
tree.

How can I prove that any node of a binary search tree of n nodes
can be made the root in at most n − 1 rotations?

Consider a binary search tree where each tree node v has a field
v.sum which stores the sum of all the keys in the subtree rooted at
v. We wish to add an operation SumLE(K) to this binary search tree
which returns the sum of all the keys in the tree whose values are
less than or equal to K.
(a) Describe an algorithm, SumLE(K), which returns the sum of
all the keys in the tree whose values are less...

Write a C++ program that checks whether a binary search tree is
an AVL. The input is an arbitrary binary search tree, and the
output is binary, so either true or false.

What is the output of the Euler tour in the normal binary
search tree if the key insert order is 5 , 2 , 8 , 5 , 9 , 5 , 1 ,
3 , 4 , 2 , 8 ? All keys equal to the node should be the right
subtree of that node.
____________________________________________________________
Construct the binary max - heap for the keys given below. Once
all the keys are inserted, perform the remove maximum operation,
and...

Given the list of values below, create a Binary Search Tree for
the list, Use the first value in the list as the root of the tree,
add the nodes to BST in the order they appear in the list.[50, 44,
82, 39, 35, 98, 87, 100, 74, 23, 34, 14, 94]
What is the minimum height of a Binary Tree that contains
24nodes?
What is the minimum height of a Binary Tree that contains
64nodes?
What is the minimum...

Redo the binary search tree class to implement lazy deletion.
Note carefully that this affects all of the routines. Especially
challenging are findMin and findMax, which must now be done
recursively.

This assignment involves using a binary search tree (BST) to
keep track of all words in a text document. It produces a
cross-reference, or a concordance. This is very much like
assignment 4, except that you must use a different data structure.
You may use some of the code you wrote for that assignment, such as
input parsing, for this one.
Remember that in a binary search tree, the value to the left of
the root is less than the...

Put these integers into a binary search tree and then state the
output of a postorder traversal.
Put EXACTLY ONE SPACE between each integer, so your output looks
like this:
1 2 3 4 5
These are the integers to put into the tree:
41 17 80 25 8 11 50 60 100
Output: ____

Put these integers into a binary search tree and then state the
output of a preorder traversal.
Put EXACTLY ONE SPACE between each integer, so your output looks
like this:
1 2 3 4 5
These are the integers to put into the tree:
41 17 80 25 8 11 50 60 100
Output: ____

ADVERTISEMENT

Get Answers For Free

Most questions answered within 1 hours.

ADVERTISEMENT

asked 20 minutes ago

asked 51 minutes ago

asked 54 minutes ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 1 hour ago

asked 2 hours ago

asked 2 hours ago

asked 2 hours ago

asked 2 hours ago

asked 2 hours ago