Advanced Algorithms and Data Structures
eBook - ePub

Advanced Algorithms and Data Structures

  1. 768 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Advanced Algorithms and Data Structures

About this book

"An accessible introduction to the fundamental algorithms used to run the world." - Richard Vaughan, Purple Monkey Collective Advanced Algorithms and Data Structures introduces a collection of algorithms for complex programming challenges in data analysis, machine learning, and graph computing. Summary
As a software engineer, you'll encounter countless programming challenges that initially seem confusing, difficult, or even impossible. Don't despair! Many of these "new" problems already have well-established solutions. Advanced Algorithms and Data Structures teaches you powerful approaches to a wide range of tricky coding challenges that you can adapt and apply to your own applications. Providing a balanced blend of classic, advanced, and new algorithms, this practical guide upgrades your programming toolbox with new perspectives and hands-on techniques.Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the technology
Can you improve the speed and efficiency of your applications without investing in new hardware? Well, yes, you can: Innovations in algorithms and data structures have led to huge advances in application performance. Pick up this book to discover a collection of advanced algorithms that will make you a more effective developer. About the book
Advanced Algorithms and Data Structures introduces a collection of algorithms for complex programming challenges in data analysis, machine learning, and graph computing. You'll discover cutting-edge approaches to a variety of tricky scenarios. You'll even learn to design your own data structures for projects that require a custom solution. What's inside
Build on basic data structures you already know
Profile your algorithms to speed up application
Store and query strings efficiently
Distribute clustering algorithms with MapReduce
Solve logistics problems using graphs and optimization algorithms About the reader
For intermediate programmers. About the author
Marcello La Rocca is a research scientist and a full-stack engineer. His focus is on optimization algorithms, genetic algorithms, machine learning, and quantum computing. Table of Contents 1 Introducing data structures
PART 1 IMPROVING OVER BASIC DATA STRUCTURES
2 Improving priority queues: d-way heaps
3 Treaps: Using randomization to balance binary search trees
4 Bloom filters: Reducing the memory for tracking content
5 Disjoint sets: Sub-linear time processing
6 Trie, radix trie: Efficient string search
7 Use case: LRU cache
PART 2 MULTIDEMENSIONAL QUERIES
8 Nearest neighbors search
9 K-d trees: Multidimensional data indexing
10 Similarity Search Trees: Approximate nearest neighbors search for image retrieval
11 Applications of nearest neighbor search
12 Clustering
13 Parallel clustering: MapReduce and canopy clustering
PART 3 PLANAR GRAPHS AND MINIMUM CROSSING NUMBER
14 An introduction to graphs: Finding paths of minimum distance
15 Graph embeddings and planarity: Drawing graphs with minimal edge intersections
16 Gradient descent: Optimization problems (not just) on graphs
17 Simulated annealing: Optimization beyond local minima
18 Genetic algorithms: Biologically inspired, fast-converging optimization

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Advanced Algorithms and Data Structures by Marcello La Rocca in PDF and/or ePUB format, as well as other popular books in Computer Science & Data Processing. We have over one million books available in our catalogue for you to explore.

Information

1 Introducing data structures

This chapter covers
  • Explaining why you should learn about data structures and algorithms
  • Understanding the difference between algorithms and data structures
  • Abstracting a problem
  • Moving from problems to solutions
So, you want to learn about algorithms and data structures: excellent decision!
If you are still deciding whether this is for you, I hope this introductory chapter can dispel your doubts and spark your interest in this great topic.
Why should you learn about algorithms? The short answer is to try to become a better software developer. Knowing about data structures and algorithms is like adding a tool to your tool belt.
Have you ever heard of Maslow’s hammer, aka the law of the instrument? It’s a conjecture, driven by observation, about how people who only know one way to do things tend to apply what they know to all kinds of different situations.
If your tool belt only has a hammer, you will be tempted to treat everything as a nail. If you only know how to sort a list, you will be tempted to sort your tasks list every time you add a new task or have to pick the next one to tackle, and you will never be able to leverage the context to find more efficient solutions.
The purpose of this book is to give you many tools you can use when approaching a problem. We will build upon the basic algorithms normally presented in a computer science 101 course (or the like) and introduce you to more advanced material.
After reading this book, you should be able to recognize situations where you could improve the performance of your code by using a specific data structure and/or algorithm.
Obviously, your goal should not be to remember by heart all the details of all the data structures we will discuss. Rather, we will try to show you how to reason about issues, and where to find ideas about algorithms that might help you in solving problems. This book will also serve as a handbook, sort of like a recipe collection, with indications about some common scenarios that could be used to categorize those problems and the best structures you could use to attack them.
Keep in mind that some topics are quite advanced and, when we delve into the details, it might require a few reads to understand everything. The book is structured in such a way as to provide many levels of in-depth analysis, with advanced sections generally grouped together toward the end of each chapter, so if you’d like to only get an understanding of the topics, you are not required to delve into the theory.

