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 ;}
}
Program will demonstrate deletion of an element from the linear array /* declaration of delete_list function */ voiddelete_list(list *, int); /* definition of delete_list
Q. Describe the representations of graph. Represent the graph which is given to us using any two methods Ans: The different ways by which we can represent graphs are:
What is complexity of an algorithm? What is the basic relation between the time and space complexities of an algorithm? Justify your answer by giving an example.
Program segment for All pairs shortest paths algorithm AllPairsShortestPaths(int N, Matrix C, Matrix P, Matrix D) { int i, j, k if i = j then C[i][j] = 0 for ( i =
advanatges of dynamic data structure in programming
7. String manipulation 7.a Write a C Program using following string manipulation functions a) strcpy b) strncpy c) strcmp d) strncmp e) strlen f) strcat
What is called the basic operation of an algorithm? The most significant operation of the algorithm is the operation contributing the most to the total running time is known as
Example 3: Travelling Salesman problem Given: n associated cities and distances among them Find: tour of minimum length that visits all of city. Solutions: How several
What are the Dynamic arrays Dynamic arrays are convenient for programmers since they can never be too small-whenever more space is needed in a dynamic array, it can simply be e
Q. What do you mean by the best case complexity of quick sort and outline why it is so. How would its worst case behaviour arise?
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