xAbhishek

Archive for 'Useful Garbage'

July 15, 2008

Fresh start to Flickr

My new Flickr account is going to be THE Flickr account I use from now. It’s also easily accessible through flickr.xabhishek.com.
If you prefer an unmasked URL then http://flickr.com/photos/xabhishek/ is where you have to head to.

The photostream is live.

May 22, 2008

Financial Management

May 21, 2008
Phew. A little late, but I managed to finish the syllabus.
Here are the revision notes I am using, in case anyone else needs it this semester or the next one.
May 22, 2008
While I look back at the exam I wrote today, I somehow wonder how it looked as though I’ve done those questions [...]

April 23, 2008

Breadth-First Binary Tree Traversal

This explanation is excellent.
So is this code:
void breadthFirst()
{
 Queue q;
 tree_node *p=root;
 if(p!=0)
 {
  q.push(p);
  while(!q.empty())
  {
  p= q.pop();
  cout<<p->info<<” “;
  if(p->left!=0)
  q.push(p->left);
  if(p->right!=0)
  q.right(p->right);
  }
 }
}

Mirror of a Binary Tree

Creating a mirror of a Binary Tree(or Binary Search Tree)

void BinaryTree::mirror(tree_node* node) { 
  if (node==NULL) {
    return;
  }
  else {
    tree_node* temp;
    // do the subtrees
    mirror(node->left);
    mirror(node->right);

    // swap the pointers in this node
    temp = node->left;
    node->left = node->right;
    node->right = temp;
  } [...]

Solving the Circular Linked List Confusion (Insertion)

If you’re inserting nodes into a linked list, it’s quite simple if you’re doing it in a linear linked list(single or double ended). But when we talk about circular linked lists, it’s complexity increases slightly just because you’re now supposed to perform all operations using just one static pointer(the first or the last node of [...]