JavaGian java tutorial and java interview question and answer

JavaGian , Free Online Tutorials, JavaGian provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.

Showing posts with label Tree. Show all posts
Showing posts with label Tree. Show all posts

Explain Tree?

10:52 PM
Tree A Tree is a recursive data structure containing the set of one or more data nodes where one node is designated as the root of the tree while the remaining nodes are called as the children of the root. The nodes other than the root node are partitioned into the non empty sets where each one of them is to be called sub-tree. Nodes of a tree either maintain a parent-child relationship between them or they are sister nodes. In a general tree, A node can have any number of children nodes but it can have only a single parent. The following image shows a tree, where the node A is the root node of the tree while the other nodes can be seen as the children of A.   Basic terminology Root Node  :- The root node is the topmost node in the tree hierarchy. In other words, the root node is the one which doesn't have any parent. Sub Tree  :- If the root node is not null, the tree T1, T2 and T3 is called sub-trees of the root node. Leaf Node  :- The node of tree, which doesn

.