万本电子书0元读

万本电子书0元读

顶部广告

Hands-On Data Structures and Algorithms with Kotlin电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:Chandra Sekhar Nayak

出  版  社:Packt Publishing

出版时间:2019-02-28

字       数:22.9万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Understand and solve complex computational problems and write efficient code with Kotlin Key Features * Learn about important data structures such as lists, arrays, queues, and stacks * Design custom algorithms for real-life implementations * Identify suitable tools for different scenarios and deliver immediate results Book Description Data structures and algorithms are more than just theoretical concepts. They help you become familiar with computational methods for solving problems and writing logical code. Equipped with this knowledge, you can write efficient programs that run faster and use less memory. Hands-On Data Structures and Algorithms with Kotlin book starts with the basics of algorithms and data structures, helping you get to grips with the fundamentals and measure complexity. You'll then move on to exploring the basics of functional programming while getting used to thinking recursively. Packed with plenty of examples along the way, this book will help you grasp each concept easily. In addition to this, you'll get a clear understanding of how the data structures in Kotlin's collection framework work internally. By the end of this book, you will be able to apply the theory of data structures and algorithms to work out real-world problems. What you will learn * Understand the basic principles of algorithms and data structures * Explore general-purpose data structures with arrays and linked lists * Get to grips with the basics of stacks, queues, and double-ended queues * Understand functional programming and related data structures * Use performant searching and efficient sorting * Uncover how Kotlin's collection framework functions * Become adept at implementing different types of maps Who this book is for If you're a Kotlin developer who wants to learn the intricacies of implementing data structures and algorithms for scalable application development, this book is for you.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部