Array implementation of Stack

A better implementation of Stack is usually using linked list unless you are sure of the number of elements in array. But if you are just starting with data structures and are not familiar with linked list, you can try implementing stack in an array. While using array to implement stack is easy, it has limitation that […]

Linked List Implementation of Stack in C++

Write a class which will implement the Stack data structure in C++. Give the declaration & definition of the class. Also define the Node. For simplicity, you may assume stack to hold integer data type.

Number of Rectangles on a chess board

Earlier we discussed, how to calculate total number of squares (of all sizes) on the chess board. Here, the problem is, How many rectangles (of any size) will be there on the chess board?

Insertion Sort

Insertion sort is the most common sorting technique used by card players to sort their cards. It sorts the array in-place and is the one of the best comparison sort algorithms.