Scheme, computer science, Basic Computer Science

Assignment Help:
There is a path between two vertices if there is a series of edges that you can use to travel between them. For example, between vertices 1 and 3 above, there is a path made up of the edges (1 2) and (2 3), written ((1 2)(2 3)). A path may not include repeated vertices.
Write two functions: in Scheme, a predicate path?, which takes a graph and two numbers indicating vertices, which returns true iff there is a path between them.:

(path? ''(5 ((1 2)(2 3)(3 4)(3 5)(4 5))) 1 5)
#t
(path? ''(5 ((1 2)(3 4)(3 5)(4 5))) 1 5)
#f

In Prolog, write a query path(+G, +V1, +V2) which succeeds iff there is a path in graph G between vertices V1 and V2.

path(graph(5, [[1,2],[2,3],[3,4],[3,5],[4,5]]), 1 5).
true.
path(graph(5, [[1,2],[3,4],[3,5],[4,5]]), 1 5).
false.

Related Discussions:- Scheme, computer science

Pep8, Write an Assembly program that reads an integer (-32,768 through 32,7...

Write an Assembly program that reads an integer (-32,768 through 32,767) in decimal and prints its equivalent in binary. The output must show all 16 bits. And you must use a loop

Help with this question, In a certain word game a player can buy vowels and...

In a certain word game a player can buy vowels and consonants. The first vowel is free; each additional vowel cost $1. The first two consonants are free; each additional constant c

Project on ASP .NET MVC 5, I am looking for a project which is based on ASP...

I am looking for a project which is based on ASP.NET MVC 5.Could you please help me ?

Handling Text Files, I. Write an application that accomplishes the followin...

I. Write an application that accomplishes the following tasks: 1. Read a text file that contains, integers, doubles, alphabet, alphanumeric, and others. The name of the input fil

Explain uses of system call and its major types, In computing, a system cal...

In computing, a system call is how a program asks for a service from an operating system''s kernel. This may contain hardware related services (for example accessing the hard disk)

FEMAL. REPODUCATIVE. SYSTEM, Ask question #Minimum. Hello. ser can. y...

Ask question #Minimum. Hello. ser can. you. tell. me. that. what. is. the. batter. side. for. BIOLOGY. Students. from. class. 12. / xii. 100 words accepted#

Explain any five different types of computers, Question 1 Explain any five...

Question 1 Explain any five different types of computers Question 2 Describe Bus Type LAN. Its disadvantages and advantages and examples Question 3 Describe the

What is the need for an intelligent website?, Problem Hanson websites a...

Problem Hanson websites are built to work for your business and are built on the concept of intelligent website. An intelligent website is more than just a brochure on the web.

Memory, why do computer have internal memory as a part of cpu and the inter...

why do computer have internal memory as a part of cpu and the internal bulk memory seprately?

Write Your Message!

Captcha
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