Book Image

Hands-On Data Structures and Algorithms with Kotlin

By : Chandra Sekhar Nayak, Rivu Chakraborty
Book Image

Hands-On Data Structures and Algorithms with Kotlin

By: Chandra Sekhar Nayak, Rivu Chakraborty

Overview of this book

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.
Table of Contents (16 chapters)
Free Chapter
Section 1: Getting Started with Data Structures
Section 2: Efficient Grouping of Data with Various Data Structures
Section 3: Algorithms and Efficiency
Section 4: Modern and Advanced Data Structures

What this book covers

Chapter 1, A Walk Through – Data Structures and Algorithms, examines the basic definition of data structures and algorithms, how we can classify them, and their importance.

Chapter 2, Arrays – First Step to Grouping Data, dives deep into the most basic data structure, called an array. We will look at different types of arrays, and how to create and use them with some examples.

Chapter 3, Introducing Linked Lists, covers different topics on linked lists, their types, and how to implement these different types. It offers a guide on when to use these lists, and how they are different from vectors.

Chapter 4, Understanding Stacks and Queues, covers topics related to stacks and queues, how to implement them using arrays, and their use cases. We will start by introducing stacks, then see how to create them using arrays, with some examples showing operations we can make on stacks. Then, we will introduce the queue data structure to the reader, and show them how to implement different types of queues using arrays.

Chapter 5, Maps – Working with Key-Value Pairs, examines different types of map data structures and when each one is useful. Then, we will implement custom maps to show the reader how they can achieve them.

Chapter 6, Deep-Dive into Searching Algorithms, since we have already learned a lot of basic data structures, we will be now be introduced to a few algorithms to understand how they can be used to do some operations on those data structures in a more efficient way. We will cover our first and most important operation on different data structures (that is, searching) in this chapter, and also explain different types of searching techniques.

Chapter 7, Understanding Sorting Algorithms, explains how to sort a collection of items, and outlines why and when they should be sorted. Then, we will learn different techniques for sorting.

Chapter 8, Collections and Data Operations in Kotlin, introduces the collection framework provided by Kotlin and explains its usage to make your work much easier.

Chapter 9, Introduction to Functional Programming, introduces the reader to the functional style of writing programs and explains why this is beneficial. We will introduce functional data structures, along with arrow, the functional companion to the Kotlin standard library.