Computer Science, asked by hellowprem5316, 1 year ago

What is tree and types of tree in data structure?

Answers

Answered by Anushka0408
4
In computer science, a tree is a widely used abstract data type (ADT)—or data structure implementing this ADT—that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.

There are different types of tree data structures. Some of them are

Binary Tree: This is the most basic basic from of tree structure. Where each node can have utmost two children. A perfect binary tree is a binary tree in which all interior nodes have two children and all leaves have the same depth or same level.

Binary search tree: BST is a binary tree with certain properties such as , and left child of the given node contains value less than equal to the given node and right hand child contain node greater than the given node.

AVL tree or height balanced binary tree: It is a variation of the Binary tree where height difference between left and right sub tree can be at most 1. If at any time they differ by more than one, rebalancing is done to restore this property. Lookup, insertion, and deletion all take O(log n) time in both the average and worst cases, where n is the number of nodes in the tree prior to the operation.

Red-Black tree: Another variant of binary tree similar to AVL tree it is a self balancing binary search tree. In this tree nodes are either colored red or black.

Splay tree: A splay tree is a self-adjusting binary search tree with the additional property that recently accessed elements are quick to access again.

arun223: hi
arun223: how ru
Answered by Anonymous
7

Answer:

A tree is a Hierarchical data structure that naturally stores the information in a hierarchical fashion. The Tree data structure is one of the most efficient and mature. The nodes connected by the edges are represented. Properties of Tree: Every tree has a specific root node.

Similar questions