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).
insertion and deletion in a tree
Explain what are circular queues? Write down routines required for inserting and deleting elements from a circular queue implemented using arrays. Circular queue:
Explain All-pair shortest-paths problem Given a weighted linked graph (undirected or directed), the all pairs shortest paths problem asks to find the distances (the lengths of
Difference between array and abstract data types Arrays aren't abstract data types since their arrangement in the physical memory of a computer is an essential feature of their
Draw trace table and determine the output from the below flowchart using following data (NOTE: input of the word "end" stops program and outputs results of survey): Vehicle = c
Q. Prove the hypothesis that "A tree having 'm' nodes has exactly (m-1) branches". Ans: A tree having m number of nodes has exactly (m-1) branches Proof: A root
1. Start 2. Get h 3. If h T=288.15+(h*-0.0065) 4. else if h T=216.65 5. else if h T=216.65+(h*0.001) 6. else if h T=228.65+(h*0.0028) 7. else if h T=270.65 8.
The minimum cost spanning tree has broad applications in distinct fields. It represents several complicated real world problems such as: 1. Minimum distance for travelling all o
Comparison of Gouraud and Phong Shading Phong shading requires more calculations, but produces better results for specular reflection than Gouraud shading in the form of more r
Write down any four applications of queues. Application of Queue (i) Queue is used in time sharing system in which programs with the similar priority form a queu
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