Topological Sort [Hackerearth]

A Topological sort of a Directed-Acyclic graph G is a linear ordering of all its vertices such that if G contains an edge E (u, v), then u appears before v in the ordering. And if the graph is not acyclic, then no linear ordering is possible.

Time & Space complexity [Cheat Sheet]

he efficiency of an algorithm can be measured by two parameters: Time Complexity also known as running time of an algorithm is the number of primitive operations executed on a particular input.
Space Complexity is the total (extra) memory space required by the program for its execution.

Which sorting algorithm makes minimum number of swaps?

Sorting means arranging a set of data in an order. There’re various algorithms to sort the data (in a data structure) in increasing or decreasing order. These algorithms can be divided on basis of various factors. Inplace sorting means that all the data which is to be sorted can be accommodated at a time in memory. Examples of inplace sorting algorithms are Selection sort, Bubble sort etc.