Skip to Content
Advanced Algorithms and Data Structures
book

Advanced Algorithms and Data Structures

by Marcello La Rocca
July 2021
Intermediate to advanced
768 pages
25h 23m
English
Manning Publications
Content preview from Advanced Algorithms and Data Structures

9 K-d trees: Multidimensional data indexing

This chapter covers

  • Indexing a 2-D (and in general k-D) dataset efficiently
  • Implementing nearest neighbor search with k-d trees
  • Discussing k-d trees’ strengths and flaws

This chapter will be structured slightly differently from our book’s standard, simply because we will continue here a discussion started in chapter 8. We introduced a problem: searching multidimensional data for the nearest neighbor(s) of a generic point (possibly not in the dataset itself).

In this chapter, we follow up on those topics, so we won’t introduce a new problem, but pick up the “closest hub” example from chapter 8 and show a different option to solve it, using k-d trees.

9.1 Right where we left off

Let’s recap where ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

A Common-Sense Guide to Data Structures and Algorithms

A Common-Sense Guide to Data Structures and Algorithms

Jay Wengrow
Data Structures & Algorithms in Python

Data Structures & Algorithms in Python

John Canning, Alan Broder, Robert Lafore

Publisher Resources

ISBN: 9781617295485Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link