#programming-blogs
Read more stories on Hashnode
Articles with this tag
Next Permutation using in-built function called next_permutation(O(n!*n)TC & O(1)SC) and using Intuition and efficient method (O(n)TC & O(1)SC) ·...
Trapping Rain water using naive(TC θ(n^2) & SC O(1)) , using prefixmax & suffixmax(TC O(n) & SC O(2n)) and using 2 pointer approach(TC O(n) & SC O(1)) ·...
Set Matrix Zeroes using Bruteforce (O(n*m)(n+m)TC O(1)SC), using dummy vector & set (O(n*m)TC O(n+m)SC), using optimized dummy vector(O(n*m)TC O(1)SC) ·...
Majority of Element (Freq of each > floor(nums.size()/3)) using unordered map (O(n)TC O(n)SC) and using Moore's voting Algorithm (O(n)TC O(1)SC) · class...
Number of greater elements for every array element using naive method (θ(n²)) , tree map (O(nlogn)) and upper bound method(O(nlogn)) · void...