Test the program for the graph

Assignment Help Computer Engineering
Reference no: EM132212304

Write in the Racket programming language functions:

(a) Graph to define a graph. A graph is a list of (node list of nodes)

(b) neighbors neighbors(node, graph) = list of nodes neighbors: node graph -> list of nodes to compute node's neighbors in graph.

(c) find-route find-route(node, node, graph) = list of nodes or false find-route: node node graph -> list of nodes or false to compute a list of nodes, starting with the origination node and ending with the destination node in a graph. If there is no path, the value of function is false.

Test the program for the graph Example G has no neighbors: empty A has the list of neighbors (B E) Hint (define Graph etc. ) (define (neighbors a-node a-graph) etc. ) (define (find-route origination destination graph) etc. )

Test (define Graph '((A (B E)) (B (E F)) (C (D)) (D ()) (E (C F)) (F (D G)) (G ()))) (find-route 'A 'G Graph) -> (list 'A 'B 'E 'F 'G) (find-route 'C 'G Graph) -> #f

Reference no: EM132212304

Questions Cloud

Write 100 integers created randomly into the file : Write 100 integers created randomly into the file using text I/O. Integers are separated by spaces in the file.
Write a program that will work as a point of sale system : Write a python program that will Work as a point of sale system at a rodeo snack bar.
Write a quuery using the adventureworks database : Provide the winner's e-mail along with other specific information so that the CEO can send the notification of congratulations.
Write a python program the gets a string containing a name : Write a python program the gets a string containing a person's first, middle, and last names, and then display their first, middle, and last initials.
Test the program for the graph : List of nodes or false to compute a list of nodes, starting with the origination node and ending with the destination node in a graph.
Create two empty lists named ids and scores ids : Ask the user for an id number. As long as this is not 0, append the id to ids, then get a score (0.0 - 100.0) and append it to scores.
Write an rcpp function that returns the sum of all positive : Write an Rcpp function that returns the sum of all positive even integers less than or equal to n, which must be non-negative.
What is the weighted average effective interest rate : As of December 31, 2017, Johnson& Johnson has $32,174 million of debt, of which $30,675 million is due beyond one year. What is the weighted average effective.
How much income must a report in given year : Retiring partner A is to receive $120,000 for his partnership interest spread over a 4-year period and paid in installments of $30,000 per year.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe three most prominent risks and respective controls

A payroll department has a time sheet application where employees enter their hours worked. Describe the three most prominent risks and respective controls.

  Write down a 1400- to 1750-word paper explaining how to

write a 1400- to 1750-word paper describing how to formulate and present the business case for technology

  How to define a class named document

express a class named Document that contains an instance variable of type String named text that stores any textual content for the document. Create a method named toString that returns the text field and also include a method to set this value.

  Design and implement a class to model a battery

A battery object should know its voltage, how much energy it is capable of storing, and how much energy it is currently storing (in joules).

  Calculate the standard deviation of a sequence of n numbers

Write a well-structured C++ function to calculate the standard deviation of a sequence of n floating-point numbers, where n is a constant and the numbers are in

  Give a new yes-instance of problem partition

Can the multi-set S be partitioned into two multi-sets Sa and Sb such that the sum of the integers in Sa is exactly equal to the sum of the integers in Sb.

  Create a test file with long lines

The program reads characters until EOF from its standard input and displays that information on screen, with at most 50 characters per line.

  How could virustotal be useful to users

How could VirusTotal be useful to users? How could it useful to security researchers? Could it also be used by attackers to test their own malware.

  Which technique is used in each of the following cases

Which technique (cryptography or steganography) is used in each of the following cases for confidentiality?

  What is the ip address of the web server

You ran Wireshark during one of the logins to the site and got the following capture, webadmin.pcap.  Download the pcap file in Kali and open it in Wireshark. Use the information in it to fill in the blanks of the following: What is the IP address..

  Determine whether or not any two consecutive lines typed

Design and implement an Ada program to determine whether or not any two consecutive lines typed at the keyboard are anagrams of one another.

  Write a recursive function that takes one parameter

Write a recursive function that takes one parameter n (n>0) of type int and returns

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