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. The two Binary Trees are said to be similar if they are both empty or if they are both non- empty and left and right sub trees are similar. Write down an algorithm to determine if two Binary Trees are similar.
Ans: We assume that the two trees are tree1 and tree2. an algorithm to determine if two Binary trees are similar or not is as follows: similar(*tree1,*tree2) { while((tree1!=null) && (tree2!=null)) { if((tree1->root) == (tree2->root)) similar(tree1->left,tree2->left); similar(tree1->right,tree2->right); elseif(tree->root!= tree2->node){printf("Trees are not equal"); return;} } }
Ans:
We assume that the two trees are tree1 and tree2. an algorithm to determine if two Binary trees are similar or not is as follows:
similar(*tree1,*tree2)
{
while((tree1!=null) && (tree2!=null))
if((tree1->root) == (tree2->root)) similar(tree1->left,tree2->left); similar(tree1->right,tree2->right);
elseif(tree->root!= tree2->node){printf("Trees
are not equal");
return;}
}
Write a program to simulate searching over a hashed file, with different assumptions for the sizeof file pages.Write a program to perform equality search operations on the hashed f
Q. Describe the basic concept of binary search technique? Is it more efficient than the sequential search? Ans : The bin ary search technique:- This tec
The Ruby Programming Language Although data structures and algorithms we study aren't tied to any program or programming language, we need to write particular programs in speci
write a COBOL program to find the biggest of two numbers
give me algorithm of simple interest
implement multiple stacks in a single dimensional array. write algorithm for various stack operation for them
What is Solid modeling Solid modeling is the most powerful of the 3-D modeling technique. It provides the user with complete information about the model. Defining an object wit
What is quick sort? Answer Quick sort is one of the fastest sorting algorithm used for sorting a list. A pivot point is chosen. Remaining elements are divided or portio
If a node in a BST has two children, then its inorder predecessor has No right child
System defined data types:- These are data types that have been defined by the compiler of any program. The C language contains 4 basic data types:- Int, float, char and doubl
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