SlideShare a Scribd company logo
There is mountain with a popular hiking trail. At one point on the trail, the path narrows so that
only a single hiker can pass through at a time. When several hikers arrive at this point
simultaneously. two queues can build up: one for hikers ascending the mountain and one f hikers
descending. It takes each hiker one second to pass completely through the narrow portion of the
trail. If all the waiting hikers are all going the same direction (either ascending or descending),
then they can immediately begin passing through one at a time, in the order of their arrival.
When hikers going in both directions are waiting, then local custom dictates the following
procedure for determining which hiker has priority (i.e., gets to pass through first): - If in the
previous second, no hiker passed through, then the first waiting descending hiker gets to go first -
If in the previous second, a descending hiker passed through, then the first hiker in the
descending queue goes first. - If in the previous second, an ascending hiker passed through, then
the hiker in the ascending queue goest first. For each hiker, find the time when they will pass
through the narrow portion of the trail. Function Description Complete the function getResult in
the editor below.

More Related Content

More from jkcs20004

This is a pedigree for a family with a history of alkaptonuria, a rar.pdf
 This is a pedigree for a family with a history of alkaptonuria, a rar.pdf This is a pedigree for a family with a history of alkaptonuria, a rar.pdf
This is a pedigree for a family with a history of alkaptonuria, a rar.pdf
jkcs20004
 
Topic - research and choose a company that has committed to BI. Descr.pdf
 Topic - research and choose a company that has committed to BI. Descr.pdf Topic - research and choose a company that has committed to BI. Descr.pdf
Topic - research and choose a company that has committed to BI. Descr.pdf
jkcs20004
 
Tom collected an informal gender based data sample at his university..pdf
 Tom collected an informal gender based data sample at his university..pdf Tom collected an informal gender based data sample at his university..pdf
Tom collected an informal gender based data sample at his university..pdf
jkcs20004
 
To which of the following facts is the anatomy of birds not s.pdf
 To which of the following facts is the anatomy of birds not s.pdf To which of the following facts is the anatomy of birds not s.pdf
To which of the following facts is the anatomy of birds not s.pdf
jkcs20004
 
Tobac Company reported an operating loss of $132,000 for financial re.pdf
 Tobac Company reported an operating loss of $132,000 for financial re.pdf Tobac Company reported an operating loss of $132,000 for financial re.pdf
Tobac Company reported an operating loss of $132,000 for financial re.pdf
jkcs20004
 
to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf
 to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf
to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf
jkcs20004
 
to sate that the previlenon of salmonela in the regions water difers.pdf
 to sate that the previlenon of salmonela in the regions water difers.pdf to sate that the previlenon of salmonela in the regions water difers.pdf
to sate that the previlenon of salmonela in the regions water difers.pdf
jkcs20004
 
Theres no doubt that today we face many environmental problems poll.pdf
 Theres no doubt that today we face many environmental problems poll.pdf Theres no doubt that today we face many environmental problems poll.pdf
Theres no doubt that today we face many environmental problems poll.pdf
jkcs20004
 
Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf
 Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf
Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf
jkcs20004
 
To map a newly discovered mutation that is proposed to contribute to .pdf
 To map a newly discovered mutation that is proposed to contribute to .pdf To map a newly discovered mutation that is proposed to contribute to .pdf
To map a newly discovered mutation that is proposed to contribute to .pdf
jkcs20004
 
There is a relationship between tables T1 and T2, and the columns inv.pdf
 There is a relationship between tables T1 and T2, and the columns inv.pdf There is a relationship between tables T1 and T2, and the columns inv.pdf
There is a relationship between tables T1 and T2, and the columns inv.pdf
jkcs20004
 
to four decimal places. Two pairs Two cards with one denomination, t.pdf
 to four decimal places. Two pairs Two cards with one denomination, t.pdf to four decimal places. Two pairs Two cards with one denomination, t.pdf
to four decimal places. Two pairs Two cards with one denomination, t.pdf
jkcs20004
 
