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. Write down the algorithm which does depth first search through an un-weighted connected graph. In an un-weighted graph, would breadth first search or depth first search or neither find a shortest path tree from some of the node? Why?
Ans:
An algorithm that does depth first search is written below:
struct node
{
int data ;
struct node *next ;
} ; int visited[MAX] ;
void dfs ( int v, struct node **p )
struct node *q ;
visited[v - 1] = TRUE ;
printf ( "%d\t", v ) ; q = * ( p + v - 1 ) ; while ( q != NULL )
if ( visited[q -> data - 1] == FALSE )
dfs ( q -> data, p ) ;
else
q = q -> next ;}
}
Q. Explain quick sort? Sort the given array using quick sort method. 24 56 47 35 10 90 82 31
For preorder traversal, in the worst case, the stack will rise to size n/2, where n refer to number of nodes in the tree. Another method of traversing binary tree non-recursively t
Write a recursive function the computes the number of digits in a positive integer n. For example if n = 6598, the function should return 4. Find a variant expression and a thresho
We have discussed already about three tree traversal methods in the earlier section on general tree. The similar three different ways to do the traversal -inorder , preorder, and p
Write an algorithm, using a flowchart, which inputs the heights of all 500 students and outputs the height of the tallest person and the shortest p erson in the school.
Question: (a) Discuss the importance of game theory to decisions. (b) Explain the following: (i) saddle point, (ii) two-person zero-sum game. (c) Two leading ?rms, ABC Ltd a
Run time complexity of an algorithm is depend on
Sequential files are most frequently utilized in commercial batch oriented data processing where there is the concept of a master file on which details are inserted periodically. F
important points on asymptotic notation to remember
Ask question Write an algorithm for the evaluation of a postfix expression using a stack#Minimum 100 words accepted#
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