answersLogoWhite

0

What is parent node?

Updated: 11/1/2022
User Avatar

Wiki User

8y ago

Best Answer

In programming, a parent node is any node that holds some reference to a child node. The child node may itself be a parent node.

A classic example of parent/child node usage is the binary tree, where every node in the tree may hold a reference to up to 2 children. Nodes that have no children are known as leaf nodes.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is parent node?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

What is the relationship between parent and child node?

that depends on what node means?


Steps of algorithum for delete node in linklist?

To delete a node (this) in a linked list, first you need to find the address of the parent node (parent).Iterate through the list, checking to find if the head pointer (head) or a child node (parent) points to (this).Store the next pointer of (this) in (parent) or (head), as determined by step 2.Delete (this).


In binary tree what is the name given to node that share the same parent node?

Sibling.


General tree to binary tree conversion?

The process of converting the general tree to a binary tree is as follows: * use the root of the general tree as the root of the binary tree * determine the first child of the root. This is the leftmost node in the general tree at the next level * insert this node. The child reference of the parent node refers to this node * continue finding the first child of each parent node and insert it below the parent node with the child reference of the parent to this node. * when no more first children exist in the path just used, move back to the parent of the last node entered and repeat the above process. In other words, determine the first sibling of the last node entered. * complete the tree for all nodes. In order to locate where the node fits you must search for the first child at that level and then follow the sibling references to a nil where the next sibling can be inserted. The children of any sibling node can be inserted by locating the parent and then inserting the first child. Then the above process is repeated.


When we insert a new node in a binary search tree will it become an internal node or terminal node?

It will be come a terminal node. Normally we call terminal nodes leaf nodes because a leaf has no branches other than its parent.


In binary tree what is the name given to nodes that share the same parent node?

Sibling.


How binary tree is represented as doubly link list?

In this representation, each node contains two pointers, one pointing to its parent (null in the case of root node) and the other pointing to its child node (null in the case of leaf nodes).


Progarm to delete previous node in linked list?

struct LinkedListNode { void* data; LinkedListNode* next; }; LinkedListNode* head; LinkedListNode* tmp; while (head) { tmp head->next; free(head); head tmp; }


Why is there only a need for one parent to give consent for underage dating?

http://www.sexlaws.org/node/1353/print


explain the process of converting tree to binary tree with example?

A binary tree is a type of tree data structure in which each node has at most two children. To convert a tree to a binary tree, we can follow these steps: Choose a root node for the binary tree. This will be the node at the top of the tree, and all other nodes will be connected to it. For each child node of the root node, add it as a left or right child of the root node, depending on its position relative to the root node. For each child node of the root node, repeat step 2 for its child nodes, adding them as left or right children of the appropriate parent node.


If a CBT is stored using array , then what is the parent node of element stored at index 11?

In a complete binary tree (CBT) stored using an array, the parent of an element at index i can be found at index (i-1)/2, assuming the array is 0-indexed. So for an element stored at index 11, the parent node would be stored at index (11-1)/2 = 5.


What is the difference between tree search and graph search?

A graph is a set of vertices which are connected to each other via a set of edges. A tree is a special type of hierarchical graph in which each node may have exactly one "parent" node and any number of "child" nodes, where a parent node is one level closer to the root and a child node is one level further away from the root.