answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

What is the term given to to the point where two opposite electrical currents meet?

node Any number of currents can meet at a node, not just two.


Find the level of a node in binary tree?

level of a node in any binary tree can be calculated by summing up the number of nodes traversed from the root node of the tree to the node whose level has to be calculated!!!! dats it!! if count is the no. of elements passed, then floor(log2(count-1)) is the level


How to write a program to implement a binary search tree in C?

struct node{ int data; struct node *left, *right; }; typedef struct node node; non recursive method : main() { node * root = NULL , *new = NULL *temp1 =NULL , * temp2 = NULL; int num =1; printf(" Enter the elements of the tree( enter 0 to exit)\n"); while(1) { scanf("%d", &num); if(num==0) break; new = malloc(sizeof(node)); new->left = new->right = NULL; new->data = num; if( root NULL) root->left = new; else insert( new,root->left); } }


Write an iterative function to search an element in a binary search tree?

_node* search (_node* head, _key key) { _node* node; for (node=head; node != NULL;;) { if (key == node->key) return node; else if (key < node.>key) node = node->left; else node = node->right; } return node; }


Algoritm for deleting the last element from a list?

Given a list and a node to delete, use the following algorithm: // Are we deleting the head node? if (node == list.head) { // Yes -- assign its next node as the new head list.head = node.next } else // The node is not the head node { // Point to the head node prev = list.head // Traverse the list to locate the node that comes immediately before the one we want to delete while (prev.next != node) { prev = prev.next; } end while // Assign the node's next node to the previous node's next node prev.next = node.next; } end if // Before deleting the node, reset its next node node.next = null; // Now delete the node. delete node;

Related Questions

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.


What The number of different trees with 8 node?

248


Difference between in-degree and out-degree of a vertex in data structures?

In-degree is a count of the number of ties directed to the node, and out-degree is the number of ties that the node directs to others.


If the degree of a node is 0 then the tree is called?

This would be just a single node, since no edges (you can think of degree as the number of edges connected to a node). If you are talking about the in-degree, or out-degree of a node being zero, this can happen many times in a directed graph (in-degree = # edges going IN to node, out-degree = # edges going out...).


What is the term given to to the point where two opposite electrical currents meet?

node Any number of currents can meet at a node, not just two.


How to cite the Federal Register in academic writing?

To cite the Federal Register in academic writing, include the volume number, page number, and year of publication in the following format: Federal Register, vol. volume number, p. page number (year).


Find the level of a node in binary tree?

level of a node in any binary tree can be calculated by summing up the number of nodes traversed from the root node of the tree to the node whose level has to be calculated!!!! dats it!! if count is the no. of elements passed, then floor(log2(count-1)) is the level


What is nball register number?

24400573.


What is the cash value of a vintage cash register made from national cash register company in Dayton Ohio model number S729848746G?

What year cash register is model number S729848746G


How to write a program to implement a binary search tree in C?

struct node{ int data; struct node *left, *right; }; typedef struct node node; non recursive method : main() { node * root = NULL , *new = NULL *temp1 =NULL , * temp2 = NULL; int num =1; printf(" Enter the elements of the tree( enter 0 to exit)\n"); while(1) { scanf("%d", &num); if(num==0) break; new = malloc(sizeof(node)); new->left = new->right = NULL; new->data = num; if( root NULL) root->left = new; else insert( new,root->left); } }


Write an iterative function to search an element in a binary search tree?

_node* search (_node* head, _key key) { _node* node; for (node=head; node != NULL;;) { if (key == node->key) return node; else if (key < node.>key) node = node->left; else node = node->right; } return node; }


Who is number is this?

This is Bounty. They get your number when you register for their free baby packs.