Q: Write a function that takes a list of integers and returns the 4 highest in O(n) time.
A: Here, I use the merge sort algorithm since it uses O(n) space complexity and O(log(n)) runtime complexity.
- Fork the repository.
- Create a local clone of the fork by copying the clone URL:
- URL
- Note: these instructions are for using HTTPS
- Open Terminal.
- Navigate to the directory where you'd like to clone down the repo.
- Type
git clone
, and then paste the URL. - Press Enter. Your local clone will be created.
cd
into themerge-sort
project directory.- Type
node index.js
to run the file.