answersLogoWhite

0

The question itself is a bit vague since it doesn't suggest whether you're asking about the types of trees or the operations which can be performed on trees.

A tree is a data structure which stores information in a logical way that typically is ideally suited for searching quickly, often by ordering the nodes or items of the tree, also ideally, nodes should be able to be added to or removed from a tree quickly and efficiently. Often, trees are chosen as a means of simply structuring data in a meaningful way with no concerns as to their performance.

When trees are chosen as an alternative to a list, the reason for this is to gain the benefits of rapid insertion, searching and deletion of nodes. Common tree structures for this purpose are the binary tree and the black and red tree. A binary tree has an extremely simple and extremely fast method of searching for data, but it is highly dependent on nodes being added in an order which is somewhat random. If ordered data is added to a tree, the depth of the tree will be linear, thereby providing no benefits over a linked list in addition, removal of nodes can cause a binary tree to have to be rebuilt as all the nodes beneath the deleted node will have to be re-added to the tree, typically under different nodes, commonly causing linear branches of the tree and slowing down application performance.

R&B trees were designed to address many of the issues of a binary tree. By developing a data structure which intentionally keeps the depth of the tree shallow, high speed searching and node removal can be achieved, but at a cost to the insertion algorithm which is designed to "shake things up" a little. R&B trees are far beyond the scope of this answer.

General trees are used less as a means of providing ideal performance but instead are intended as a means of providing structure for data. General trees store information in a way which reflects the data format itself. An example of a general tree is the file system of a disk drive. The root directory contains zero or more children which each contain zero or more children which each contain zero or

more... you get the point. This structure is also used for things like the abstract syntax tree of a compiler. Source code is parsed into "tokens" which are the structured as nodes of a tree which are then "walked" when optimizing and producing binary code.

There are many more types of trees. Many of which ate covered by Donald Knuth in extensive, if not insane detail in "The Art of Computer Programming".

Among the operations you'd perform on the tree are insertion, deletion, searching, walking, reduction, simplification and more.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the difference between binary tree and tree data structure?

binary tree is a specific tree data structure where each node can have at most 2 children nodes. In a general Tree data structure nodes can have infinite children nodes.


Difference types of nonlinear data structure?

Tree, Graphs are the types of nonlinear data structure.


What do you call a tree without node in data structure?

A null tree.


What is the time complexity of operations in a B-tree data structure?

The time complexity of operations in a B-tree data structure is O(log n), where n is the number of elements in the tree.


What is the best data structure for notepad?

i think it will be tree...


What is the height of a specific node in a tree data structure?

The height of a specific node in a tree data structure is the number of edges on the longest path from that node to a leaf node.


Define tree in data structure?

Tree is directed, cycle-less, connected graph.


What is non linear data strcuture?

A tree is an example for a non-linear data structure.


Which data structure represent many to many relationship?

tree


Is a heap a type of tree structure?

No, a heap is not a type of tree structure. A heap is a specialized tree-based data structure commonly used in computer science for efficient priority queue operations.


What is the difference between primitive and non primitive data structure?

A primitive data structure is generally a basic structure that is usually built into the language, such as an integer, an array or a linked-list.A non-primitive data structure is built out of primitive data structures linked together in meaningful ways, such as a binary search tree, AVL Tree, Hashtable, etc.


What data structure is used to represent graphs in c language?

A tree.