# program code in java

Problem description:

A group of K persons (K > 1) want to cross a bridge from East to West during the

night. The persons that are crossing the bridge must use a flashlight. There is only

one flashlight. The bridge is very narrow and allows two persons to cross

it at the same time at most. Two persons go from east to west and one person returns with

the flashlight from west to east. If the two persons are crossing the bridge together,

they are crossing it at the speed of the slower one. These people are trying to cross

the bridge as quickly as possible.

Use 3 search strategies (UCS, IDS and A*) to find the best order for these persons to

cross the bridge.

Input file:

1) C, number of test cases

2) For each test case:

a. K, number of people

b. A list of K numbers, showing the time required by each person to pass

to the other side.

Output:

Your program should printout the following information for each search strategy:

1) Sequence of trips taken by the group along with direction of each trip for each

strategy (solution)

2) Total time required to have all K people crossing using each strategy (solution

cost).

3) Total number of generated nodes (Search time) for each strategy

4) Maximum number of nodes concurrently stored in the system (Space

requirement) for each strategy

Input:

1

3

3, 2, 5

Description:

There is one test case, C=1

There are three people, K=3.

The first person (a) needs 3 (time units) to pass to from one side to the other

The second person (b) needs 2 time units

The third person (c) needs 5 time units

Output:

Test case #1:

UCS

Solution 1. (a,b) move to the west side

2. (b) returns with the flashlight

3. (b,c) move to the west side

Solution Cost 10

Search Cost 14

Space Requirement 9

Kemahiran: Java, Kejuruteraan Perisian, Algoritma

Tentang Majikan:
( 0 ulasan ) Riyadh, Saudi Arabia

ID Projek: #29442134

xalumok

Hey~ It's a pretty trivial problem for competitive programming and I have A LOT of exp in it. Can do your job carefully and test everything out. Time - 1-2 days

\$25 USD dalam 2 hari
(1 Ulasan)
1.5

## 7 pekerja bebas membida secara purata \$26 untuk pekerjaan ini

Hello Sir/ Ma’am A skilled full stack developer, I have rich experience in JAVA, C, C++, C#, Python, .NET , Mysql, Sql, Ionic , Matlab, ANDROID and ARDUINO. I am very confident with my skills and I'd like to help Lagi

\$20 USD dalam sehari
(26 Ulasan)
5.1
shabih2468

Greetings I saw your project and as an expert in C/C++/Java language I am sure I can do your task. I have previously worked on various Java projects which includes making games, management systems projects and Java is Lagi

\$20 USD dalam sehari
(8 Ulasan)
3.0
zhongjinshao9999

Hi Client. I have skills like java and I am an expert for it. I would like to work with your project in full time and also can make your project perfectly. Please contact with me and discuss with your project.

\$30 USD dalam sehari
(5 Ulasan)
2.3
SanchezSafronov

Dear Sir. As an experienced algorithm expert, it is very interesting to me. I have been working on several data structure & algorithm projects such yours for 7+ years. Since having programming contestant experience, I Lagi

\$50 USD dalam sehari
(3 Ulasan)
2.2
SJayTech

Hi, I am an experienced java developer with 7+ years of experience. I will be pleased to do this project for you. Please inbox to discuss further details. Regards, Sharjeel

\$20 USD dalam 7 hari
(4 Ulasan)
1.6
shubhjiyani007

I have solved numerous live problems in C++ in R & W multimedia and education under proffessor of C++ as well as cleared many problems under given space complexity along with space complexity on hackersearth and litco Lagi

\$15 USD dalam 2 hari
(0 Ulasan)
0.0