Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore MCA632n637-Design and Analysis of Algorithms n Lab

MCA632n637-Design and Analysis of Algorithms n Lab

Published by Teamlease Edtech Ltd (Amita Chitroda), 2021-04-15 17:12:34

Description: MCA632n637-Design and Analysis of Algorithms n Lab

Search

Read the Text Version

DAA Basics 293 PRACTICAL DAA BASICS UNIT 1 Structure: 1.0 Learning Objectives Practical 1.1 Determine whether a particular element is available in a list of elements entered by the user at runtime. Practical 1.2 Obtain the topological ordering of vertices in a given digraph. 1.3 References 1.0 Learning Objectives After studying this unit, you will be able to:  Develop programs for basic DAA concepts  Define algorithm specifications  Implement a one-dimentional array; take number from users to search for in the array using binary search.  Illustrate C program using recursion to search an element in array  Write a C program to implement linear search algorithm.  Obtain the topological ordering of vertices in a given digraph CU IDOL SELF LEARNING MATERIAL (SLM)

294 Design and Analysis of Algorithms (Theory and Practical) Practical 1.1: Determine whether a particular element is available in a list of elements entered by the user at runtime Problem Description This program will implement a one-dimentional array; take number from users to search for in the array using binary search. Problem Solution 1. Create an array of some certain size and define its elements in a sorted fashion. 2. Now take an input from the users which you want to search for. 3. Take two variables pointing to the first and last index of the array (namely low and high). 4. Run start a while and run it until low equals high. 5. Now, take a mid of low and high value, check whether value at mid equals the user input. 6. In case it matches the user input, it means we found the number, after which we must break out from the loop. 7. And if user input is greater than value at mid, then low is assigned the value of mid. Similarly, if user input is smaller than value at mid, then high is assigned the value of mid. 8. In this way, the region of finding the user input becomes half. Program/Source Code Here is a source code of the C program to read an array and search for an element. The program is successfully compiled and tested using Turbo C compiler in windows environment. The program output is also shown below. 1. 2. /* 3. * C program accept an array of N elements and a key to search. 4. * If the search is successful, it displays \"SUCCESSFUL SEARCH\". 5. * Otherwise, a message \"UNSUCCESSFUL SEARCH\" is displayed. 6. */ CU IDOL SELF LEARNING MATERIAL (SLM)

DAA Basics 295 7. 8. #include <stdio.h> 9. void main() 10. { 11. 12. int array[20]; 13. int i, low, mid, high, key, size; 14. 15. printf(\"Enter the size of an array\\n\"); 16. scanf(\"%d\", &size); 17. 18. printf(\"Enter the array elements\\n\"); 19. for (i = 0; i < size; i++) 20. { 21. scanf(\"%d\", &array[i]); 22. } 23. 24. printf(\"Enter the key\\n\"); 25. scanf(\"%d\", &key); 26. 27. /* search begins */ 28. 29. low = 0; 30. high = (size - 1); 31. 32. while (low <= high) 33. { 34. mid = (low + high) / 2; 35. 36. if (key == array[mid]) 37. { 38. printf(\"SUCCESSFUL SEARCH\\n\"); CU IDOL SELF LEARNING MATERIAL (SLM)

