2. โ Algorithms and data structures are the most fundamental
concepts in computing
characteristics:
โ How algorithms manipulate information contained within data
structures
โ How data is arranged in memory
โ What the performance characteristics of particular data
structures are
Introduction
3. Example
โ We assume that the market is laid out randomly,
and each vendor sells a random subset of items,
some of which may be on our list.
โ Our aim is to minimize the price we pay
for each item as well as minimize the time spent
at the market.
โ One way to approach this is to write an
algorithm like the following:
4. Algorithm
Repeat for each vendor:
1. Does the vendor have items on my list and is
the cost less than a predicted cost for the item?
2. If yes, buy and remove from list; if no, move
on to the next vendor.
3. If no more vendors, end.
6. References
Python Data Structures and Algorithms, Benjamin Baka
First published: May 2017
Production reference: 1260517
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-735-5
www.packtpub.com
7. References
Python Data Structures and Algorithms, Benjamin Baka
First published: May 2017
Production reference: 1260517
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-735-5
www.packtpub.com