Print all diagonals of a matrix in alternate order

Given a square matrix of order N*N, write code to print all the elements in the order of their diagonal in alternate forward and backward […]

Compare to strings given as linked list

In C language, string library has a function strcmp that takes two arguments and return -1, 0 or 1 depending on whether first string is […]

Find minimum and maximum value in a tree

Given a Binary tree (not BST), write code to find the minimum and maximum value in the tree. For example, if the tree is as […]

Code to evaluate a postfix expression

Given an expression in postfix notation, write code to evalute a mathematical expression given in postfix notation. For Example: Input: 4 2 3 + * […]

Code to convert In-Fix to postfix notation

Given an arithmetic expression in in-fix notation. Write code to convert that algorithm in corresponding post-fix notation. For example: Infix Postfix ------ -------- a+b ab+ […]

Minimum number of platform required for a railway station

Given arrival and departure times of all trains for a particular railway station, write code to find the minimum number of platforms required on that […]

Reversing a doubly linked list

Given a doubly linked list. Write a function to reverse it. If given list is then output of our function should be

Check if two arrays are permutation of each other

Given two arrays of integers, write a code to check if one is permutation (arranging the same numbers differently) of elements present in the other. […]

Count all left nodes in a Binary tree

One way to ask this question is: Given a Binary tree that represent a family hierarchy. A parent can have at most two children (at most […]

Storing Binary Tree in a file

Given a Binary tree, write two function. The first function should write the binary tree in a file and second function should read the file […]