k-d tree is a binary search tree that represents the node value as k-dimensional coordinates, and how the left and right branches go depends on the layer of tree (e.g. 1: x, 2: y, 3: z, 4: x, ...). This data structure is typically used for nearest neighbor algorithm.