Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Let a binary tree 'T' be in memory. Write a procedure to delete all terminal nodes of the tree.
Ans.
function to Delete Terminal Nodes from Binary Tree
void deleteleaves(struct node* root,struct node* prev)
{
if(root)
if(root->left==NULL&&root->right==NULL)
if(prev->item>=root->item)
prev->left=NULL;
else
prev->right=NULL;
printf("\n\n %d Is Being Deleted ...",root->item);
free(root);
return;
}
deleteleaves(root->left,root);
deleteleaves(root->right,root);
the call to this function will deleteleaves (root, root).
Conceptually, the stack abstract data type mimics the information kept into a pile on a desk. Informally, first we consider a material on a desk, where we might keep separate stack
A telephone directory having n = 10 records and Name field as key. Let us assume that the names are stored in array 'm' i.e. m(0) to m(9) and the search has to be made for name "X"
implement multiple stacks in an array and write different algorithms to perform operations on it
In a sorted list, Binary search is carried out by dividing the list into two parts depends on the comparison of the key. Since the search interval halves each time, the iteration o
Q. Write down an algorithm to insert a node in the beginning of the linked list. Ans: /* structure containing a link part and link part
WRITE AN ALGORITHM TO READ TWO NUMBERS AND PRINT THE LOWER VALUE
A connected graph is a graph wherein path exists among every pair of vertices. A strongly connected graph is a directed graph wherein every pair of distinct vertices is connecte
Q. Describe the adjacency matrix and make the same for the given undirected graph. Ans: The representation of Adjacency Matrix: This representation consists of
Define Merge Sort Merge sort is a perfect example of a successful application of the divide and conquer method. It sorts a given array A[0...n-l] by separating it into two ha
QUESTION (a) Construct a binary tree for the following numbers assuming that a number greater than the node (starting from the root) goes to the left else it goes to the right.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd