Example #1
0
        private void Swap(int first, int second)
        {
            GPSData temp = items[first];

            items[first]  = items[second];
            items[second] = temp;
        }
Example #2
0
 public Node(GPSData data)
 {
     this.data  = data;
     this.left  = null;
     this.right = null;
     this.key   = haversine.getDistance(data.lat, data.lon);
 }
Example #3
0
        public void Push(GPSData item)
        {
            items.Add(item);
            heapSize++;

            while (heapSize > 1 && Compare(heapSize / 2, heapSize))
            {
                Swap(heapSize, heapSize / 2);
            }
        }
Example #4
0
        public void Insert(GPSData data)
        {
            Node newNode = new Node(data);

            if (root == null)
            {
                root = newNode;
            }
            else
            {
                InsertNode(root, newNode);
            }
        }