Home Work 1

Algorithm Lab (03-10-19)-cum-Home Work.
Ashulia: Section C
Due Date: 07-10-19
Total Points: 15
----------------------------------------------------
1. Compare Between Bubble Sort and Selection Sort with source code.

2. Write a program to pass three integer values from one array(A) to another(B) using tower of hanoi algorithm.

3. Topological Sort(Graph Theory):
------------------------------------------
John has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task is
only possible if other tasks have already been executed.
Input:
The input will consist of several instances of the problem. Each instance begins with a line containing
two integers, 1 ≤ n ≤ 100 and m. n is the number of tasks (numbered from 1 to n) and m is the number of
direct precedence relations between tasks. After this, there will be m lines with two integers i and j,
representing the fact that task i must be executed before task j.
An instance with n = m = 0 will finish the input.
Output :
For each instance, print a line with n integers representing the tasks in a possible order of execution.
Sample Input
----------------
5 4
1 2
2 3
1 3
1 5
0 0
Sample Output
1 4 2 5 3

8 comments:

  1. Name:Alex Purification
    ID:201830012

    Drive Link:
    https://drive.google.com/drive/folders/1689nfQoqJho0GA1N7f3db8iECSYzgtHa

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Name: Roy D Gregori Ayon
    ID: 201830011
    https://drive.google.com/drive/folders/1wtSg0BLfy3yNY2ueHInwgPevkFvjMHR-

    ReplyDelete
  4. Name: Md. Rabiul Islam
    ID: 201810176
    H/W Link:
    https://drive.google.com/drive/folders/1RyuYglPeQpNuimhgKVU4-Nt5xSTp7LD2

    ReplyDelete
  5. ID:201730760
    Md.Johirul Islam

    problem no 1: http://ideone.com/W7FdQR
    problem no 2: http://ideone.com/W64qzI
    pronlem no 3: http://ideone.com/9Yze9K

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Name:Sanaullah Rabbi
    ID:201830123

    Comparison: https://drive.google.com/openid=1IFMvYNxEz5Kx2mXjnJDg1eSdPfjCyu57
    Topsort:
    https://drive.google.com/openid=1QBtNKcsmTjhvD3shbmGUp2jc5E8CbsGq
    hanoi:
    https://drive.google.com/openid=1PR3lm82PTDdv0v6BmzPnG99PehgvXbg5

    ReplyDelete
  8. Name: Shamima Akter
    ID: 201830112
    GDRIVE link: https://drive.google.com/open?id=1w2mmfW7qU_N2MPX24YOW_P69Jd8kXRUF

    ReplyDelete