Showing posts with label Algorithms. Show all posts
Showing posts with label Algorithms. Show all posts

Saturday, November 10, 2012

Thursday, November 8, 2012

B Tree Algorithms


Binary Tree a binary tree is a tree data structure in which each node has at most two child nodes

Binary Search Tree is a sorted node-based binary tree data structure which has the following properties

B-Tree The B-tree is a generalization of a binary search tree in that a node can have more than two children

B+ Tree The primary value of a B+ tree is in storing data for efficient retrieval in a block-oriented storage context—in particular, filesystems. This is primarily because unlike binary search trees, B+ trees have very high fanout (typically on the order of 100 or more), which reduces the number of I/O operations required to find an element in the tree.

B+ Tree are used by many file systems as well as DB's for internal storage.

Friday, November 2, 2012

Lock-free replacement for java.util.Hashtable

Watched the below google tech talk of a lock free hashtable that uses compare-and-swap CAS instructions to achieve consistency when accessed by multiple threads. It is also a probing algorithm when it comes to collision resolution. What is interesting is how well it scales up when multiple threads are trying to write to it.

Google tech talk http://www.youtube.com/watch?v=HJ-719EGIts

http://sourceforge.net/projects/high-scale-lib/