• Complain

Magnus Lie Hetland - Python Algorithms: Mastering Basic Algorithms in the Python Language

Here you can read online Magnus Lie Hetland - Python Algorithms: Mastering Basic Algorithms in the Python Language full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2014, publisher: Apress Media, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Magnus Lie Hetland Python Algorithms: Mastering Basic Algorithms in the Python Language
  • Book:
    Python Algorithms: Mastering Basic Algorithms in the Python Language
  • Author:
  • Publisher:
    Apress Media
  • Genre:
  • Year:
    2014
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Python Algorithms: Mastering Basic Algorithms in the Python Language: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Python Algorithms: Mastering Basic Algorithms in the Python Language" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Python Algorithms, Second Edition explains the Python approach to algorithm analysis and design. Written by Magnus Lie Hetland, author of Beginning Python, this book is sharply focused on classical algorithms, but it also gives a solid understanding of fundamental algorithmic problem-solving techniques.The book deals with some of the most important and challenging areas of programming and computer science in a highly readable manner. It covers both algorithmic theory and programming practice, demonstrating how theory is reflected in real Python programs. Well-known algorithms and data structures that are built into the Python language are explained, and the user is shown how to implement and evaluate others.

Magnus Lie Hetland: author's other books


Who wrote Python Algorithms: Mastering Basic Algorithms in the Python Language? Find out the surname, the name of the author of the book and a list of all author's works by series.

Python Algorithms: Mastering Basic Algorithms in the Python Language — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Python Algorithms: Mastering Basic Algorithms in the Python Language" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Copyright

Python Algorithms: Mastering Basic Algorithms in the Python Language

Copyright 2010 by Magnus Lie Hetland

All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher.

ISBN-13 (pbk): 978-1-4302-3237-7

ISBN-13 (electronic): 978-1-4302-3238-4

Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1

Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.

The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.

President and Publisher: Paul Manning

Lead Editor: Frank Pohlmann

Development Editor: Douglas Pundick

Technical Reviewer: Alex Martelli

Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh

Coordinating Editor: Adam Heath

Compositor: Mary Sudul

Indexer: Brenda Miller

Artist: April Milne

Cover Designer: Anna Ishchenko

Photo Credit: Kai T. Dragland

Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail , or visit www.springeronline.com.

For information on translations, please e-mail , or visit www.apress.com.

Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk SaleseBook Licensing web page at www.apress.com/info/bulksales.

The information in this book is distributed on an "as is" basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work.

The source code for this book is available to readers at www.apress.com

About the Author
About the Technical Reviewer Acknowledgments Thanks to everyone who - photo 1
About the Technical Reviewer
Acknowledgments Thanks to everyone who contributed to this book either - photo 2
Acknowledgments

Thanks to everyone who contributed to this book, either directly or indirectly. This certainly includes my algorithm mentors, Arne Halaas and Bjrn Olstad, as well as the entire crew at Apress and my brilliant tech editor, Alex. Thanks to Nils Grimsmo, Jon Marius Venstad, Ole Edsberg, Rolv Seehuus, and Jorg Rdsj for useful input; to my parents, Kjersti Lie and Tor M. Hetland, and my sister, Anne Lie-Hetland, for their interest and support; and to my uncle Axel, for checking my French. Finally, a big thank-you to the Python Software Foundation for their permission to reproduce parts of the Python standard library and to Randall Munroe for letting me include some of his wonderful XKCD comics.

Preface

This book is a marriage of three of my passions: algorithms, Python programming, and explaining things. To me, all three of these are about aestheticsfinding just the right way of doing something, looking until you uncover a hint of elegance, and then polishing that until it shines. Or at least until it is a bit shinier. Of course, when there's a lot of material to cover, you may not get to polish things quite as much as you want. Luckily, though, most of the contents in this book is prepolished, because I'm writing about really beautiful algorithms and proofs, as well as one of the cutest programming languages out there. As for the third part, I've tried hard to find explanations that will make things seem as obvious as possible. Even so, I'm sure I have failed in many ways, and if you have suggestions for improving the book, I'd be happy to hear from you. Who knows, maybe some of your ideas could make it into a future edition? For now, though, I hope you have fun with what's here and that you take any newfound insight and run with it. If you can, use it to make the world a more awesome place, in whatever way seems right.

Chapter 1. Introduction

1. Write down the problem .

2. Think real hard .

3. Write down the solution .

-- "The Feynman Algorithm" as described by Murray Gell-Mann

Consider the following problem. You are to visit all the cities, towns, and villages of, say, Sweden and then return to your starting point. This might take a while (there are 24 978 locations to visit, after all), so you want to minimize your route. You plan on visiting each location exactly once, following the shortest route possible. As a programmer, you certainly don't want to plot the route by hand. Rather, you try to write some code that will plan your trip for you. For some reason, however, you can't seem to get it right. A straightforward program works well for a smaller number of towns and cities but seems to run forever on the actual problem, and improving the program turns out to be surprisingly hard. How come?

Actually, in 2004, a team of five researchers found such a tour of Sweden, after a number of other research teams had tried and failed. The five-man team used cutting-edge software with lots of clever optimizations and tricks of the trade, running on a cluster of 96 Xeon 2.6 GHz workstations. Their software ran from March 2003 until May 2004, before it finally printed out the optimal solution. Taking various interruptions into account, the team estimated that the total CPU time spent was about 85 years !

Consider a similar problem: You want to get from Kashgar, in the westernmost regions of China, to Ningbo, on the east coast, following the shortest route possible. Now, China has 3 583 715 km of roadways and 77 834 km of railways, with millions of intersections to consider and a virtually unfathomable number of possible routes to follow. It might seem that this problem is related to the previous one, yet this shortest path problem is one solved routinely, with no appreciable delay, by GPS software and online map services. If you give those two cities to your favorite map service, you should get the shortest route in mere moments. What's going on here?

You will learn more about both of these problems later in the book; the first one is called the traveling salesman (or salesrep ) problem and is covered in

What's All This, Then?

This is a book about algorithmic problem solving for Python programmers. Just like books on, say, object-oriented patterns, the problems it deals with are of a general natureas are the solutions. Your task as an algorist will, in many cases, be more than simply to implement or execute an existing algorithm, as you would, for example, in solving an algebra problem. Instead, you are expected to come up with

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Python Algorithms: Mastering Basic Algorithms in the Python Language»

Look at similar books to Python Algorithms: Mastering Basic Algorithms in the Python Language. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Python Algorithms: Mastering Basic Algorithms in the Python Language»

Discussion, reviews of the book Python Algorithms: Mastering Basic Algorithms in the Python Language and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.