Rearranging Trains - Computer Engineering - Lecture Slides, Slides of Computer Science

Some concept of Computer Engineering are Binary Search, Byzantine Generals, Euclid Sequences, Houses and Utilities, Malfunction Diagnosis. Main points of this lecture are: Rearranging Trains, Sorted Order, Engine, Track, Train Cars, Stub or Lead, Data Structure, Ordering, Devising a Sorting Algorithm, Pulled

Typology: Slides

2012/2013

Uploaded on 04/30/2013

naji
naji 🇮🇳

4.3

(6)

87 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Rearranging Trains
B A D C
Stub or lead
B A D C
Sorted order
B A D C
Stub or lead
Stack or LIFO data structure in CE
B A D C
Stub or lead
Question: Is there an ordering that cannot be sorted using a stub?
Devising a sorting algorithm
B A D C
Siding
Queue or FIFO
B A D C Track
Train cars Engine
Docsity.com
pf3
pf4

Partial preview of the text

Download Rearranging Trains - Computer Engineering - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Rearranging Trains

B A D C

Stub or lead

Sorted order D^ C^ B^ A

B A D C

Stub or lead

Stack or LIFO data structure in CE

C A B D

Stub or lead

Question: Is there an ordering that cannot be sorted using a stub?

Devising a sorting algorithm

C A B D

Siding

Queue or FIFO

B A D C

Track

Train cars Engine

Delivering Train Cars in a Specific Order

C B A D

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.

Is there a better initial ordering of the cars for the deliveries in this puzzle?

A 16-Input Sorting Network

Use 4-input sorters, follow by (4, 4)-mergers, and end with an (8, 8)-merger

Using the 0-1 principle, we can validate this network via 16 + 25 + 81 tests

4-sorter tests (4, 4)-merger tests (8, 8)-merger tests