Skip to main content
Top

2019 | Book

Data Structures and Algorithms with Scala

A Practitioner's Approach with Emphasis on Functional Programming

insite
SEARCH

About this book

This practically-focused textbook presents a concise tutorial on data structures and algorithms using the object-functional language Scala. The material builds upon the foundation established in the title Programming with Scala: Language Exploration by the same author, which can be treated as a companion text for those less familiar with Scala.

Topics and features: discusses data structures and algorithms in the form of design patterns; covers key topics on arrays, lists, stacks, queues, hash tables, binary trees, sorting, searching, and graphs; describes examples of complete and running applications for each topic; presents a functional approach to implementations for data structures and algorithms (excepting arrays); provides numerous challenge exercises (with solutions), encouraging the reader to take existing solutions and improve upon them; offers insights from the author’s extensive industrial experience; includes a glossary, and an appendix supplying an overview of discrete mathematics.

Highlighting the techniques and skills necessary to quickly derive solutions to applied problems, this accessible text will prove invaluable to time-pressured students and professional software engineers.

Table of Contents

Frontmatter
Chapter 1. Foundational Components
Abstract
We have observed that the longer professional engineers work, the more they tend to focus on advanced topics and problems with higher complexity. When this is practiced for a long time, it is easy to forget the fundamental building blocks. As a result, solutions proposed for advanced problems may be biased. In order to have a balanced approach, in this chapter, we focus on basic building blocks and fundamental algorithms.
Bhim P. Upadhyaya
Chapter 2. Fundamental Algorithms
Abstract
Clarity is the most important thing in order to get the best out of any discipline. For data structures and algorithms, wrong choices can easily waste millions of dollars (convert this to your currency of interest). A small mistake can easily waste thousands of dollars. In this context, it is important to have a sound understanding of the fundamentals of the discipline in context.
Bhim P. Upadhyaya
Chapter 3. Arrays
Abstract
The Oxford English Dictionary (OED) defines an array as “an ordered series or arrangement,” for example, an array of solar panels, an array of pixels, etc. The OED’s mathematics version of the definition is “an arrangement of quantities or symbols in rows and columns; a matrix,” whereas the computing version of the definition is “an indexed set of related elements.” All three definitions agree on ordering the entities in context.
Bhim P. Upadhyaya
Chapter 4. Lists
Abstract
We make lists of things in our daily life. They are a way of keeping things together so that they can be tracked, processed, or managed. If we are working for large corporations, we have a list of employees, a list of contractors, a list of applications, a list of buildings, a list of cafeterias, etc.
Bhim P. Upadhyaya
Chapter 5. Stacks
Abstract
We observe stacks of things in our daily life—stacks of books in a library, stacks of plates in a cafeteria, stacks of boxes in a store, etc. Even though these are different kinds of things, there are several commonalities, in terms of how items are taken out or put into these stacks. For example, whether it is a book or a plate, the one that is placed on the stack last is on top of the stack and it is the first one to be removed.
Bhim P. Upadhyaya
Chapter 6. Queues
Abstract
Queues are common in the real world. For example, we stand in a queue when we go to a cafeteria; there are queues in restaurants, at ticket counters, at airport checkin desks, etc. All of these queues have common rules.
Bhim P. Upadhyaya
Chapter 7. Hash Tables
Abstract
In the real world we have large ranges. For example, positive integers can be close to infinity. A national identification number, like a social security number, can be a nine-digit number.
Bhim P. Upadhyaya
Chapter 8. Binary Trees
Abstract
Hierarchical structures are abundant the nature. For example, a family tree helps us to understand relationships. It is a most talked about topic.
Bhim P. Upadhyaya
Chapter 9. Sorting
Abstract
Sorting is a common operation both in life and in computer science. In our daily life, we sort items so that searching is faster, and this is true in computer science as well. After all, computers exist to help us in our day-to-day tasks.
Bhim P. Upadhyaya
Chapter 10. Searching
Abstract
Searching is frequently used in our daily life as well as in computer science. If we are doing a manual search, most likely we try to match the image or description that we have in our brain to the actual object that we are looking for. So it is a kind of pattern matching operation.
Bhim P. Upadhyaya
Chapter 11. Graphs
Abstract
Graph structures are common. For example, if we represent each city with a circle and the roads connecting to them with a line, we get a graph. Generally, the traffic is bidirectional, so we get an undirected or bidirectional graph.
Bhim P. Upadhyaya
Backmatter
Metadata
Title
Data Structures and Algorithms with Scala
Author
Bhim P. Upadhyaya
Copyright Year
2019
Electronic ISBN
978-3-030-12561-5
Print ISBN
978-3-030-12560-8
DOI
https://doi.org/10.1007/978-3-030-12561-5

Premium Partner