The finding nearest pair of points in two disjoint sets of points (or Polygons made of points) can be found in O(nlogn) computational complexity (with O(n) memory complexity). With ordinary tree or graph search, solving this is not possible because we do not know the starting and ending points in advance. The k-d binary search tree can used to solve…
Month: November 2017
Addition without using any arthmetic operator
Often is this puzzle brought up to test someone’s ‘bits’ knowledge but it is rather straight forward to add two numbers (whole numbers). It works by same principle as we do it by Hand, i.e. add two numbers, Keep the carry and add it into the sum. In programming we can do it achieve the simple ‘addition’ via XOR operator i.e. ^…