296 Design and Analysis of Algorithms (Theory and Practical) 39. return; 40. } 41. 42. if (key < array[mid]) 43. high = mid - 1; 44. 45. else 46. low = mid + 1; 47. 48. } 49. 50. printf(\"UNSUCCESSFUL SEARCH\\n\"); 51. 52. } Program Explanation 1. Declare an array of capacity 20, taking size from users, define all the elements of the array but in sorted fashion. 2. Now, take three variables, low pointing to the first index of array, i.e., 0, last index of array, i.e., size-1, and mid. 3. Run a loop till the low become equal to high. 4. Inside this loop, first calculate mid using (high + low) / 2 = mid. 5. Check if the value at mid matches the user input, if it does, that means we found the element and now we can return by breaking out from the loop. 6. If user input is greater than value at mid, then low is shifted to mid; similarly, if user input is smaller than mid, then high is shifted to mid. 7. In this way, each time, we halved the region where we are finding the element. CU IDOL SELF LEARNING MATERIAL (SLM)

DAA Basics 297 Runtime Test Cases Enter the size of an array 4 Enter the array elements 90 560 300 390 Enter the key 90 SUCCESSFUL SEARCH $ a.out Enter the size of an array 4 Enter the array elements 100 500 580 470 Enter the key 300 UNSUCCESSFUL SEARCH Practical 1.2: Obtain the Topological Ordering of Vertices in a Given Digraph Problem Description Topological sort is an ordering of the vertices in a directed acyclic graph, such that, if there is a path from u to v, then v appears after u in the ordering. The graphs should be directed, otherwise for any edge (u,v) there would be a path from u to v, and also from v to u, and hence they cannot be ordered. The graphs should be acyclic, otherwise for any two vertices u and v on a cycle u would precede v and v would precede u. CU IDOL SELF LEARNING MATERIAL (SLM)

298 Design and Analysis of Algorithms (Theory and Practical) Problem Solution Using Source Removal Algorithm: 1. Compute the indegrees of all vertices. 2. Find a vertex U with indegree 0 and print it (store it in the ordering). 3. If there is no such vertex, then there is a cycle and the vertices cannot be ordered. Stop. 4. Remove U and all its edges (U,V) from the graph. 5. Update the indegrees of the remaining vertices. 6. Repeat steps 2 through 4 while there are vertices to be processed. Solution: #include<stdio.h> int temp[10],k=0; void topo(int n,int indegree[10],int a[10][10]) { int i,j; for(i=1;i<=n;i++) { if(indegree[i]==0) { indegree[i]=1; temp[++k]=i; for(j=1;j<=n;j++) { if(a[i][j]==1&&indegree[j]!=-1) indegree[j]--; } i=0; } } CU IDOL SELF LEARNING MATERIAL (SLM)

DAA Basics 299 } void main() { int i,j,n,indegree[10],a[10][10]; printf(\"enter the number of vertices:\"); scanf(\"%d\",&n); for(i=1;i<=n;i++) indegree[i]=0; printf(\"\\n enter the adjacency matrix\\n\"); for(i=1;i<=n;i++) for(j=1;j<=n;j++) { scanf(\"%d\",&a[i][j]); if(a[i][j]==1) indegree[j]++; } topo(n,indegree,a); if(k!=n) printf(\"topological ordering is not possible\\n\"); else { printf(\"\\n topological ordering is :\\n\"); for(i=1;i<=k;i++) printf(\"v%d\\t\",temp[i]); } } CU IDOL SELF LEARNING MATERIAL (SLM)

300 Design and Analysis of Algorithms (Theory and Practical) Using DFS Algorithm: 1. Run DFS(G), computing finish time for each vertex. 2. As each vertex is finished, insert it onto the front of a list. Solution: #include<stdio.h> int i,visit[20],n,adj[20][20],s,topo_order[10]; void dfs(int v) { int w; visit[v]=1; for(w=1;w<=n;w++) if((adj[v][w]==1) && (visit[w]==0)) dfs(w); topo_order[i--]=v; } void main() { int v,w; printf(\"Enter the number of vertices:\\n\"); scanf(\"%d\",&n); printf(\"Enter the adjacency matrix:\\n\"); for(v=1;v<=n;v++) for(w=1;w<=n;w++) scanf(\"%d\",&adj[v][w]); for(v=1;v<=n;v++) visit[v]=0; i=n; for(v=1;v<=n;v++) { if(visit[v]==0) CU IDOL SELF LEARNING MATERIAL (SLM)

DAA Basics 301 dfs(v); } printf(\"\\nTopological sorting is:\"); for(v=1;v<=n;v++) printf(\"v%d \",topo_order[v]); } OUTPUT 1: Enter the number of vertices: 5 Enter the adjacency matrix 00100 00100 00011 00001 00000 Topological ordering is v1 v2 v3 v4 v5 OTUPUT 2: Enter the number of vertices: 3 Enter the adjacency matrix 010 001 100 Topological ordering is not possible. 1.3 References References of this unit have been given at the end of the book. CU IDOL SELF LEARNING MATERIAL (SLM)

302 Design and Analysis of Algorithms (Theory and Practical) PRACTICAL DIVIDE AND CONQUER AND UNIT 2 GREEDY METHOD Structure: 2.0 Learning Objectives Practical 2.1 Sort a given set of elements using the Quick Sort method and determine the time required to sort the elements. Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of the time taken versus n. The elements can be read from a file or can be generated using the random number generator. Practical 2.2 Using OpenMP, implement a parallelised Merge Sort algorithm to sort a given set of elements and determine the time required to sort the elements. Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of the time taken versus n. The elements can be read from a file or can be generated using the random number generator. Practical 2.3 Find Minimum Cost Spanning Tree of a given undirected graph using Prim’s Algorithm 2.4 References 2.0 Learning Objectives After studying this unit, you will be able to:  Develop programs using divide and conquer techniques  Create programs using greedy methods CU IDOL SELF LEARNING MATERIAL (SLM)

Divide and Conquer and Greedy Method 303  Develop programs for quick sort method and determine the time required to sort the elements  Define algorithm specifications  Implement merge sort algorithm to sort a given set of elements and determine the time required to sort the elements.  Find minimum cost spanning tree of a given undirected graph using Prim’s algorithm. Practical 2.1: Sort a given set of elements using the Quick Sort method and determine the time required to sort the elements. Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of the time taken versus n. The elements can be read from a file or can be generated using the random number generator. Solution: # include <stdio.h> # include <conio.h> # include <time.h> voidExch(int *p, int *q) { int temp = *p; *p = *q; *q = temp; } voidQuickSort(int a[], int low, int high) { int i, j, key, k; if(low>=high) return; key=low; i=low+1; j=high; while(i<=j) CU IDOL SELF LEARNING MATERIAL (SLM)

304 Design and Analysis of Algorithms (Theory and Practical) { while ( a[i] <= a[key] ) i=i+1; while ( a[j] > a[key] ) j=j-1; if(i<j) Exch(&a[i], &a[j]); } Exch(&a[j], &a[key]); QuickSort(a, low, j-1); QuickSort(a, j+1, high); } void main() { int n, a[1000],k clock_tst,et; doublets; clrscr(); printf(\"\\n Enter How many Numbers: \"); scanf(\"%d\", &n); printf(\"\\nThe Random Numbers are:\\n\"); for(k=1; k<=n; k++) { a[k]=rand(); printf(\"%d\\t\",a[k]); } st=clock(); QuickSort(a, 1, n); et=clock(); ts=(double)(et-st)/CLOCKS_PER_SEC; printf(\"\\nSorted Numbers are: \\n \"); for(k=1; k<=n; k++) printf(\"%d\\t\", a[k]); printf(\"\\nThe time taken is %e\",ts); getch(); } CU IDOL SELF LEARNING MATERIAL (SLM)

Divide and Conquer and Greedy Method 305 Output: Practical 2.2: Using OpenMP, implement a parallelised Merge Sort algorithm to sort a given set of elements and determine the time required to sort the elements. Repeat the experiment for different values of n, the number of elements in the list to be sorted and plot a graph of the time taken versus n. The elements can be read from a file or can be generated using the random number generator. Solution: # include <stdio.h> # include <conio.h> #include<time.h> void Merge(int a[], int low, int mid, int high) { int i, j, k, b[20]; i=low; j=mid+1; k=low; CU IDOL SELF LEARNING MATERIAL (SLM)

306 Design and Analysis of Algorithms (Theory and Practical) while ( i<=mid && j<=high ) { if( a[i] <= a[j] ) b[k++] = a[i++] ; else b[k++] = a[j++] ; } while (i<=mid) b[k++] = a[i++] ; while (j<=high) b[k++] = a[j++] ; for(k=low; k<=high; k++) a[k] = b[k]; } voidMergeSort(int a[], int low, int high) { int mid; if(low >= high) return; mid = (low+high)/2 ; MergeSort(a, low, mid); MergeSort(a, mid+1, high); Merge(a, low, mid, high); } void main() { int n, a[2000],k; clock_tst,et; doublets; clrscr(); printf(\"\\n Enter How many Numbers:\"); scanf(\"%d\", &n); printf(\"\\nThe Random Numbers are:\\n\"); for(k=1; k<=n; k++) { CU IDOL SELF LEARNING MATERIAL (SLM)

Divide and Conquer and Greedy Method 307 a[k]=rand(); printf(\"%d\\t\", a[k]); } st=clock(); MergeSort(a, 1, n); et=clock(); ts=(double)(et-st)/CLOCKS_PER_SEC; printf(\"\\n Sorted Numbers are : \\n \"); for(k=1; k<=n; k++) printf(\"%d\\t\", a[k]); printf(\"\\nThe time taken is %e\",ts); getch(); } Output: Practical 2.3: Find Minimum Cost Spanning Tree of a given undirected graph using Prim’s Algorithm Solution: #include<stdio.h> #include<conio.h> inta,b,u,v,n,i,j,ne=1; int visited[10]={0},min,mincost=0,cost[10][10]; void main() { clrscr(); CU IDOL SELF LEARNING MATERIAL (SLM)

308 Design and Analysis of Algorithms (Theory and Practical) printf(\"\\n Enter the number of nodes:\"); scanf(\"%d\",&n); printf(\"\\n Enter the adjacency matrix:\\n\"); for(i=1;i<=n;i++) for(j=1;j<=n;j++) { scanf(\"%d\",&cost[i][j]); if(cost[i][j]==0) cost[i][j]=999; } visited[1]=1; printf(\"\\n\"); while(ne<n) { for(i=1,min=999;i<=n;i++) for(j=1;j<=n;j++) if(cost[i][j]<min) if(visited[i]!=0) { min=cost[i][j]; a=u=i; b=v=j; } if(visited[u]==0 || visited[v]==0) { printf(\"\\n Edge %d:(%d %d) cost:%d\",ne++,a,b,min); mincost+=min; visited[b]=1; } cost[a][b]=cost[b][a]=999; } printf(\"\\n Minimun cost=%d\",mincost); getch(); } CU IDOL SELF LEARNING MATERIAL (SLM)

Divide and Conquer and Greedy Method 309 Output: 2.4 References References of this unit have been given at the end of the book. CU IDOL SELF LEARNING MATERIAL (SLM)

310 Design and Analysis of Algorithms (Theory and Practical) PRACTICAL DYNAMIC PROGRAMMING AND UNIT 3 BACKTRACKING Structure: 3.0 Learning Objectives Practical 3.1 Compute the transitive closure of a given directed graph using Warshall’s Algorithm Practical 3.2 Implement 0/1 Knapsack Problem using Dynamic Programming Practical 3.3 From a given vertex in a weighted connected graph, find shortest paths to other vertices using Dijkstra’s Algorithm Practical 3.4 Find Minimum Cost Spanning Tree of a given undirected graph using Kruskal’s Algorithm Practical 3.5 (a) Print all the nodes reachable from a given starting node in a digraph using BFS method Practical 3.5 (b) Check whether a given graph is connected or not using DFS method 3.6 References 3.0 Learning Objectives After studying this unit, you will be able to:  Develop programs using dynamic programming techniques  Create programs using backtracking techniques  Compute the transitive closure of a given directed graph using Warshall’s algorithm  Define algorithm specifications CU IDOL SELF LEARNING MATERIAL (SLM)

Dynamic Programming and Backtracking 311  Implement 0/1 Knapsack problem using dynamic programming.  Find, from a given vertex in a weighted connected graph, shortest paths to other vertices using algorithm  Find minimum cost spanning tree of a given undirected graph using Kruskal’s algorithm Practical 3.1: Compute the transitive closure of a given directed graph using Warshall’s Algorithm Solution: # include <stdio.h> # include <conio.h> intn,a[10][10],p[10][10]; void path() { inti,j,k; for(i=0;i<n;i++) for(j=0;j<n;j++) p[i][j]=a[i][j]; for(k=0;k<n;k++) for(i=0;i<n;i++) for(j=0;j<n;j++) if(p[i][k]==1&&p[k][j]==1) p[i][j]=1; } void main() { inti,j; clrscr(); printf(\"Enter the number of nodes:\"); CU IDOL SELF LEARNING MATERIAL (SLM)

312 Design and Analysis of Algorithms (Theory and Practical) scanf(\"%d\",&n); printf(\"\\nEnter the adjacency matrix:\\n\"); for(i=0;i<n;i++) for(j=0;j<n;j++) scanf(\"%d\",&a[i][j]); path(); printf(\"\\nThe path matrix is showm below\\n\"); for(i=0;i<n;i++) { for(j=0;j<n;j++) printf(\"%d \",p[i][j]); printf(\"\\n\"); } getch(); } Output: CU IDOL SELF LEARNING MATERIAL (SLM)

Dynamic Programming and Backtracking 313 Practical 3.2: Implement 0/1 Knapsack Problem using Dynamic Programming Solution: #include<stdio.h> #include<conio.h> int w[10],p[10],v[10][10],n,i,j,cap,x[10]={0}; int max(int i,int j) { return ((i>j)?i:j); } int knap(int i,int j) { int value; if(v[i][j]<0) { if(j<w[i]) value=knap(i-1,j); else value=max(knap(i-1,j),p[i]+knap(i-1,j-w[i])); v[i][j]=value; } return(v[i][j]); } void main() { intprofit,count=0; clrscr(); printf(\"\\nEnter the number of elements\\n\"); scanf(\"%d\",&n); printf(\"Enter the profit and weights of the elements\\n\"); for(i=1;i<=n;i++) { CU IDOL SELF LEARNING MATERIAL (SLM)

314 Design and Analysis of Algorithms (Theory and Practical) printf(\"For item no %d\\n\",i); scanf(\"%d%d\",&p[i],&w[i]); } printf(\"\\nEnter the capacity \\n\"); scanf(\"%d\",&cap); for(i=0;i<=n;i++) for(j=0;j<=cap;j++) if((i==0)||(j==0)) v[i][j]=0; else v[i][j]=-1; profit=knap(n,cap); i=n; j=cap; while(j!=0&&i!=0) { if(v[i][j]!=v[i-1][j]) { x[i]=1; j=j-w[i]; i--; } else i--; } printf(\"Items included are\\n\"); printf(\"Sl.no\\tweight\\tprofit\\n\"); for(i=1;i<=n;i++) if(x[i]) printf(\"%d\\t%d\\t%d\\n\",++count,w[i],p[i]); printf(\"Total profit = %d\\n\",profit); getch(); } CU IDOL SELF LEARNING MATERIAL (SLM)

Dynamic Programming and Backtracking 315 Output: Practical 3.3: From a given vertex in a weighted connected graph, find shortest paths to other vertices using Dijkstra’s Algorithm Solution: #include<stdio.h> #include<conio.h> #define infinity 999 voiddij(int n,intv,int cost[10][10],int dist[100]) { inti,u,count,w,flag[10],min; for(i=1;i<=n;i++) flag[i]=0,dist[i]=cost[v][i]; count=2; while(count<=n) { min=99; for(w=1;w<=n;w++) if(dist[w]<min && !flag[w]) CU IDOL SELF LEARNING MATERIAL (SLM)

316 Design and Analysis of Algorithms (Theory and Practical) min=dist[w],u=w; flag[u]=1; count++; for(w=1;w<=n;w++) if((dist[u]+cost[u][w]<dist[w]) && !flag[w]) dist[w]=dist[u]+cost[u][w]; } } void main() { intn,v,i,j,cost[10][10],dist[10]; clrscr(); printf(\"\\n Enter the number of nodes:\"); scanf(\"%d\",&n); printf(\"\\n Enter the cost matrix:\\n\"); for(i=1;i<=n;i++) for(j=1;j<=n;j++) { scanf(\"%d\",&cost[i][j]); if(cost[i][j]==0) cost[i][j]=infinity; } printf(\"\\n Enter the source matrix:\"); scanf(\"%d\",&v); dij(n,v,cost,dist); printf(\"\\n Shortest path:\\n\"); for(i=1;i<=n;i++) if(i!=v) printf(\"%d->%d,cost=%d\\n\",v,i,dist[i]); getch(); } CU IDOL SELF LEARNING MATERIAL (SLM)

Dynamic Programming and Backtracking 317 Output: Practical 3.4: Find Minimum Cost Spanning Tree of a given undirected graph using Kruskal’s Algorithm Solution: #include<stdio.h> #include<conio.h> #include<stdlib.h> inti,j,k,a,b,u,v,n,ne=1; intmin,mincost=0,cost[9][9],parent[9]; int find(int); int uni(int,int); void main() { clrscr(); printf(\"\\n\\n\\tImplementation of Kruskal's algorithm\\n\\n\"); printf(\"\\nEnter the no. of vertices\\n\"); scanf(\"%d\",&n); printf(\"\\nEnter the cost adjacency matrix\\n\"); for(i=1;i<=n;i++) { CU IDOL SELF LEARNING MATERIAL (SLM)

318 Design and Analysis of Algorithms (Theory and Practical) for(j=1;j<=n;j++) { scanf(\"%d\",&cost[i][j]); if(cost[i][j]==0) cost[i][j]=999; } } printf(\"\\nThe edges of Minimum Cost Spanning Tree are\\n\\n\"); while(ne<n) { for(i=1,min=999;i<=n;i++) { for(j=1;j<=n;j++) { if(cost[i][j]<min) { min=cost[i][j]; a=u=i; b=v=j; } } } u=find(u); v=find(v); if(uni(u,v)) { printf(\"\\n%d edge (%d,%d) =%d\\n\",ne++,a,b,min); mincost +=min; } cost[a][b]=cost[b][a]=999; } printf(\"\\n\\tMinimum cost = %d\\n\",mincost); getch(); CU IDOL SELF LEARNING MATERIAL (SLM)

Dynamic Programming and Backtracking 319 } int find(int i) { while(parent[i]) i=parent[i]; return i; } int uni(int i,int j) { if(i!=j) { parent[j]=i; return 1; } return 0; } Output: CU IDOL SELF LEARNING MATERIAL (SLM)

320 Design and Analysis of Algorithms (Theory and Practical) Practical 3.5(a): Print all the nodes reachable from a given starting node in a digraph using BFS method Solution: #include<stdio.h> #include<conio.h> int a[20][20],q[20],visited[20],n,i,j,f=0,r=-1; voidbfs(int v) { for(i=1;i<=n;i++) if(a[v][i] && !visited[i]) q[++r]=i; if(f<=r) { visited[q[f]]=1; bfs(q[f++]); } } void main() { int v; clrscr(); printf(\"\\n Enter the number of vertices:\"); scanf(\"%d\",&n); for(i=1;i<=n;i++) { q[i]=0; visited[i]=0; } printf(\"\\n Enter graph data in matrix form:\\n\"); for(i=1;i<=n;i++) for(j=1;j<=n;j++) scanf(\"%d\",&a[i][j]); CU IDOL SELF LEARNING MATERIAL (SLM)

Dynamic Programming and Backtracking 321 printf(\"\\n Enter the starting vertex:\"); scanf(\"%d\",&v); bfs(v); printf(\"\\n The node which are reachable are:\\n\"); for(i=1;i<=n;i++) if(visited[i]) printf(\"%d\\t\",i); getch(); } Output: Practical 3.5(b): Check whether a given graph is connected or not using DFS method Solution: #include<stdio.h> #include<conio.h> int a[20][20],reach[20],n; voiddfs(int v) { int i; reach[v]=1; CU IDOL SELF LEARNING MATERIAL (SLM)

322 Design and Analysis of Algorithms (Theory and Practical) for(i=1;i<=n;i++) if(a[v][i] && !reach[i]) { printf(\"\\n %d->%d\",v,i); dfs(i); } } void main() { inti,j,count=0; clrscr(); printf(\"\\n Enter number of vertices:\"); scanf(\"%d\",&n); for(i=1;i<=n;i++) { reach[i]=0; for(j=1;j<=n;j++) a[i][j]=0; } printf(\"\\n Enter the adjacency matrix:\\n\"); for(i=1;i<=n;i++) for(j=1;j<=n;j++) scanf(\"%d\",&a[i][j]); dfs(1); printf(\"\\n\"); for(i=1;i<=n;i++) { if(reach[i]) count++; } if(count==n) printf(\"\\n Graph is connected\"); else CU IDOL SELF LEARNING MATERIAL (SLM)

Dynamic Programming and Backtracking 323 printf(\"\\n Graph is not connected\"); getch(); } Output: 3.6 References References of this unit have been given at the end of the book. CU IDOL SELF LEARNING MATERIAL (SLM)

324 Design and Analysis of Algorithms (Theory and Practical) REFERENCES 1. ‘Introduction to the Design and Analysis of Algorithms’, Anany Levitin: 2nd Edition, 2009. Pearson. 2. ‘Computer Algorithms/C++’, Ellis Horowitz, Satraj Sahni and Rajasekaran, 2nd Edition, 2014, Universities Press. 3. ‘Introduction to Algorithms’, Thomas H. Cormen, Charles E. Leiserson, Ronal L. Rivest, Clifford Stein, 3rd Edition, PHI. 4. ‘Design and Analysis of Algorithms’, S. Sridhar, Oxford (Higher Education). 5. ‘Design and Analysis of Computer Algorithms’ by AHO. 6. ‘Introduction to Algorithms (Eastern Economy Edition)” by Thomas H. Cormen and Charles E. Leiserson. 7. ‘Introduction to the Design and Analysis of Algorithms’ by Anany Levitin. 8. ‘Introduction to Design and Analysis of Algorithms’ (Anna University) by Anany Levitin. 9. ‘Design And Analysis of Algorithms’ by Shweta Bajaj Mundra. 10. C++ Programming Examples on Hard Graph Problems and Algorithms. CU IDOL SELF LEARNING MATERIAL (SLM)


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook