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

Collections and Data Operations in Kotlin

In Chapter 7, Understanding Sorting Algorithms, we dealt a lot with arrays, lists, maps, and other data structures, and we created our custom implementations of them. Thankfully, Kotlin provides you with a wide range of predefined collection data structures for you under the umbrella of the collections framework.

In this chapter, we are going to discuss the collections framework and data operations in Kotlin. Kotlin inherited the collections framework from Java but has made significant improvements to it, making it easier for developers to use the collections framework while applying functional programming constructs.

The collections framework that Kotlin provides is more functional (functional as in functional programming) than Java, and is easier to use and understand.

We will start this chapter with some fundamentals of collections...