Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help in JAVA code to print the adjacency matrix below Here is the adjacency martix of the between the places (0 to 23) Do

Need help in JAVA code to print the adjacency matrix below

image text in transcribed

Here is the adjacency martix of the between the places (0 to 23)

image text in transcribedDo download the image above to view it better.

Here's an example output of how it should be printed out, it will be too large hence it will be cramped, but the output should be similar to this

image text in transcribed

Requirement 1 - Representation of the map in Figure 1 Represent the city-distance information shown in the map in Figure 1 with a weighted graph using adjacency matrix or link-list. Sembawang Woodlands 5 6 19 9 GO 5 Choa Chu Kang 5/ 14 15 22 Bukit 6 18 Mandal 3 Punggol Nee Soon 11/15 16 6 Sakit 16 Ang Mo Kio 8 6 16 Changi Ranjang 7 6 18 8 Serangoon 12 5 ypper 6 11 Thomson 16 Tampines Batak 15 Bukit 16 19/ 22 Simah 5 10 10 Noa Payoh 16 9 Bedok 5 Clement 8l VO Marina Bay Queenstown 6 16 Pasir 5 Panjang Outram 10 8 16 Fuas 257 59 19 Jurong 5 OD Soniusa Figure 1 21 2 Bukit Batok 18 3 Bukit Panjang 16 5 Clementi Bukit Timah Bedok 6 Changi Cho Chu Karig 8 Jurong 9 Mandai 12 Outram 11 Nee Soon 6 13 Pasir Panjang 10 Marina Bay . 16 14 Punggol 15 Queenstown 17 Sentosa 16 Sembawang 18 Serangoon 6 19 Tampines 20 Toa Payoh Tuas 22 23 Upper Thomson Woodlands 5 16 . = 16 = = = 5 13 7 22 5 6 7 19 Index 0 1 2 3 4 5 6 7 16 6 4 4 = 15 90 16 = = = 11 7. 5 7 6 5 se 22 19 25 10 9 5 14 11 = 5 7 16 5 18 - 4 = 22 = 6 19 11 15 19 25 22 . 15 2 3 = . 8 16 . 2 2 6 . 5 10 Index 0 To | From Ang Mo Kio Ang Mo Kio Bedok Bukit Batok 18 Bukit Panjang 16 Bukit Timah Clementi = Changi ChaChu Karig Jurong Mandai Marina Bay Nee Soon 6 6 Outram Pasir Panjang = Punggol Queenstown Sembawang Sentosa Serangoon 6 Tampines Toa Payoh Tuas = Upper Thomson 5 Woodlands = 16 = = 3 = = = -- . 9 16 2 8 8 5 6 = 6 8 7 = = = 8 = 9 9 5 19 5 6 = -- 10 9 9 = 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 10 6 5 . . 5 - = 6 8 10 e = . 8 8 12 = 16 5 18 = 6 15 19 = 5 13 = - 8 = 6 = 10 10 8 9 12 6 . 8 . = 15 16 15 19 = 16 11 10 6 14 11 11 8 9 5 = [1] DISPLAY CITY-DISTANCE INFORMATION MATRIX [2] SHORTEST DISTANCE BETWEEN TWO CITIES [3] ADJACENT CITY DISTANCE FROM A CITY [0] Quit Enter Choice --> 1 ADJACENCY MATRIX OF SINGAPORE ==== 3 4 8 1 12 23 2 13 5 16 6 17 7 18 9 20 14 15 19 11 22 2 18 16 0 6 6 5 1 0 22 1 1 - 16 5 13 2 18 7 5 6 7 19 16

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions