Movatterモバイル変換


[0]ホーム

URL:


Packt
Search iconClose icon
Search icon CANCEL
Subscription
0
Cart icon
Your Cart(0 item)
Close icon
You have no products in your basket yet
Save more on your purchases!discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Profile icon
Account
Close icon

Change country

Modal Close icon
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timerSALE ENDS IN
0Days
:
00Hours
:
00Minutes
:
00Seconds
Home> Data> Data Analysis> Python Data Structures and Algorithms
Python Data Structures and Algorithms
Python Data Structures and Algorithms

Python Data Structures and Algorithms: Improve application performance with graphs, stacks, and queues

Arrow left icon
Profile Icon Benjamin Baka
Arrow right icon
$35.99$39.99
Full star iconFull star iconHalf star iconEmpty star iconEmpty star icon2.7(11 Ratings)
eBookMay 2017310 pages1st Edition
eBook
$35.99 $39.99
Paperback
$48.99
Paperback
$49.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$35.99 $39.99
Paperback
$48.99
Paperback
$49.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
OR

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Table of content iconView table of contentsPreview book icon Preview Book

Python Data Structures and Algorithms

Built-in data types

Python data types can be divided into three categories: numeric, sequence, and mapping. There is also theNone object that represents aNull, or absence of a value. It should not be forgotten either that other objects such as classes, files, and exceptions can also properly be consideredtypes; however, they will not be considered here.

Every value in Python has a data type. Unlike many programming languages, in Python you do not need to explicitly declare the type of a variable. Python keeps track of object types internally.

Python built-in data types are outlined in the following table:

Category

Name

Description

None

None

The null object.

Numeric

int

Integer.

float

Floating point number.

complex

Complex number.

bool

Boolean (True, False).

Sequences

str

String of characters.

list

List of arbitrary...

Sets

Sets are unordered collections of unique items. Sets are themselves mutable, we can add and remove items from them; however, the items themselves must be immutable. An important distinction with sets is that they cannot contain duplicate items. Sets are typically used to perform mathematical operations such as intersection, union, difference, and complement.

Unlike sequence types, set types do not provide any indexing or slicing operations. There are also no keys associated with values, as is the case with dictionaries. There are two types of set objects in Python, the mutableset object and the immutablefrozenset object. Sets are created using comma-separated values within curly braces. By the way, we cannot create an empty set usinga={}, because this will create a dictionary. To create an empty set, we write eithera=set() ora=frozenset().

Methods and operations of sets...

Modules for data structures and algorithms

In addition to the built-in types, there are several Python modules that we can use to extend these built-in types and functions. In many cases, these Python modules may offer efficiency and programming advantages that allow us to simplify our code.

So far, we have looked at the built-in datatypes of strings, lists, sets, and dictionaries as well as thedecimal andfractions modules. They are often described by the termabstract data types (ADTs). ADTs can be considered as mathematical specifications for the set of operations that can be performed on data. They are defined by their behavior rather than their implementation. In addition to the ADTs that we have looked at, there are several Python libraries that provide extensions to the built-in datatypes. These will be discussed in the following section.

...

Operations and expressions


There are a number of operations that are common to all data types. For example, all data types, and generally all objects, can be tested for a truth value in some way. The following are values that Python considersFalse:

  • TheNone type
  • False
  • An integer, float, or complex zero
  • An empty sequence or mapping
  • An instance of a user-defined class that defines a__len__() or__bool__() method that returns zero orFalse

All other values are consideredTrue.

Boolean operations

A Boolean operation returns a value of either True orFalse. Boolean operations are ordered in priority, so if more than one Boolean operation occurs in an expression, the operation with the highest priority will occur first. The following table outlines the three Boolean operators in descending order of priority:

Operator

Example

notx

ReturnsTrue ifx isFalse; returnsFalse otherwise.

x andy

ReturnsTrue if bothx andy areTrue; returnsFalse otherwise.

x ory

ReturnsTrue if eitherx ory isTrue; returnsFalse...

Left arrow icon

Page1 of 6

Right arrow icon
Download code iconDownload Code

Key benefits

  • A step by step guide, which will provide you with a thorough discussion on the analysis and design of fundamental Python data structures.
  • Get a better understanding of advanced Python concepts such as big-o notation, dynamic programming, and functional data structures.
  • Explore illustrations to present data structures and algorithms, as well as their analysis, in a clear, visual manner.

Description

Data structures allow you to organize data in a particular way efficiently. They are critical to any problem, provide a complete solution, and act like reusable code. In this book, you will learn the essential Python data structures and the most common algorithms. With this easy-to-read book, you will be able to understand the power of linked lists, double linked lists, and circular linked lists. You will be able to create complex data structures such as graphs, stacks and queues. We will explore the application of binary searches and binary search trees. You will learn the common techniques and structures used in tasks such as preprocessing, modeling, and transforming data. We will also discuss how to organize your code in a manageable, consistent, and extendable way. The book will explore in detail sorting algorithms such as bubble sort, selection sort, insertion sort, and merge sort. By the end of the book, you will learn how to build components that are easy to understand, debug, and use in different applications.

Who is this book for?

The book will appeal to Python developers. A basic knowledge of Python is expected.

What you will learn

  • *Gain a solid understanding of Python data structures.
  • *Build sophisticated data applications.
  • *Understand the common programming patterns and algorithms used in Python data science.
  • *Write efficient robust code.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date :May 30, 2017
Length:310 pages
Edition :1st
Language :English
ISBN-13 :9781786465337
Category :
Languages :
Concepts :

What do you get with eBook?

Product feature iconInstant access to your Digital eBook purchase
Product feature icon Download this book inEPUB andPDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature iconDRM FREE - Read whenever, wherever and however you want
OR

Contact Details

Modal Close icon
Payment Processing...
tickCompleted

Billing Address

Product Details

Publication date :May 30, 2017
Length:310 pages
Edition :1st
Language :English
ISBN-13 :9781786465337
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99billed monthly
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconSimple pricing, no contract
$199.99billed annually
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick iconExclusive print discounts
$279.99billed in 18 months
Feature tick iconUnlimited access to Packt's library of 7,000+ practical books and videos
Feature tick iconConstantly refreshed with 50+ new titles a month
Feature tick iconExclusive Early access to books as they're written
Feature tick iconSolve problems while you work with advanced search and reference features
Feature tick iconOffline reading on the mobile app
Feature tick iconChoose a DRM-free eBook or Video every month to keep
Feature tick iconPLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick iconExclusive print discounts

Frequently bought together


Python GUI Programming Cookbook, Second Edition
Python GUI Programming Cookbook, Second Edition
Read more
May 2017444 pages
Full star icon3.4 (5)
eBook
eBook
$39.59$43.99
$54.99
$43.99
Python High Performance, Second Edition
Python High Performance, Second Edition
Read more
May 2017270 pages
Full star icon4 (2)
eBook
eBook
$32.39$35.99
$43.99
Python Data Structures and Algorithms
Python Data Structures and Algorithms
Read more
May 2017310 pages
Full star icon2.7 (11)
eBook
eBook
$35.99$39.99
$48.99
$49.99
Stars icon
Total$147.97
Python GUI Programming Cookbook, Second Edition
$54.99
Python High Performance, Second Edition
$43.99
Python Data Structures and Algorithms
$48.99
Total$147.97Stars icon

Table of Contents

13 Chapters
Python Objects, Types, and ExpressionsChevron down iconChevron up icon
Python Objects, Types, and Expressions
Understanding data structures and algorithms
Python for data
Summary
Python Data Types and StructuresChevron down iconChevron up icon
Python Data Types and Structures
Operations and expressions
Built-in data types
Sets
Modules for data structures and algorithms
Summary
Principles of Algorithm DesignChevron down iconChevron up icon
Principles of Algorithm Design
Algorithm design paradigms
Recursion and backtracking
Runtime analysis
Amortized analysis
Summary
Lists and Pointer StructuresChevron down iconChevron up icon
Lists and Pointer Structures
Arrays
Pointer structures
Nodes
Finding endpoints
Singly linked lists
A faster append operation
Getting the size of the list
Improving list traversal
Deleting nodes
Clearing a list
Doubly linked lists
Circular lists
Summary
Stacks and QueuesChevron down iconChevron up icon
Stacks and Queues
Stacks
Queues
Summary
TreesChevron down iconChevron up icon
Trees
Terminology
Tree nodes
Binary trees
Summary
Hashing and Symbol TablesChevron down iconChevron up icon
Hashing and Symbol Tables
Hashing
Hash table
Summary
Graphs and Other AlgorithmsChevron down iconChevron up icon
Graphs and Other Algorithms
Graphs
Directed and undirected graphs
Weighted graphs
Graph representation
Graph traversal
Other useful graph methods
Priority queues and heaps
Selection algorithms
Summary
SearchingChevron down iconChevron up icon
Searching
Linear Search
Binary search
Interpolation search
Summary
SortingChevron down iconChevron up icon
Sorting
Sorting algorithms
Bubble sort
Insertion sort
Selection sort
Quick sort
Summary
Selection AlgorithmsChevron down iconChevron up icon
Selection Algorithms
Selection by sorting
Randomized selection
Deterministic selection
Summary
Design Techniques and StrategiesChevron down iconChevron up icon
Design Techniques and Strategies
Classification of algorithms
Technical implementation
Complexity classes
Summary
Implementations, Applications, and ToolsChevron down iconChevron up icon
Implementations, Applications, and Tools
Tools of the trade
Data preprocessing
Machine learning
Data visualization
Summary

Recommendations for you

Left arrow icon
LLM Engineer's Handbook
LLM Engineer's Handbook
Read more
Oct 2024522 pages
Full star icon4.9 (29)
eBook
eBook
$43.19$47.99
$59.99
Getting Started with Tableau 2018.x
Getting Started with Tableau 2018.x
Read more
Sep 2018396 pages
Full star icon4 (3)
eBook
eBook
$39.59$43.99
$32.99
$54.99
Python for Algorithmic Trading Cookbook
Python for Algorithmic Trading Cookbook
Read more
Aug 2024406 pages
Full star icon4.3 (20)
eBook
eBook
$43.19$47.99
$59.99
RAG-Driven Generative AI
RAG-Driven Generative AI
Read more
Sep 2024338 pages
Full star icon4.3 (16)
eBook
eBook
$32.39$35.99
$43.99
Machine Learning with PyTorch and Scikit-Learn
Machine Learning with PyTorch and Scikit-Learn
Read more
Feb 2022774 pages
Full star icon4.4 (87)
eBook
eBook
$39.59$43.99
$54.99
$79.99
Building LLM Powered Applications
Building LLM Powered Applications
Read more
May 2024342 pages
Full star icon4.2 (21)
eBook
eBook
$35.99$39.99
$49.99
Python Machine Learning By Example
Python Machine Learning By Example
Read more
Jul 2024526 pages
Full star icon4.9 (8)
eBook
eBook
$33.29$36.99
$45.99
AI Product Manager's Handbook
AI Product Manager's Handbook
Read more
Nov 2024488 pages
eBook
eBook
$28.79$31.99
$39.99
Right arrow icon

Customer reviews

Top Reviews
Rating distribution
Full star iconFull star iconHalf star iconEmpty star iconEmpty star icon2.7
(11 Ratings)
5 star27.3%
4 star9.1%
3 star9.1%
2 star18.2%
1 star36.4%
Filter icon Filter
Top Reviews

Filter reviews by




ChrisOct 31, 2017
Full star iconFull star iconFull star iconFull star iconFull star icon5
Pretty sure those other two reviews are fake. Also, if you complain about grammar and spelling then you don't know Packt Publishing.My opinion on this book is that so far it has great information and is easy to follow along. I'm taking AI courses online and stumbled across this by accident. It just so happens that some of the chapters in this book are perfect supplemental material for my program, namely the Graphs chapters. I haven't read then entire book but so far so great.
Amazon Verified reviewAmazon
eliekawerkAug 09, 2017
Full star iconFull star iconFull star iconFull star iconFull star icon5
This book is concise and very well written. If you want to learn practical data structures and algorithms in Python, I recommend this resource. One of the nice features of this book is that code is presented hand in hand with theory.
Amazon Verified reviewAmazon
MOLMay 02, 2020
Full star iconFull star iconFull star iconFull star iconFull star icon5
Concise, emphasis is on the principles. Other books get lost in details, mixing different levels of abstraction. Best text to learn about data structures using Python.
Amazon Verified reviewAmazon
volsbitJun 24, 2017
Full star iconFull star iconFull star iconFull star iconEmpty star icon4
This books makes for a great read. I appreciate the conciseness and how most of the concepts are projected with relative ease in the book. Absolutely worth your salt. I will encourage anyone wanting a head-start in data structures and algorithms to take a stab at it. Highly comprehensible to say the least. That said, I will like to confess I don't ever regret purchasing the book.
Amazon Verified reviewAmazon
Elina MaysterJan 11, 2021
Full star iconFull star iconFull star iconEmpty star iconEmpty star icon3
More details would be better
Amazon Verified reviewAmazon
  • Arrow left icon Previous
  • 1
  • 2
  • 3
  • Arrow right icon Next

People who bought this also bought

Left arrow icon
Causal Inference and Discovery in Python
Causal Inference and Discovery in Python
Read more
May 2023466 pages
Full star icon4.5 (47)
eBook
eBook
$39.59$43.99
$53.99
Generative AI with LangChain
Generative AI with LangChain
Read more
Dec 2023376 pages
Full star icon4.1 (33)
eBook
eBook
$57.59$63.99
$79.99
Modern Generative AI with ChatGPT and OpenAI Models
Modern Generative AI with ChatGPT and OpenAI Models
Read more
May 2023286 pages
Full star icon4.1 (30)
eBook
eBook
$35.99$39.99
$44.99
$49.99
Deep Learning with TensorFlow and Keras – 3rd edition
Deep Learning with TensorFlow and Keras – 3rd edition
Read more
Oct 2022698 pages
Full star icon4.5 (44)
eBook
eBook
$35.99$39.99
$49.99
Machine Learning Engineering  with Python
Machine Learning Engineering with Python
Read more
Aug 2023462 pages
Full star icon4.6 (37)
eBook
eBook
$35.99$39.99
$49.99
Right arrow icon

About the author

Profile icon Benjamin Baka
Benjamin Baka
Benjamin Baka is a full-stack software developer and is passionate about cutting-edge technologies and elegant programming techniques. He has 10 years in different technologies, from C++, Java, Ruby, Python to Qt. Some of the projects he's working on can be found on his GitHub page. He is currently working on exciting technologies all from the camp of mPedigree Network.
Read more
See other products by Benjamin Baka
Getfree access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook?Chevron down iconChevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website?Chevron down iconChevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook?Chevron down iconChevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support?Chevron down iconChevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks?Chevron down iconChevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook?Chevron down iconChevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Create a Free Account To Continue Reading

Modal Close icon
OR
    First name is required.
    Last name is required.

The Password should contain at least :

  • 8 characters
  • 1 uppercase
  • 1 number
Notify me about special offers, personalized product recommendations, and learning tips By signing up for the free trial you will receive emails related to this service, you can unsubscribe at any time
By clicking ‘Create Account’, you are agreeing to ourPrivacy Policy andTerms & Conditions
Already have an account? SIGN IN

Sign in to activate your 7-day free access

Modal Close icon
OR
By redeeming the free trial you will receive emails related to this service, you can unsubscribe at any time.

[8]ページ先頭

©2009-2025 Movatter.jp