To examine the potential effects on the transmission of dengus, Bian .pdf
 To examine the potential effects on the transmission of dengus, Bian .pdf To examine the potential effects on the transmission of dengus, Bian .pdf
To examine the potential effects on the transmission of dengus, Bian .pdf
jkcs20004
 
To examine the potential effects on the transmission of dengue, Bian .pdf
 To examine the potential effects on the transmission of dengue, Bian .pdf To examine the potential effects on the transmission of dengue, Bian .pdf
To examine the potential effects on the transmission of dengue, Bian .pdf
jkcs20004
 
TO DO add your implementation and JavaDocs.public class ThreeT.pdf
 TO DO add your implementation and JavaDocs.public class ThreeT.pdf TO DO add your implementation and JavaDocs.public class ThreeT.pdf
TO DO add your implementation and JavaDocs.public class ThreeT.pdf
jkcs20004
 
To determine whether an obtained F value is statistically significant.pdf
 To determine whether an obtained F value is statistically significant.pdf To determine whether an obtained F value is statistically significant.pdf
To determine whether an obtained F value is statistically significant.pdf
jkcs20004
 
to 34 of men in the same age group. What is the probability th.pdf
 to 34 of men in the same age group. What is the probability th.pdf to 34 of men in the same age group. What is the probability th.pdf
to 34 of men in the same age group. What is the probability th.pdf
jkcs20004
 
Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf
 Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf
Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf
jkcs20004
 
Three common tools of financial analysis are Financial reporting, se.pdf
 Three common tools of financial analysis are Financial reporting, se.pdf Three common tools of financial analysis are Financial reporting, se.pdf
Three common tools of financial analysis are Financial reporting, se.pdf
jkcs20004
 
This specimen produces dry, medium to large, colonies with entire to .pdf
 This specimen produces dry, medium to large, colonies with entire to .pdf This specimen produces dry, medium to large, colonies with entire to .pdf
This specimen produces dry, medium to large, colonies with entire to .pdf
jkcs20004
 

More from jkcs20004 (20)

This is a pedigree for a family with a history of alkaptonuria, a rar.pdf
 This is a pedigree for a family with a history of alkaptonuria, a rar.pdf This is a pedigree for a family with a history of alkaptonuria, a rar.pdf
This is a pedigree for a family with a history of alkaptonuria, a rar.pdf
 
Topic - research and choose a company that has committed to BI. Descr.pdf
 Topic - research and choose a company that has committed to BI. Descr.pdf Topic - research and choose a company that has committed to BI. Descr.pdf
Topic - research and choose a company that has committed to BI. Descr.pdf
 
Tom collected an informal gender based data sample at his university..pdf
 Tom collected an informal gender based data sample at his university..pdf Tom collected an informal gender based data sample at his university..pdf
Tom collected an informal gender based data sample at his university..pdf
 
To which of the following facts is the anatomy of birds not s.pdf
 To which of the following facts is the anatomy of birds not s.pdf To which of the following facts is the anatomy of birds not s.pdf
To which of the following facts is the anatomy of birds not s.pdf
 
Tobac Company reported an operating loss of $132,000 for financial re.pdf
 Tobac Company reported an operating loss of $132,000 for financial re.pdf Tobac Company reported an operating loss of $132,000 for financial re.pdf
Tobac Company reported an operating loss of $132,000 for financial re.pdf
 
to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf
 to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf
to orpere 8- Ourrot Liablities and the Ziquidity Anabyis subtopic f.pdf
 
to sate that the previlenon of salmonela in the regions water difers.pdf
 to sate that the previlenon of salmonela in the regions water difers.pdf to sate that the previlenon of salmonela in the regions water difers.pdf
to sate that the previlenon of salmonela in the regions water difers.pdf
 
Theres no doubt that today we face many environmental problems poll.pdf
 Theres no doubt that today we face many environmental problems poll.pdf Theres no doubt that today we face many environmental problems poll.pdf
Theres no doubt that today we face many environmental problems poll.pdf
 
Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf
 Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf
Therefore, converted to a z interval, we wish to find P(z0.61). Note .pdf
 
To map a newly discovered mutation that is proposed to contribute to .pdf
 To map a newly discovered mutation that is proposed to contribute to .pdf To map a newly discovered mutation that is proposed to contribute to .pdf
To map a newly discovered mutation that is proposed to contribute to .pdf
 
There is a relationship between tables T1 and T2, and the columns inv.pdf
 There is a relationship between tables T1 and T2, and the columns inv.pdf There is a relationship between tables T1 and T2, and the columns inv.pdf
There is a relationship between tables T1 and T2, and the columns inv.pdf
 
to four decimal places. Two pairs Two cards with one denomination, t.pdf
 to four decimal places. Two pairs Two cards with one denomination, t.pdf to four decimal places. Two pairs Two cards with one denomination, t.pdf
to four decimal places. Two pairs Two cards with one denomination, t.pdf
 
To examine the potential effects on the transmission of dengus, Bian .pdf
 To examine the potential effects on the transmission of dengus, Bian .pdf To examine the potential effects on the transmission of dengus, Bian .pdf
To examine the potential effects on the transmission of dengus, Bian .pdf
 
To examine the potential effects on the transmission of dengue, Bian .pdf
 To examine the potential effects on the transmission of dengue, Bian .pdf To examine the potential effects on the transmission of dengue, Bian .pdf
To examine the potential effects on the transmission of dengue, Bian .pdf
 
TO DO add your implementation and JavaDocs.public class ThreeT.pdf
 TO DO add your implementation and JavaDocs.public class ThreeT.pdf TO DO add your implementation and JavaDocs.public class ThreeT.pdf
TO DO add your implementation and JavaDocs.public class ThreeT.pdf
 
To determine whether an obtained F value is statistically significant.pdf
 To determine whether an obtained F value is statistically significant.pdf To determine whether an obtained F value is statistically significant.pdf
To determine whether an obtained F value is statistically significant.pdf
 
to 34 of men in the same age group. What is the probability th.pdf
 to 34 of men in the same age group. What is the probability th.pdf to 34 of men in the same age group. What is the probability th.pdf
to 34 of men in the same age group. What is the probability th.pdf
 
Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf
 Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf
Three students, Habib, Vikki and Claire, in Biol 107 ran their sample.pdf
 
Three common tools of financial analysis are Financial reporting, se.pdf
 Three common tools of financial analysis are Financial reporting, se.pdf Three common tools of financial analysis are Financial reporting, se.pdf
Three common tools of financial analysis are Financial reporting, se.pdf
 
This specimen produces dry, medium to large, colonies with entire to .pdf
 This specimen produces dry, medium to large, colonies with entire to .pdf This specimen produces dry, medium to large, colonies with entire to .pdf
This specimen produces dry, medium to large, colonies with entire to .pdf
 

Recently uploaded

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 

Recently uploaded (20)

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 

There is mountain with a popular hiking trail. At one point on the tr.pdf

  • 1. There is mountain with a popular hiking trail. At one point on the trail, the path narrows so that only a single hiker can pass through at a time. When several hikers arrive at this point simultaneously. two queues can build up: one for hikers ascending the mountain and one f hikers descending. It takes each hiker one second to pass completely through the narrow portion of the trail. If all the waiting hikers are all going the same direction (either ascending or descending), then they can immediately begin passing through one at a time, in the order of their arrival. When hikers going in both directions are waiting, then local custom dictates the following procedure for determining which hiker has priority (i.e., gets to pass through first): - If in the previous second, no hiker passed through, then the first waiting descending hiker gets to go first - If in the previous second, a descending hiker passed through, then the first hiker in the descending queue goes first. - If in the previous second, an ascending hiker passed through, then the hiker in the ascending queue goest first. For each hiker, find the time when they will pass through the narrow portion of the trail. Function Description Complete the function getResult in the editor below.