Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

13. Programming Problems: I). (2 marks) Four people (John, Jane, Jack, Jason) were exploring a tunnel which only allowed one person to pass through each

image text in transcribed
13. Programming Problems: I). (2 marks) Four people (John, Jane, Jack, Jason) were exploring a tunnel which only allowed one person to pass through each time. So they went in one after the other. Because the tunnel has a dead end, they had to walk back. Their families were waiting for them at the entrance of the tunnel. Who would their families see first, second, .., and the last? Choose a suitable data structure to simulate the tunnel, add the four people to the data structure, and then get them out using proper operations. 2). (2 marks) Someone wants to enter 20 words into a data structure. But he does not want to have duplicated words saved. Select a suitable data structure to store the words. Write the code to read the words one by one from the keyboard and save them in the data structure. 3). (3 marks) Four peop would like to serve them the Java code to simulate the line, add the four people to the line, and then serve them (by tak out of the line and print his/her name). le (John, Jane, Jack, Jason) are waiting on a line to be served at Tim Hortons. You based on the order they arrive. Choose a suitable data structure for the line-up. Write ing each of them wants to enter 50 words into a data structure. He wants to have the words saved in ascending order. Write the code to read the words one by one from the keyboard and save them in the data structure. 4). (2 marks) Someone 13. Programming Problems: I). (2 marks) Four people (John, Jane, Jack, Jason) were exploring a tunnel which only allowed one person to pass through each time. So they went in one after the other. Because the tunnel has a dead end, they had to walk back. Their families were waiting for them at the entrance of the tunnel. Who would their families see first, second, .., and the last? Choose a suitable data structure to simulate the tunnel, add the four people to the data structure, and then get them out using proper operations. 2). (2 marks) Someone wants to enter 20 words into a data structure. But he does not want to have duplicated words saved. Select a suitable data structure to store the words. Write the code to read the words one by one from the keyboard and save them in the data structure. 3). (3 marks) Four peop would like to serve them the Java code to simulate the line, add the four people to the line, and then serve them (by tak out of the line and print his/her name). le (John, Jane, Jack, Jason) are waiting on a line to be served at Tim Hortons. You based on the order they arrive. Choose a suitable data structure for the line-up. Write ing each of them wants to enter 50 words into a data structure. He wants to have the words saved in ascending order. Write the code to read the words one by one from the keyboard and save them in the data structure. 4). (2 marks) Someone

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago

Question

What is a honey pot?

Answered: 1 week ago