𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Python Data Structures Pocket Primer

✍ Scribed by Oswald Campesato


Publisher
Mercury Learning and Information
Tongue
English
Leaves
245
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


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 more
  • Features numerous code samples throughout
  • Includes companion files with source code available for downloading.

✦ Table of Contents


Cover
Title Page
Copyright
Dedication
Contents
Preface
Chapter 1: Introduction to Python
Some Standard Modules in Python
Simple Data Types in Python
Working With Numbers
Working With Other Bases
The chr() Function
The round() 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
The split() Function With for Loops
Using the split() Function to Compare Words
Python while Loops
Conditional Logic in Python
The break/continue/pass Statements
Comparison and Boolean Operators
The in/not in/is/is not Comparison Operators
The and, or, and not Boolean Operators
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 the append() 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)
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
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
Task: Sort Array In-Place in O(n) Without a Sort Function
Task: Invert Adjacent Array Elements
Task: Generate 0 That Is Three Times More Likely Than a 1
Task: Invert Bits in Even and Odd Positions
Task: Invert Pairs of Adjacent Bits
Task: Find Common Bits in Two Binary Numbers
Task: Check for Adjacent Set Bits in a Binary Number
Task: Count Bits in a Range of Numbers
Task: Find the Right-Most Set Bit in a Number
Task: The Number of Operations to Make All Characters Equal
Task: Compute XOR Without XOR for Two Binary Numbers
Working With 2D Arrays
The Transpose of a Matrix
Summary
Chapter 4: Search and Sort Algorithms
Search Algorithms
Linear Search
Binary Search Walk-Through
Binary Search (Iterative Solution)
Binary Search (Recursive Solution)
Well-Known Sorting Algorithms
Bubble Sort
Find Anagrams in a List of Words
Selection Sort
Insertion Sort
Comparison of Sort Algorithms
Merge Sort
Merge Sort With a Third Array
Merge Sort Without a Third Array
Merge Sort: Shift Elements From End of Lists
How Does Quick Sort Work?
Quick Sort Code Sample
Shellsort
Summary
Chapter 5: Linked Lists
Types of Data Structures
Linear Data Structures
Nonlinear Data Structures
Data Structures and Operations
Operations on Data Structures
What Are Singly Linked Lists?
Trade-Offs for Linked Lists
Singly Linked Lists: Create and Append Operations
A Node Class for Singly Linked Lists
Appending a Node in a Linked List
Python Code for Appending a Node
Singly Linked Lists: Finding a Node
Singly Linked Lists: Update and Delete Operations
Updating a Node in a Singly Linked List
Python Code to Update a Node
Deleting a Node in a Linked List: Method #1
Python Code for Deleting a Node: Method #2
Circular Linked Lists
Python Code for Updating a Circular Linked List
Working With Doubly Linked Lists (DLL)
A Node Class for Doubly Linked Lists
Appending a Node in a Doubly Linked List
Python Code for Appending a Node
Python Code for Inserting an Intermediate Node
Searching and Updating a Node in a Doubly Linked List
Updating a Node in a Doubly Linked List
Python Code to Update a Node
Deleting a Node in a Doubly Linked List
Python Code to Delete a Node
Summary
Chapter 6: Linked Lists and Common Tasks
Task: Adding Numbers in a Linked List (1)
Task: Reconstructing Numbers in a Linked List (1)
Task: Reconstructing Numbers in a Linked List (2)
Task: Display the First k Nodes
Task: Display the Last k Nodes
Display a Singly Linked List in Reverse Order via Recursion
Task: Remove Duplicate Nodes
Task: Concatenate Two Lists
Task: Merge Two Lists
Task: Split a Single List into Two Lists
Task: Find the Middle Element in a List
Task: Reversing a Linked List
Task: Check for Palindromes in a Linked List
Summary
Chapter 7: Queues and Stacks
What Is a Queue?
Types of Queues
Creating a Queue Using a Python List
Creating a Rolling Queue
Creating a Queue Using an Array
What Is a Stack?
Use Cases for Stacks
Operations With Stacks
Working With Stacks
Task: Reverse and Print Stack Values
Task: Display the Min and Max Stack Values (1)
Creating Two Stacks Using an Array
Task: Reverse a String Using a Stack
Task: Balanced Parentheses
Task: Tokenize Arithmetic Expressions
Task: Evaluate Arithmetic Expressions
Infix, Prefix, and Postfix Notations
Summary
Index


πŸ“œ SIMILAR VOLUMES


Python Data Structures: Pocket Primer
✍ Oswald Campesato πŸ“‚ Library πŸ“… 2022 πŸ› Mercury Learning and Information 🌐 English

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 inte

Python 3 and Data Analytics Pocket Prime
✍ Oswald Campesato πŸ“‚ Library πŸ“… 2021 πŸ› Mercury Learning and Information 🌐 English

As part of the best-selling <em>Pocket Primer</em> series, this book is designed to introduce the reader to the basic concepts of data analytics using Python 3. Itis intended to be a fast-paced introduction to some basic features of dataanalytics and also covers statistics, data visualization, and d

Python Tools for Data Scientists Pocket
✍ Oswald Campesato πŸ“‚ Library πŸ“… 2022 πŸ› Mercury Learning and Information 🌐 English

<span>As part of the best-selling </span><span>Pocket Primer</span><span> series, this book is designed to provide a thorough introduction to numerous Python tools for data scientists. The book covers features of NumPy and Pandas, how to write regular expressions, and how to perform data cleaning ta

Python 3 and Data Analytics Pocket Prime
✍ Oswald Campesato πŸ“‚ Library πŸ› Mercury Learning and Information 🌐 English

<span>As part of the best-selling </span><span>Pocket Primer</span><span> series, this book is designed to introduce the reader to the basic concepts of data analytics using Python 3. It is intended to be a fast-paced introduction to some basic features of data analytics and also covers statistics,

Python Tools for Data Scientists: Pocket
✍ Oswald Campesato πŸ“‚ Library πŸ“… 2024 πŸ› Mercury Learning and Information LLC 🌐 English

As part of the best-selling Pocket Primer series, this book is designed to provide a thorough introduction to numerous Python tools for data scientists. The book covers features of NumPy and Pandas, how to write regular expressions, and how to perform data cleaning tasks. It includes separate chapte

Data Structures and Algorithms in C++: P
✍ Lee Wittenberg πŸ“‚ Library πŸ“… 2017 πŸ› Mercury Learning and Information 🌐 English

This book covers only the topics that are absolutely essential; the more esoteric structures and algorithms are left for later study. Suitable for an introductory data structures course or self-study, this book is written from the ground up in C++ and uses features of the C++ Standard Template Libra