/* Ajith - Syntax Higlighter - End ----------------------------------------------- */


Death of Google Reader - Journey towards alternatives


Long Long ago when INTERNET is booming up with so many websites its really hard to follow the interesting one. Its quite clumsy to go around miliions of sites to check for new posts.

Am I Doomed ?

No, you are not. RSS feed mechanism is the answer.

Just follow the RSS feed of your favourite site and the RSS reader will maintain the unread articles, favourite articles and so on. Voilla simple and effective solution to follow various sites.


Divide a number by 3 without using any arithmetic operators

How to divide a number by 3 without using operators + - / * %

NOTE: I am just trying to collect various answers down in this post available across multiple sites in internet as mentioned in references.

Solution 01:
#include <stdio.h>
#include <stdlib.h>

int main()
    FILE *fp=fopen("temp.dat","w+b");
    int number=12346;
    int divisor=3;
    char *buf = calloc(number,1);
    int result=fread(buf,divisor,number,fp);
    printf("%d / %d = %d", number, divisor, result);
    return 0;


Checking Balance of Symbols in a expression

This article is part of article series - "Datastructures"

A balanced expression contains right number of closing and open braces.

For example:

  • [[ - unbalanced expression
  • []{}() - balanced expression
  • [(*)] - balanced expression

Let us see how to find if an expression is balanced or not by checking for following operators [ ] { } and ( ) in the given expression.

Using Stacks


Conversion from Infix to Postfix

This article is part of article series - "Datastructures"

Converting a Fully Parenthesized Infix expression into Postfix expression  


Five types of input characters

  • Opening parentheses
  • Operands
  • Operators
  • Closing parentheses
  • New line character (\n)


 Function  : main  
 Calls     : createStack  
 Called by : NONE   
 Parameters: Accepts input expression for processing  
 Returns   : Converts Fully paranthesized INFIX 
             expression into POSTFIX expression

SET i to 0
GET infix expression from user into input_array
SET var with input_array[i]

CALL createStack

WHILE var != end of string

  IF var equals to '(' THEN
    CALL pushIntoStack (stack, var)  

  ELSE IF var is a number THEN        
    PRINT var  

  ELSE IF var is an arithmetic operator THEN
    CALL pushIntoStack (stack, var) 
  ELSE IF var equals to ')' THEN

    WHILE stackTop != '('

      IF stackTop is an arithmetic operator THEN

        PRINT stackTop
        popFromStack (stack)


    popFromStack (stack)


  SET var with input_expression[INCREMENT i]


CALL freeStack (stack)


Deleting a Node from a Singly Linked List

This article is part of article series - "Datastructures"

Previous Article: Implementation of Singly Linked List.
Next Article: Reversing a Singly Linked List

Deletion of a Node from a Singly Linked List
Similar to insertion we have three cases for deleting a Node from a Singly Linked List.

  • Deleting First Node in Singly Linked List

    To complete deletion of firstNode in the list we have to change Head pointing to Next of firstNode.

    firstNode = Head
    Head = firstNode->Next
    free firstNode
    Time Complexity: O(1)
    Space Complexity: O(1)