1.1 Data structures

To start with our journey, we first need to agree on a common language to describe and evaluate algorithms.
Describing them is pretty much a standard process: algorithms are described in terms of the input they take and the output they provide. Their details can be illustrated with pseudo-code (ignoring implementation details of programming languages) or actual code.
Data structures (DS) follow the same conventions, but they also go slightly beyond. We also have to describe the actions you can perform on a data structure. Usually each action is described in term of an algorithm, with an input and an output, but in addition to those, for DSs we also need to describe side effects, the changes an action might cause to the data structure itself.
To fully understand what this means, we first need to properly define data structures.

1.1.1 Defining a data structure

A data structure is a specific solution for organizing data that provides storage for items and capabilities1 for storing and retrieving them.
The simplest example of a DS is an array. For instance, an array of characters provides storage for a finite number of characters and methods to retrieve each character in the array based on its position. Figure 1.1 shows how array = [‘C’, ‘A’, ‘R’] is stored: an array of characters storing the characters C, A, and R, such that, for instance, array[1] corresponds to the value ‘A’.
Figure 1.1 The (simplified) internal representation of an array. Each element of the array in the picture corresponds to a byte of memory,2 whose address is shown below it. Each element’s index is shown above it. An array is stored as a contiguous block of memory, and each element’s address can be obtained by adding its index within the array to the offset of the first element. For instance, the fourth character of the array (array[3], empty in the figure), has address 0xFF00 + 3 = 0xFF03.
Data structures can be abstract or concrete:
  • An abstract data type (ADT) specifies the operations that can be performed on some data and the computational complexity of those operations. No details are provided on how data is stored or how physical memory is used.
  • A data structure (DS) is a concrete implementation of the specification provided by an ADT.
What is an ADT?
You can think about an ADT as the blueprint, while a DS is the translation of those specifications into real code.
An ADT is defined from the point of view of the one who uses it, by describing its behavior in terms of possible values, possible operations on it, and the output and side effects of these operations.
A more formal definition would describe an ADT as a ...

Table of contents

  1. inside front cover
  2. Advanced Algorithms and Data Structures
  3. Copyright
  4. dedication
  5. contents
  6. front matter
  7. 1 Introducing data structures
  8. Part 1. Improving over basic data structures
  9. 2 Improving priority queues: d-way heaps
  10. 3 Treaps: Using randomization to balance binary search trees
  11. 4 Bloom filters: Reducing the memory for tracking content
  12. 5 Disjoint sets: Sub-linear time processing
  13. 6 Trie, radix trie: Efficient string search
  14. 7 Use case: LRU cache
  15. Part 2. Multidimensional queries
  16. 8 Nearest neighbors search
  17. 9 K-d trees: Multidimensional data indexing
  18. 10 Similarity Search Trees: Approximate nearest neighbors search for image retrieval
  19. 11 Applications of nearest neighbor search
  20. 12 Clustering
  21. 13 Parallel clustering: MapReduce and canopy clustering
  22. Part 3. Planar graphs and minimum crossing number
  23. 14 An introduction to graphs: Finding paths of minimum distance
  24. 15 Graph embeddings and planarity: Drawing graphs with minimal edge intersections
  25. 16 Gradient descent: Optimization problems (not just) on graphs
  26. 17 Simulated annealing: Optimization beyond local minima
  27. 18 Genetic algorithms: Biologically inspired, fast-converging optimization
  28. appendix A. A quick guide to pseudo-code
  29. appendix B. Big-O notation
  30. appendix C. Core data structures
  31. appendix D. Containers as priority queues
  32. appendix E. Recursion
  33. appendix F. Classification problems and randomnized algorithm metrics
  34. index
  35. inside back cover