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. Write down the binary search algorithm and trace to search element 91 in following given list: 13 30 62 73 81 88 91
Variable length codes (Niveau I) Code the following sequence of integers (2, 4, 2, 8, 3, 1, 4, 5, 13, 2) with • unary codes • ? codes • d codes • Rice codes (for a suitable l) and
Arrays are simple, however reliable to employ in more condition than you can count. Arrays are utilized in those problems while the number of items to be solved out is fixed. They
conversion of centrigral to frahenhit
Ask question find frequency count of function- {for(i=1;i {for(j=1;j {for(k=1;k } } }
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
Give the example of bubble sort algorithm For example List: - 7 4 5 3 1. 7 and 4 are compared 2. Since 4 3. The content of 7 is now stored in the variable which was h
Tree is dynamic data structures. Trees can expand & contract as the program executes and are implemented via pointers. A tree deallocates memory whereas an element is deleted.
Limitation of Binary Search: - (i) The complexity of Binary search is O (log2 n). The complexity is similar irrespective of the position of the element, even if it is not pres
What is Assertions Introduction At every point in a program, there are generally constraints on the computational state that should hold for program to be correct. For ins
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