联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> CS作业CS作业

日期:2018-04-18 09:03

CSE310 Project02

The test cases are mentioned below:-

Test Case 1:

Content of input.txt:

2

6 6

6 5 10

5 4 4

4 6 5

1 2 1

3 2 3

3 1 3

Output in output.txt:

Set Structure:

0, 0, 0, 0, 0, 0

Heap Structure:

1, 3, 3, 10, 4, 5

Heap Structure:

3, 4, 3, 10, 5

Selecting edge (1, 2)

Set Structure:

2, -1, 0, 0, 0, 0

Heap Structure:

3, 4, 5, 10

Selecting edge (3, 2)

Set Structure:

2, -1, 2, 0, 0, 0

Heap Structure:

4, 10, 5

Heap Structure:

5, 10

Selecting edge (5, 4)

Set Structure:

2, -1, 2, -1, 4, 0

1

Heap Structure:

10

Selecting edge (4, 6)

Set Structure:

2, -1, 2, -1, 4, 4

Vertices in the cluster with vertex 2:

1, 2, 3

Vertices in the cluster with vertex 4:

4, 5, 6

Test Case 2:

Content of input.txt:

2

8 7

7 8 7

1 3 6

4 1 5

5 4 4

3 4 3

6 1 2

2 1 1

Output in output.txt:

Set Structure:

0, 0, 0, 0, 0, 0, 0, 0

Heap Structure:

1, 4, 2, 7, 5, 6, 3

Heap Structure:

2, 4, 3, 7, 5, 6

Selecting edge (2, 1)

Set Structure:

-1, 1, 0, 0, 0, 0, 0, 0

Heap Structure:

2

3, 4, 6, 7, 5

Selecting edge (6, 1)

Set Structure:

-1, 1, 0, 0, 0, 1, 0, 0

Heap Structure:

4, 5, 6, 7

Selecting edge (3, 4)

Set Structure:

-1, 1, 4, -1, 0, 1, 0, 0

Heap Structure:

5, 7, 6

Selecting edge (5, 4)

Set Structure:

-1, 1, 4, -1, 4, 1, 0, 0

Heap Structure:

6, 7

Selecting edge (4, 1)

Set Structure:

-2, 1, 4, 1, 4, 1, 0, 0

Heap Structure:

7

Heap Structure:

Selecting edge (7, 8)

Set Structure:

-2, 1, 1, 1, 4, 1, 8, -1

Vertices in the cluster with vertex 1: 1, 2, 3, 4, 5, 6

Vertices in the cluster with vertex 8: 7, 8

Test Case 3:

Content of input.txt:

5

5 0

3

Output in output.txt:

Set Structure:

0, 0, 0, 0, 0

Heap Structure:

Vertices in the cluster with vertex 1:

1

Vertices in the cluster with vertex 2:

2

Vertices in the cluster with vertex 3:

3

Vertices in the cluster with vertex 4:

4

Vertices in the cluster with vertex 5:

5

Test Case 4:

Content of input.txt:

1

4 5

1 2 1

2 3 2

3 4 4

4 1 3

2 3 1000

Output in output.txt:

Set Structure:

0, 0, 0, 0

Heap Structure:

1, 2, 4, 3, 1000

4

Heap Structure:

2, 3, 4, 1000

Selecting edge (1, 2)

Set Structure:

2, -1, 0, 0

Heap Structure:

3, 1000, 4

Selecting edge (2, 3)

Set Structure:

2, -1, 2, 0

Heap Structure:

4, 1000

Selecting edge (4, 1)

Set Structure:

2, -1, 2, 2

Vertices in the cluster with vertex 2:

1, 2, 3, 4

Test Case 5:

Content of input.txt:

1

6 6

6 5 10

5 4 4

4 6 5

1 2 1

3 2 3

3 1 2

Output in output.txt:

Set Structure:

0, 0, 0, 0, 0, 0

Heap Structure:

1, 3, 2, 10, 4, 5

5

Heap Structure:

2, 3, 5, 10, 4

Selecting edge (1, 2)

Set Structure:

2, -1, 0, 0, 0, 0

Heap Structure:

3, 4, 5, 10

Selecting edge (3, 1)

Set Structure:

2, -1, 2, 0, 0, 0

Heap Structure:

4, 10, 5

Heap Structure:

5, 10

Selecting edge (5, 4)

Set Structure:

2, -1, 2, -1, 4, 0

Heap Structure:

10

Selecting edge (4, 6)

Set Structure:

2, -1, 2, -1, 4, 4

Heap Structure:

Sorry!!! 1 components can not be created. The minimum number of components that can be created

is 2.

Vertices in the cluster with vertex 2:

1, 2, 3

Vertices in the cluster with vertex 4:

4, 5, 6

6


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp