We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

cs502 GDB solution

Scenario

Suppose you were to drive from Lahore to Islamabad along I-70. Your Petrol tank, when full, holds enough petrol to travel m miles, and you have a map that gives distances between petrol stations along the route. Let c1 < c2 < . . .  < cn be the locations of all the petrol stations along the route where ci is the distance from Lahore to the petrol station. You can assume that the distance between neighboring petrol stations is at most m miles. Your goal is to make as few petrol stops as possible along the way.

Point of Discussion:

Keeping in view the above scenario, you need to answer the following questions:

Which is the most efficient algorithm you can find to determine the petrol station you should stop? Justify your answer with solid reasoning.

Moreover specify the time complexity of the algorithm.

Best of Luck!

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 2681

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Replies to This Discussion

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>

Note:-

For Important Helping Material related to this subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ,Short Questions Answers & more). You must view all the featured Discussion in this subject group.

For how you can view all the Featured discussions click on the Back to Subject Name Discussions link below the title of this Discussion & then under featured Discussion corner click on the view all link.

&

.... How to Find Your Subject Study Group & Join ....

P.S:    Please always try to add the discussion in proper format title like “CS101 Assignment / GDB No 01 Solution & Discussion Due Date: ___________”

idea

Greedyalgorithm is suitable for this scenario. Because Greedyalgorithm or measuring algorithm follows the problem solving heuristic of making the locally optimal choice at each stage  for finding a global optimism. For optimal solution Greedy algorithm takes unreasonably steps like divide and conquer, mathematical optimization, randomizedalgorithm. He solves combinatorial problems with properties of matriodes.

Time complexity:

Complete with variables current Time and Number of station.

Current time = 55

Number of station = cs1, cs2…..cs4.

Current time = number of station

55 - 30 =   25     cs1 away from Lahore 30 mints

25 - 15 = 10     cs2 away from Lahore 30+15 mints

10 - 5 =    5       cs3 away from Lahore 30+15+5 mints

5 - 5 =       3      cs4 away from Lahore 30+15+5 + 5 mints

how is current time = 55 ? plz koi explain b krdey ye

Yaar ye algorithm Dijkstra nahi hoga?? or yeh time suppose kiya hai ya kisi link se copy kiya hai...

mujh bhi ya dijkstra algorithm hi lag raha ha.

solution?

please koi yehi bta de k ye topic konsey chapter main se aya hai ????

ACTIVITY SELECTION ALGORITHM MAIN SY

Pura toh nahi per kuch help yahan se mil sakti hai,, look at problem statement,, see the link below               http://people.cs.ksu.edu/~subbu/Papers/Minimum%20Stops.pdf

Latest Activity

+ ! ! ! ! ! cr@zy giRl updated their profile
10 minutes ago
1 hour ago
NOORI and Haroon Bahadar are now friends
1 hour ago
zohaib iftikhar left a comment for NOORI
1 hour ago
NOORI left a comment for zohaib iftikhar
1 hour ago
3 hours ago
Ayesha posted a blog post

Golden Words

3 hours ago
3 hours ago
3 hours ago
3 hours ago
♦_"Tooba"_♦ liked shan's discussion what will be the future of PAKISTAN?
3 hours ago

1