Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 929 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 929 Bytes

Coursera Algorithm Toolbox

The basic algorithmic techniques and ideas for computational problems arising frequently in practical applications: sorting and searching, divide and conquer, greedy algorithms, dynamic programming.

Maximum Pairwise Product

Given the array find the 2 maximum number in an array and get the product of the array

Output

JS - Max time used: 0.06/5.00, max memory used: 34283520/536870912.

Python - Max time used: 0.10/5.00, max memory used: 26763264/536870912.


Extras

To find the min and max of 2 numbers

max(a,b) => a  if a >= b else b
Python difference between / & //
Python 3, they made the / operator do a floating-point division, and added the // operator to do integer division (i.e. quotient without remainder); whereas in Python 2, the / operator was simply integer division, unless one of the operands was already a floating point number.