Algorithms encountered till chapter 2

Implementation of algorithms in topics and problems section. Soon will
be grouped.