Monday, February 24, 2014

Prime Numbers

In this post, I will be consolidating the important facts I am going to learn about the Prime numbers. Prime numbers topic is one of the interesting topics in the Number theory. Below are the list of facts about Prime numbers.

  1. Prime Number Theorem says that number of prime numbers not greater than x is approximately equals to (X / ln(X) ). Useful result for calculating the complexities of various algorithms.

Saturday, February 15, 2014

Hashing related Data Structures

Well, Hashing is one of the core fundamental concept in the Computer Science. It is also one of the concept which is used extensively by the programmers. Why the programmers love hashing?

Hashing is used by the programmers to support the cases which requires maintaining an associative array where the values are indexed by the keys. For example, most of the Java programmers use the HashMap data structure which is used to store an entry of the form (key, value) pair. The HashMap holds many key value pairs. We can think hashing in terms of dimensionality reduction where an object having n - dimensions (fields) are reduced to represent in single dimension.

Binary Search Trees and its variants

In this article, I would like to discuss on the Binary Search Trees and its variants. This article wont explain in detail about the  Binary Search Trees, but it covers more about its variants. 

Rope Datastructure

This post will handle specially bout the Rope Data structure.
Rope is a data structure to hold a single string of characters. Yes, it is correct, that Rope holds only the characters which are represented in a string. Why any one on the earth wants a special data structure to hold the characters in a string where a contiguous chunk of bytes in memory is sufficient. Well,  Rope is designed to optimise mainly three operations on the string.

  1. Adding a new character to the String, 
  2. Deleting a character from the string, 
  3. Concatenating two strings.                            
   The above mentioned operations are performed well compared on Rope to traditional String implementations. Who in the earth wants to optimise the above mentioned operations. Well think about the text editors. How will you store the constantly changing the text data in the text editor. If you are using String,  then you will be spending a lot of time copying the data in the memory for every new single character.
Here is an excellent article on Rope Datastructure. Thanks to IBM Developer works.