[algorithm] Examples of Algorithms which has O(1), O(n log n) and O(log n) complexities