Write a program that should accept a file as input

Assignment Help Data Structure & Algorithms
Reference no: EM131290607

Assignment

For this assignment, your program should accept a file as input. First line in the input file contains the label of the source node. Then each subsequent line has the edges of a directed graph. Nodes are labeled as integers from 1 to 500 (maximum 500 nodes). Each row indicates an edge, the node label in first column is the tail and the node label in second column is the head. For example, the 2nd row looks Mot "1 2". This means the node with label 1 has an outgoing edge to the node with label 2.

Your task is to write a code (using BFS or DFS) to compute the shortest path between a source note,to all other nodes. Your output should contain the label for each node, and the shortest distance to that node from the source. For example, first row in the sample output indicates that the shortest distance from source node to node 2 is 1. And the last line indicates that the shortest path from source node to node 6 is 4.

Reference no: EM131290607

Questions Cloud

Subcontractor to do the mowing : Jack owns a lawn mowing company. His company contracts to provide lawn mowing services to Rachel. Jack hires a subcontractor to do the mowing. Which of the below statements is correct?
How can we reduce poverty in the united states : How can we reduce poverty in the United States?Will receiving a college degree improve your career opportunities?
Explain the usefulness of motivation theories : Share examples of how these theories have been exemplified in your personal life. Finally, explain the usefulness of motivation theories in your work as an education professional.
Analyze and evaluate the website presentation of the issues : analyze one website and design a full-size poster presentation to analyze and evaluate the website presentation of the issues.
Write a program that should accept a file as input : For this assignment, your program should accept a file as input. First line in the input file contains the label of the source node. Then each subsequent line has the edges of a directed graph.
Business model generation : In reference the book "Business Model Generation" by Alexander Osterwalder & Yves Pigneur, how does "Brainstorming New Business Models" by answering the What if questions impact successful businesses?
Visit and experience your artifact : Develop an outline for a detailed description of the object and its setting. Help your reader visualize the object in detail. Avoid assumptions. This section requires close direct experience, not research. Include at least four observations.
Calculate the gross proceeds per share : Howett Pockett, Inc., plans to issue 10.4 million new shares of its stock. In discussions with its investment bank, Howett Pocket learns that the bankers recommend a net proceed of $34.60 per share and they will charge an underwriter's spread of 5..
Explain what nature is according to that philosopher : Nature and Western Philosophy : Meta­ physical aspects of the current crisis.Research any non­Western philosopher of your choosing (e.g. a Chinese, Japanese, Indian, African / African diaspora or indigenous philosopher)and explain what nature is ac..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd