Friday, January 20, 2017

Tuesday, May 3, 2016

Python implementation of a Binary Search Tree

Here is the python implementation of a binary search tree. Here the binary tree is printed out using preorder.

Monday, April 25, 2016

Singly Linked List Implementation in python

Below is a very simplistic implementation of a singly linked list. The linked list implementation is done using two classes Node and LinkedList. Node is a class representing each node of the linked list and LinkedList is a class representing the whole linked list itself.

Sunday, November 15, 2015

Number of lines of code

I was asked to find out the number of lines of code in our entire module so as to figure out how hard is to maintain it. Here is the source to find out the number of lines in a python project


Wednesday, November 4, 2015

Finding out the system is little endian or big endian system

Here first a value 1 is stored in a int variable. Address of that variable is taken and cast as a char address which will work only on the first byte of the word. If a value one is available in the char then its little endian system otherwise its big endian

Sunday, August 23, 2015

Decorator implementation in python




The decorator implementation in python is helpful while implementing add on to a particular class functionality. Here in the below example the html bold and italic properties are added to a string using the decorator implementation.




Tuesday, May 5, 2015

Subtract two numbers using bit manipulation

Subtracting numbers is done similar to add number(refer previous post in this blog) with minor difference. Instead of direct and between x and y . We take negation of x to and.