Inverse weighted distance interpolation in golang

Inverse distance weighting (IDW) is a type of deterministic method for multivariate interpolation with a known scattered set of points. The assigned values to unknown points are calculated with a weighted average of the values available at the known points. This technique, explicitly makes the assumption that things that are close to one another are more alike than those that are farther apart. To predict a value for any unmeasured location, IDW uses the measured values surrounding the prediction location.
Read more →

basic sorting algorithms implemented in golang

This post includes go-lang based implementation of some of the classic sorting algorithms. This article primarily, has been written, as an academic exercise, to not forget the basic principles of sorting. Bubble Sort wiki Bubble sort is perhaps the simplest of all sorting algorithms, the basic principle is to bubble up the largest (or the smallest) and then the second largest and then the third largest and so on. Each bubble takes the full sweep of the list, hence best-case, average-case as well as the worst-case performance are all O(n2)
Read more →

merge sort in python

Many useful algorithms are recursive in structure: to solve a given problem, they call themselves recursively one or more times to deal with closely related subproblems. These algorithms typically follow a divide-and-conquer approach: they break the problem into several subproblems that are similar to the original problem but smaller in size, solve the subproblems recursively, and then combine these solutions to create a solution to the original problem. The divide-and-conquer paradigm involves three steps at each level of the recursion:
Read more →

Binary Search Tree in python

BST data structure supports many dynamic-set operations including Search Minimum Maximum Predecessor Successor Insert Delete These basic operations allow us to treat this data structure both as a dictionary and as a priority queue. Basic operations on a binary tree takes time proportional to the height of the tree, O(lg n) [worst case] and even O(n) if the tree is a linear chain. If you want to learn more about practical application of these trees check this post out.
Read more →

Heap Sort in python

The (binary) heap data structure is an array object that we can view as a nearly complete binary tree. Each node of the tree corresponds to an element of the array. The tree is completely filled on all levels except possibly the lowest, which is filled from the left up to a point. An array A that represents a heap is an object with two attributes: length, which (as usual) gives the number of elements in the array.
Read more →