HandoutLecture 9Sorting Networks Rearranging Trains BADC Stub or lead BADC Sorted order BADC Stub or lead Stack or LIFO data structure in CE BADC Stub.

Slides:



Advertisements
Similar presentations
Stacks and Queues. Not really data structures – More of an enforcement of policy – Can be implemented using an array or linked list – Can store just about.
Advertisements

1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
Shunting-yard algorithm Infix to postfix conversion Based on
Stacks  a data structure which stores data in a Last-in First-out manner (LIFO)  has a pointer called TOP  can be implemented by either Array or Linked.
Alford Academy Business Education and Computing1 Advanced Higher Computing Based on Heriot-Watt University Scholar Materials Stack and Queues.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Unit : Overview of Queues.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
Sit-in lab 4.  Given a number of strings containing only “a”, “b”, “c”, “d”  Check each string that it follows the pattern a n b m c m d n where m,
Data Structures & Algorithms
CS 206 Introduction to Computer Science II 10 / 26 / 2009 Instructor: Michael Eckmann.
Mesh connected networks. Sorting algorithms Efficient Parallel Algorithms COMP308.
HandoutMay 2007Sorting Networks A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering.
DISTRIBUTED CACHE SYSTEM EE SOFTWARE LAB, TECHNION By Shamil Nisimov Dror Bohrer Supervisor : Yaron Ben Shoshan Lab Engineer : David Ilana.
Selection Sort
Cardinality & Sorting Networks. Cardinality constraint Appears in many practical problems: scheduling, timetabling etc’. Also takes place in the Max-Sat.
EXPANDING STACKS AND QUEUES CS16: Introduction to Data Structures & Algorithms 1 Tuesday, February 10, 2015.
Data Structures and Algorithms. 2 3 Outline What is a data structure Examples –elementary data structures –hash tables Computer capabilities What is.
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 5: Stacks and Queues.
Stacks and queues Basic operations Implementation of stacks and queues Stack and Queue in java.util Data Structures and Algorithms in Java, Third EditionCh04.
Damian Gordon.  What is a queue?  It’s a structure that conforms to the principle of First In, First Out (FIFO).  The first item to join the.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Data Structures: Advanced Damian Gordon. Advanced Data Structure We’ll look at: – Linked Lists – Trees – Stacks – Queues.
Arrays and Collections Tonga Institute of Higher Education.
Selection Sort
 STACK STACK  STACK OPERATIONS STACK OPERATIONS  PUSH ALGORITHM PUSH ALGORITHM  POP ALGORITHM POP ALGORITHM  USES OF STACK USES OF STACK  THE TOWER.
Understanding General Software Development Lesson 3.
Lecture 4: Networking and Information Flow EEN 112: Introduction to Electrical and Computer Engineering Professor Eric Rozier, 2/4/2013.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: Tel 3049.
May 2015Sorting NetworksSlide 1 Sorting Networks A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering.
Convex Sets & Concave Sets A planar region R is called convex if and only if for any pair of points p, q in R, the line segment pq lies completely in R.
Computer Engineering Rabie A. Ramadan Lecture 6.
14.2 Work and Machines A______________is a device that changes a force. Machines make work_______________to do. –They change the size of a force needed,
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Understanding General Software Development Lesson 3.
1. In science, the word work has a different meaning than you may be familiar with. Work: using a force to move an object a distance 2.
May 2007Sorting NetworksSlide 1 Sorting Networks A Lecture in CE Freshman Seminar Series: Ten Puzzling Problems in Computer Engineering.
1 Chapter 5 Stacks. 2 Topics LIFO (last-in-first-out) structure Implementations –Use class LinearList or Chain –from scratch Applications –parentheses.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
Stacks and Queues. DCS – SWC 2 Stacks A stack is an abstract data structure, with some special properties: –Insertion and deletion is only allowed at.
دكتر ميرزا حسن حسيني مولفان: تهيه كننده: دكتر ميرزا حسن حسيني.
BCA II Data Structure Using C
Information Systems and Network Engineering Laboratory II
Mesh connected networks. Sorting algorithms
Chapter 15 Lists Objectives
Stacks and Queues.
Stacks and Queues.
i206: Lecture 11: Stacks, Queues
Stack Lesson xx   This module shows you the basic elements of a type of linked list called a stack.
IP Forwarding Relates to Lab 3.
Principles of Computing – UFCFA3-30-1
ريكاوري (بازگشت به حالت اوليه)
Convex Sets & Concave Sets
Infix to Postfix Conversion
Software Engineering Lecture #13.
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
Software Engineering Lecture #12.
Pancake Sorting Input: Stack of pancakes, each of different sizes
Stack A data structure in which elements are inserted and removed only at one end (called the top). Enforces Last-In-First-Out (LIFO) Uses of Stacks Evaluating.
Mutable Data (define mylist (list 1 2 3)) (bind ((new (list 4)))
Data Structures and Algorithms for Information Processing
ASSESSMENT 11 assessment groups should inspect
Ալգորիթմներ Stack, Queue, Tree.
1 Hour Training Bubbles Closing a Sale
In the Interest of Safety
Sorting Networks A Lecture in CE Freshman Seminar Series:
A force is a ………… a ………… or a ………….
ENERGY WHAT WE THINK WE KNOW. ENERGY WHAT WE THINK WE KNOW.

Presentation transcript:

HandoutLecture 9Sorting 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

HandoutLecture 9Sorting 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 Is there a better initial ordering of the cars for the deliveries in this puzzle?

HandoutLecture 9Sorting 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

HandoutLecture 9Sorting Networks 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 tests sorter tests(4, 4)-merger tests(8, 8)-merger tests