Random Wits

Life is too short for a diary


$ latest projects
     ├── encrypted-files
├── binary-semaphore
├── AES
└── DES
view all


$ random stuff
├── my bookshelf
    ├── resources
    └── about me
say Hello

Back to Top

Fri 20 Nov 2015

Quickly sort large file in linear time

Any deterministic general sorting algorithm has average case time complexity @L \Omega(n\log{}n) @L . However, certain sorting algorithm can run faster in @L O(n) @L but with limitation. Instead of comparision-based sort, each element is looked individually by its value. Radix sort is one fine example of integer sorting.

Suppose, we have large directory containing names of people in random order. The names need not be distinct. We need to sort the name in the ascending order. Also our algorithm should run in linear time. A sample of the input file is shown below...

Continue reading → Tags : code lsd radix sort sorting

Sat 22 Aug 2015

Why people like Programming

Imagine a sunset, with a tired sun sinking over a meadow. The chirping of birds steals your attention as they return to their homes. And while the sun disappears, you sink back and relish your sourrounding.

Well the sunset is beautiful because it’s obvious to your eyes. Similarly programming is beautiful for those who enjoy it. Below is the poem which which eulogises lisp programming language, but it may be bland for those who have no experience with lisp...

Continue reading → Tags : programming general

Sun 22 Mar 2015

Protect Your Privacy

"If you've got nothing to hide, you've got nothing to fear". This is the most common retort used by governments to espouse Mass surveillance. They do it in the pretext of security. But even if you're not a fugitive, you have the right to protect your privacy.

Surveillance, for example, can inhibit such lawful activities as free speech, free association, and other First Amendment rights essential for democracy.Edward Snowden leaked the largest infamous clandestine mass surveillance by the NSA and GCHQ called PRISM (surveillance program). ..

Continue reading → Tags : privacy surveillance snooping