# Data Structures & Algorithms in Kotlin

A book that teaches you the fundamental tools of implementing key data structures in Kotlin, and how to use them to solve algorithms. By Irina Galata, Matei Suica, Kelvin Lau & Vincent Ngo.

## Who is this for?

This book is for intermediate Kotlin or Android developers who already know the basics of the language and want to improve their knowledge.

## Covered concepts

- Introduction to Kotlin
- Complexity and Big O notation
- Elementary Data Structures
- Trees — in particular, Binary Trees, AVL Trees, as well as Binary Search
- Sorting Algorithms
- Solving Algorithms with Graphs

Data structures and algorithms are fundamental tools every developer should have. In this book, you’ll learn how to implement key data structures in Kotlin, and how to use them to solve a robust set of algorithms.

This book is for intermediate Kotlin or...

more## Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

## Section I: Introduction to Data Structures & Algorithms

The chapters in this short but important section explain what’s built into the Kotlin Standard Library and how you use it in building your apps. You’ll learn why one algorithm may be better suited than another. You’ll also learn what the Big-O notation is and how you can continue to answer the question: “Can we do better?”

## Section II: Elementary Data Structures

This section looks at a few important data structures that form the basis of more advanced algorithms covered in future sections.

## Section III: Trees

Trees are another way to organize information, introducing the concept of children and parents. You’ll look of the most common tree types and see how they can be used to solve specific computational problems.

Trees are a useful way to organize information when performance is critical. Adding them to your toolbelt will undoubtedly prove to be useful throughout your career.

## Section IV: Sorting Algorithms

Putting lists in order is a classical computational problem. Sorting has been studied since the days of vacuum tubes and perhaps even before that. Although you may never need to write your own sorting algorithm — thanks to the highly optimized standard library — studying sorting has many benefits. You’ll be introduced, for example, to the all-important technique of divide-and-conquer, stability, and best- and worst-case timing.

Studying sorting may seem a bit academic and disconnected to the real world of app development, but understanding the tradeoffs for these simple cases will lead you to a better understanding and let you analyze any algorithm.

## Section V: Graphs

Graphs are an extremely useful data structure that can be used to model a wide range of things: webpages on the internet, the migration patterns of birds, protons in the nucleus of an atom. This section gets you thinking deeply (and broadly) about how to use graphs and graph algorithms to solve real-world problems. The chapters that follow will give the foundation you need to understand graph data structures. Like previous sections, every other chapter will serve as a Challenge chapter so you can practice what you’ve learned.