售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Title Page
Copyright and Credits
Hands-On Data Structures and Algorithms with Kotlin
Packt Upsell
Why subscribe?
Packt.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Section 1: Getting Started with Data Structures
A Walk Through - Data Structures and Algorithms
Technical requirements
Working with the command-line compiler
Working with IntelliJ IDEA
Working with Eclipse
Learning about algorithms
A few examples of algorithms
Introduction to data structures
Complexity analysis
Analyzing with time complexity
Analyzing with space complexity
Time complexity versus space complexity
Learning about notations
Counting instructions
Asymptotic behavior
Examples of complexity analysis
Summary
Further reading
Arrays - First Step to Grouping Data
Technical requirements
Introduction to arrays
Operations with arrays
Creating an array
Creating an array using library functions
Creating an array using the constructor
Accessing elements from an array
Accessing an element using the Array Access Operator []
Accessing an element using the get function
Accessing an element using the extension functions
Iterating over an array
Updating elements in an array
Vectors (dynamic arrays)
Adding an element to a Vector class
Updating and fetching an element
Removing an element from Vector
The beauty of immutable arrays
Multidimensional array
Operations in multidimensional arrays
Accessing an element
Updating an element
Iterating over the array
Working with a matrix
Adding two matrices
Multiplying two matrices
A short introduction to strings
Summary
Questions
Section 2: Efficient Grouping of Data with Various Data Structures
Introducing Linked Lists
Technical requirements
Getting started with LinkedList
Understanding a Singly Linked List
Operations on a Singly Linked List
Inserting a node in a Singly Linked List
Inserting a node at the 0th index
Inserting a node at the last index
Inserting a node at a given index
Fetching a node value from a Singly Linked List
Fetching a value from the first or last node
Fetching the value of a node at a given index
Updating a node from a Singly Linked List
Deleting a node from a Singly Linked List
Removing the first and last node of a LinkedList
Removing the node based on its value
Removing the node at a particular index
Clearing the LinkedList
Searching for an element in a Singly Linked List
Understanding the Doubly Linked List
Adding a node
Deleting a node
Fetching a node
Understanding a Circular Linked List
Summary
Questions
Understanding Stacks and Queues
Technical requirements
Understanding stacks
Operations on a stack
Implementing stacks
Stacks with a fixed size
Stacks with a dynamic size
Stack implementation using a LinkedList
Pushing an element into the stack
Popping an element from the stack
Understanding a queue
Operations on queues
Implementing a queue
Queues with a fixed size
Queues with a dynamic size
Queue implementation using LinkedList
Performance of a queue
Introducing circular queues
Primary operations in a circular queue
Secondary operations in a circular queue
Understanding deque – double-ended queue
Primary operations – deque
Summary
Questions
Further reading
Questions
Maps - Working with Key-Value Pairs
Technical requirements
Introducing Map
Operations in Map
Introducing hashing
Benefits of hashing
The hash function
Hash collision
Fixing collisions with chaining
Implementing HashMap
A template of the HashMap class
The Node class of HashMap
The hash function of HashMap
Operations on HashMap
Determining the bucket from the key
Putting a key-value pair into the HashMap
Getting a value from HashMap
Removing a key-value pair from HashMap
Implementing ArrayMap
Internal data structure of ArrayMap
A template of the ArrayMap class
Operations on ArrayMap
Putting a key-value pair into ArrayMap
Getting a value from ArrayMap
Removing a key-value pair from ArrayMap
Summary
Questions
Section 3: Algorithms and Efficiency
Deep-Dive into Searching Algorithms
Technical requirements
Understanding the searching algorithm
Linear search
Linear search in an unordered collection
Linear search in an ordered collection
Binary search
Working with binary search
Jump search
Choosing indexes to be skipped
Exponential search
Pattern search
Naive pattern search
How Naive pattern search works
The Rabin-Karp algorithm
Hash functions for Rabin-Karp
Rolled-hash functions for Rabin-Karp
Searching using hash values
Performance
The Knuth-Morris-Pratt algorithm
The prefix function
Searching using a prefix array
Summary
Questions
Understanding Sorting Algorithms
Technical requirements
Understanding the bubble sort algorithm
How the bubble sort algorithm works
Implementing bubble sort
Understanding selection sort
How the selection sort algorithm works
Implementing selection sort
Understanding insertion sort
How the insertion sort algorithm works
Implementing insertion sort
Understanding merge sort
How the merge sort algorithm works
Implementing merge sort
Understanding quick sort
How the quick sort algorithm works
Choosing the pivot element
Example based on quick sort
Implementing quick sort
Understanding heap sort
A basic introduction to heap
Binary heap
How the heap sort algorithm works
Implementing heap sort
Summary
Questions
Section 4: Modern and Advanced Data Structures
Collections and Data Operations in Kotlin
Technical requirements
Introduction to collections
Benefits of a collections framework
The collection framework hierarchy
Understanding a group of ordered elements – List, MutableList
Various operations (sorting, searching) on List
Sorting a list with custom class / data types
Searching collections
Mutable lists
Group of unique elements – Set, MutableSet
Maps – working with key-value pairs
Understanding data operations in collections
The map function
The filter function
The flatMap function
The drop functions
The take functions
The zip function
Summary
Questions
Introduction to Functional Programming
Introducing functional programming
Immutability
Implementing immutability in Kotlin
Immutable collections
Exploring pure functions
Lambda and higher-order functions
Higher-order functions
Functional data structures
Understanding the Arrow framework and typed FP
The Option type constructor
The Either type constructor
Introducing category theory
Functors
Applicatives
Monads
Summary
Further reading
Other Books You May Enjoy
Leave a review - let other readers know what you think
Assessments
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