Presentation is loading. Please wait.

Presentation is loading. Please wait.

HandoutMay 2007Sorting Networks A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering.

Similar presentations


Presentation on theme: "HandoutMay 2007Sorting Networks A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering."— Presentation transcript:

1 HandoutMay 2007Sorting Networks A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering

2 HandoutMay 2007Sorting Networks Rearranging Trains BADC Stub or lead BADC Sorted order BADC Stub or lead Stack or LIFO data structure in CE BADC Stub or lead Question: Is there an ordering that cannot be sorted using a stub? Devising a sorting algorithm BADC Siding Queue or FIFO BADC Track Train cars Engine

3 HandoutMay 2007Sorting Networks Delivering Train Cars in a Specific Order 1 BADC 2 3 Cars in the train below have been sorted according to their delivery points. However, it is still nontrivial to deposit car A in stub 1, car B in stub 2, and car C in siding 3. Cars can be pulled or pushed by the engine. 1 2 3 1 2 3 Is there a better initial ordering of the cars for the deliveries in this puzzle?

4 HandoutMay 2007Sorting Networks Train Passing Puzzle The trains below must pass each other using a siding that can hold only one car or one engine. Show how this can be done. BA21


Download ppt "HandoutMay 2007Sorting Networks A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering."

Similar presentations


Ads by Google