|
Project Information
|
Modified Splay tree implementing country look up using IP address Author: Chetan Nichkawde Email: chetan.nichkawde@gmail.com Date: February 19, 2009 IP address ranges are organised into splay tree nodes with the average of lower and upper limit range as the key. The value at the node is tuple with lower limit of the range, upper limit of the range, country code and country name as elements. e.g. (3582623744L, 3582631935L, 'FI', 'FINLAND') The 32 bit IP address is translated into integer value. The search runs O(log(n)) in amortized time. Splay tree data structure has additional advantage that the recently accessed elements move to the top of the tree and the subsequent access to them is faster. |