/AlgorithmFinalAssignment

Final Assignment for CSD 302 : Design and Analysis of Algorithms

Primary LanguageC++

Final Assignment for CSD 302

Design and Analysis of Algorithms
  • Design a Data Structure where each operation takes log(n) time, where n is the number of elements in the data structure.
  • Consider a graph with n (> 10) nodes, generate (n2/2) directed edges randomly and assign a weight in the range (1, 10) to each edge. Apply Dijkstra’s algorithm and find out the single source shortest path starting from a randomly selected node s.
  • Professor Adam has two children who, unfortunately, dislike each other. The problem is so severe that not only do they refuse to walk to school together, but in fact each one refuses to walk on any block that the other child has stepped on that day. The children have no problem with their paths crossing at a corner. Fortunately both the professor’s house and the school are on corners, but beyond that he is not sure if it is going to be possible to send both of his children to the same school. The professor as a map of his town. Show how to formulate the problem of determining whether both his children can go to the same school as a maximum-flow problem.
  • Write a program for 8-Queenss problem.
  • Design a parallel algorithm for Bubblesort that you think would give you the best speedup possible. The arraysize is n and number of processors is p, such that n>>p.

NAME : RAHUL THAPAR
ID : 1410110321