xava-dev / algorithm-highest-product

Algorithm that returns the highest product between three numbers of a given array of integers. I have developed two approaches which take time and space complexity into account.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Algorithm Highest / Max Product

Algorithm that returns the highest product between three numbers of a given array of integers.

I have developed two approaches which take time and space complexity into account.

Approach 1

  • Time Complexity: O(n)
  • Space Complexity: O(n)

Approach 2

  • Time Complexity: O(n + k)
  • Space Complexity: O(k)

About

Algorithm that returns the highest product between three numbers of a given array of integers. I have developed two approaches which take time and space complexity into account.


Languages

Language:JavaScript 100.0%