Depth–first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as the root in the case of a graph) and explores as far as possible along each Read More …
Category: mcs021
What is a stack ? Explain the various operations of stack with an example for each operation.
Stack Stack is an abstract data type with a bounded(predefined) capacity. It is a simple data structure that allows adding and removing elements in a particular order. Every time an element is added, it goes on the top of the Read More …
Algorithm to match numbers with minimum number of moves
Problem Detail: This is a sort of edit-distance question, and is very easy. I am just quite brain dead on this subject and can’t figure it out so far. Given a series of numbers, e.g. [3, 1, 1, 1] How Read More …