Python Data Structures Pocket Primer , livre ebook

icon

245

pages

icon

English

icon

Ebooks

2022

Lire un extrait
Lire un extrait

Obtenez un accès à la bibliothèque pour le consulter en ligne En savoir plus

Découvre YouScribe et accède à tout notre catalogue !

Je m'inscris

Découvre YouScribe et accède à tout notre catalogue !

Je m'inscris
icon

245

pages

icon

English

icon

Ebooks

2022

Lire un extrait
Lire un extrait

Obtenez un accès à la bibliothèque pour le consulter en ligne En savoir plus

As part of the best-selling Pocket Primer series, this book is designed to present the fundamentals of data structures using Python. Data structures provide a means to manage huge amounts of information such as large databases and the ability to use search and sort algorithms effectively. It is intended to be a fast-paced introduction to the core concepts of Python and data structures, illustrated with numerous code samples. Companion files with source code are available for downloading.FEATURES:Begins with an introduction to Python, and covers recursion, strings, search and sort, linked lists, stacks, and moreFeatures numerous code samples throughoutIncludes companion files with source code available for downloading.
Voir icon arrow

Date de parution

06 décembre 2022

EAN13

9781683927563

Langue

English

Poids de l'ouvrage

1 Mo

PYTHONDATASTRUCTURES Pocket Primer
LICENSE, DISCLAIMER OF LIABILITY, AND LIMITED WARRANTY By purchasing or using this book and companion files (the “Work”), you agree that this license grants permission to use the contents contained herein, including the disc, but does not give you the right of ownership to any of the textual content in the book / disc or ownership to any of the information or products contained in it.This license does not permit uploading of theWork onto the Internet or on a network (of any kind) without the written consent of the Publisher.Duplication or dissemination of any text, code, simulations, images, etc. contained herein is limited to and subject to licensing terms for the respective products, and permission must be obtained from the Publisher or the owner of the content, etc., in order to reproduce or network any portion of the textual material (in any media) that is contained in the Work. MERCURYLEARNINGANDINFORMATION(“MLI” or “the Publisher”) and anyone involved in the creation, writing, or production of the companion disc, accom-panying algorithms, code, or computer programs (“the software”), and any accompanying Web site or software of the Work, cannot and do not warrant the performance or results that might be obtained by using the contents of the Work. The author, developers, and the Publisher have used their best efforts to ensure the accuracy and functionality of the textual material and/or pro-grams contained in this package; we, however, make no warranty of any kind, express or implied, regarding the performance of these contents or programs. The Work is sold “as is” without warranty (except for defective materials used in manufacturing the book or due to faulty workmanship). The author, developers, and the publisher of any accompanying content, and anyone involved in the composition, production, and manufacturing of this work will not be liable for damages of any kind arising out of the use of (or the inability to use) the algorithms, source code, computer programs, or textual material contained in this publication. This includes, but is not limited to, loss of revenue or profit, or other incidental, physical, or consequential damages arising out of the use of this Work.
The sole remedy in the event of a claim of any kind is expressly limited to replacement of the book and/or disc, and only at the discretion of the Publisher. The use of “implied warranty” and certain “exclusions” vary from state to state, and might not apply to the purchaser of this product. Companion files for this title are available by writing to the publisher at info@merclearning.com.
PYTHONDATASTRUCTURES Pocket Primer
Oswald Campesato
M L I ERCURY EARNING AND NFORMATION Dulles, Virginia Boston, Massachusetts New Delhi
Copyright ©2023 byMERCURYLEARNINGANDINFORMATIONLLC. All rights reserved.
This publication, portions of it, or any accompanying software may not be reproduced in any way, stored in a retrieval system of any type, or transmitted by any means, media, electronic display or mechanical display, including, but not limited to, photocopy, recording, Internet postings, or scanning, without prior permission in writing from the publisher.
Publisher: David Pallai
M L I ERCURY EARNING AND NFORMATION 22841 Quicksilver Drive Dulles, VA 20166 info@merclearning.com www.merclearning.com 800-232-0223
O. Campesato.Python Data Structures Pocket Primer. ISBN: 978-1-68392-757-0
The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products. All brand names and product names mentioned in this book are trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of service marks or trademarks, etc. is not an attempt to infringe on the property of others.
Library of Congress Control Number: 2022947023 222324321 This book is printed on acid-free paper in the United States of America.
Our titles are available for adoption, license, or bulk purchase by institutions, corporations, etc. For additional information, please contact the Customer Service Dept. at 800-232-0223(toll free).
All of our titles are available in digital format at academiccourseware.com and other digital vendors. Companion files (figures and code listings) for this title are available by contactinginfo@merclearning.com. The sole obligation ofMERCURYLEARNINGANDINFORMATIONto the purchaser is to replace the disc, based on defective materials or faulty workmanship, but not based on the operation or functionality of the product.
I’d like to dedicate this book to my parents – may this bring joy and happiness into their lives.
CONTENTS
Preface
Chapter 1: Introduction to Python Some Standard Modules in Python Simple Data Types in Python Working With Numbers Working With Other Bases chr() The Function Theround()Function in Python Unicode and UTF-8 Working With Unicode Working With Strings Comparing Strings Uninitialized Variables and the Value None in Python Slicing and Splicing Strings Testing for Digits and Alphabetic Characters Search and Replace a String in Other Strings Precedence of Operators in Python Python Reserved Words Working With Loops in Python Python for Loops Numeric Exponents in Python Nested Loops Thesplit()Function With for Loops Using thesplit()Function to Compare Words PythonwhileLoops Conditional Logic in Python Thebreak/continue/passStatements Comparison and Boolean Operators Thein/not in/is/is notComparison Operators The and, or, and notBooleanOperators
xiii
1 1 2 2 3 4 5 5 5 6 7 8 8 8 9 11 11 12 12 12 13 14 14 15 16 16 17 17 17
viiiCONTEN TS
Local and Global Variables Scope of Variables Pass by Reference Versus Value Arguments and Parameters User-Defined Functions in Python Specifying Default Values in a Function Returning Multiple Values From a Function Lambda Expressions Working With Lists Lists and Basic Operations Lists and Arithmetic Operations Lists and Filter-Related Operations The join(), range(), and split() Functions Arrays and theappend()Function Other List-Related Functions Working With List Comprehensions Working With Vectors Working With Matrices Queues Tuples (Immutable Lists) Sets Dictionaries Creating a Dictionary Displaying the Contents of a Dictionary Checking for Keys in a Dictionary Deleting Keys From a Dictionary Iterating Through a Dictionary Interpolating Data From a Dictionary Dictionary Functions and Methods Other Sequence Types in Python Mutable and Immutable Types in Python Summary
Chapter 2: Recursion and Combinatorics What Is Recursion? Arithmetic Series Calculating Arithmetic Series (Iterative) Calculating Arithmetic Series (Recursive) Calculating Partial Arithmetic Series Geometric Series Calculating a Geometric Series (Iterative) Calculating Arithmetic Series (Recursive) Factorial Values Calculating Factorial Values (Iterative) Calculating Factorial Values (Recursive)
18 19 20 21 21 22 23 23 24 24 25 26 26 28 29 30 32 32 33 34 35 36 36 36 37 37 38 38 38 39 39 40
41 42 42 43 44 44 45 45 46 47 48 48
Calculating Factorial Values (Tail Recursion) Fibonacci Numbers Calculating Fibonacci Numbers (Recursive) Calculating Fibonacci Numbers (Iterative) Task: Reverse a String via Recursion Task: Check for Balanced Parentheses Task: Calculate the Number of Digits Task: Determine if a Positive Integer Is Prime Task: Find the Prime Factorization of a Positive Integer Task: Goldbach’s Conjecture Task: Calculate the GCD (Greatest Common Divisor) Task: Calculate the LCM (Lowest Common Multiple) What Is Combinatorics? Working With Permutations Working With Combinations Task: Calculate the Sum of Binomial Coefficients The Number of Subsets of a Finite Set Task: Subsets Containing a Value Larger Than k Summary
CONTENTSix
Chapter 3: Strings and Arrays Time and Space Complexity Task: Maximum and Minimum Powers of an Integer Task: Binary Substrings of a Number Task: Common Substring of Two Binary Numbers Task: Multiply and Divide via Recursion Task: Sum of Prime and Composite Numbers Task: Count Word Frequencies Task: Check if a String Contains Unique Characters Task: Insert Characters in a String Task: String Permutations Task: Find All Subsets of a Set Task: Check for Palindromes Task: Check for the Longest Palindrome Working With Sequences of Strings The Maximum Length of a Repeated Character in a String Find a Given Sequence of Characters in a String Task: Longest Sequences of Substrings The Longest Sequence of Unique Characters The Longest Repeated Substring Task: Match a String With a Word List (Simple Case) The Harder Case Working With 1D Arrays Rotate an Array Task: Shift Non-Zero Elements Leftward
49 49 50 50 51 52 53 54 55 57 58 60 61 61 62 63 64 65 67
69 70 70 72 73 74 75 77 78 80 80 81 83 85 87 87 88 89 89 91 93 94 95 95 96
Voir icon more
Alternate Text