Find the largest element in an array of numbers

Series: Common Algorithms with Ruby and JavaScript

One of the most common algorithms we usually have to deal with is:

Given an array of negative/positive integers, how to find the largest element in that array, without using max() for Ruby or Math.max() for JavaScript.

Continue reading “Find the largest element in an array of numbers”

Advertisements