[Haskell-cafe] Haskell, Microsoft, and interview questions

Richard A. O'Keefe ok at cs.otago.ac.nz
Fri Jun 27 00:33:35 EDT 2008

On 27 Jun 2008, at 11:36 am, Adam Langley wrote:
> Specialised for 2d only, but:
> http://www.imperialviolet.org/binary/NearestNeighbour2D.hs

In my C code for this, specialised to 3D,
  - dimension numbers were never stored
  - no arrays were used
  - the "search in x" function called
    the "search in y" function, which called
    the "search in z" function, which called
    the "search in x" function

Here's the relevant part of my kd3.h:

typedef struct KD3_Node *kd3ptr;
struct KD3_Node {
     double x, y, z;
     kd3ptr left, right;
     bool   present;
  << payload data goes here >>

More information about the Haskell-Cafe mailing list