in DS retagged by
1,610 views
1 vote
1 vote

Which of the following need not be a binary tree?

  1. Search tree
  2. Heap
  3. AVL tree
  4. B tree
in DS retagged by
by
1.6k views

4 Comments

What is the answer given..

is it both a and b
0
0
Option D
1
1

@haralk10 see my answer, even A and B are correct.

0
0

5 Answers

4 votes
4 votes

Will be both Heap and B tree.

Heaps
Definition: A heap is a specialized tree-based data structure that satisfied the heap property:
  • if B is a child node of A, then key(A) ≥ key(B). This implies that an element with the greatest key is always in the root node, and so such a heap is sometimes called a max-heap. Of course, there's also a min-heap.

Variants:

  • 2-3 heap
  • Binary Heap
  • Many many others

Binary heap storage rules  -- A heap implemented with a binary tree in which the following two rules are followed:

  • The element contained by each node is greater than or equal to the elements of that node's children.
  • The tree is a complete binary tree.

So heap needn't be binary always.

AVL tree is BST with balancing factor.

Source: https://www.cpp.edu/~ftang/courses/CS241/notes/heap.htm

2 Comments

@smshubham : you are half correct.

you have wriiten that $\text{B tree}$ are not necessarily binary .It is correct.where is your explanation?
0
0

@sourav

The B-tree is a generalization of a binary search tree in that a node can have more than two children

Source: https://en.wikipedia.org/wiki/B-tree

0
0
1 vote
1 vote
B tree...................... B trees need not be the binary tree. B trees may have more than 2 children....

order of B tree is max. no. of children a node can have..

4 Comments

let me see a binary tree with more than 2 children!!!!

0
0
binary tree always have  2 children...but B trees need not be only 2 children it may have more than 2 children.....
2
2

Priyanka Agarwal  yes you are right

0
0
I don't think this is correct. Check my answer.
0
0
1 vote
1 vote
Search Tree => Can be Binary or n ary (Even B+ tree, AVL Tree are search tree only)

Heap => Can be binary as well as n ary

AVL Tree => Also a search tree, usually its binary. (didn't get any reference saying otherwise)

B Tree => Not necessarily a binary tree.

So A,B,D need not be a binary tree.

But in exam one can select D, as that maybe most appropriate "as per examiner".
0 votes
0 votes
B-Tree is the answer as it can bee m-ary .

heap is almost complete binary tree and AVL tree is height balanced binary tree.
Answer:

Related questions