Skip to content

Latest commit

 

History

History

hw07

HW07 - Longest Shortest Distance

Description

Given an undirected graph 𝐺 = (𝑉, 𝐸), find 𝒎𝒂𝒙_(𝒖,𝒗) 𝒅(𝒖, 𝒗), where 𝑑(𝑢,𝑣) denotes the length of the shortest path between node 𝑢 and node 𝑣, for all possible 𝑢, 𝑣. Your program will take a two-dimensional integer array as input. Each element in the array represents an undirected edge. Please return the length of the longest shortest path in the given graph.

Examples

Example 1:

Input: array = [[0, 1], [0, 2], [0, 4], [1, 3], [1, 4], [2, 5], [6, 7]]
Output: 4

File Structure

./
├─ LSD.java                         # Abstract Class
├─ HW07.java                        # Runner
├─ HW07_4111056036_1.java           # Version 1
├─ HW07_4111056036_2.java           # Version 2
├─ HW07_4111056036_3.java           # Version 3
├─ HW07_4111056036_4.java           # Version 4
├─ HW07_4111056036_5.java           # Version 5
├─ StopWatch.java                   # Class for Calculate Runtime
├─ randomData.java                  # Class for Generate Test Cases
├─ build.sh                         # Compile Script
├─ data.txt                         # Test Case
└─ README.md

Score

Best Version

Rank Version Status Time
2/106 HW07_4111056036_4 Correct 0.007355

Note: The rank is compared to the best submissions from all participants.

All Versions

Rank Version Status Time
4/313 HW07_4111056036_4 Correct 0.007355
7/313 HW07_4111056036_3 Correct 0.007515
9/313 HW07_4111056036_1 Correct 0.007583
14/313 HW07_4111056036_2 Correct 0.00774
129/313 HW07_4111056036_5 Correct 0.485005

Note: The ranks are compared to all submissions from all participants.