Category: algorithms
Sorting: Quicksort – O(n logn), O(n^2) worst case Merge sort – O(n logn) Heap sort – O(n logn) Bubble sort – O(n^2) Insertion sort – O(n^2) Selection sort – …
April 15, 2015
algorithms, BFS, Breadth First Search, c / c++, Depth First Search, DFS, Dynamic Programming, dynamic programming, Memoization, python, Recursion
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each …
Given an index k, return the k-th row of the Pascal’s triangle. For example, given k = 3, Return . Could you optimize your algorithm to use only O(k) …
Given an integer n, return the number of trailing zeroes in Factorial N! Your solution should be in logarithmic time complexity. Naive/Bruteforce Solution It is easy to get the …
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that …