Getting maximum elements in Julia - maximum() and maximum!() Methods Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The maximum() is an inbuilt function in julia which is used to return maximum elements in different scenario. Syntax: maximum(f, itr) or maximum(itr) or maximum(A::AbstractArray; dims) Parameters: f: Specified function.itr: Specified list of elements.A::AbstractArray: Specified array of different dimensions.dims: Specified dimensions. Returns: It returns the maximum elements in different scenario. Example: Julia # Julia program to illustrate # the use of maximum() method # Getting maximum elements in different scenarios # In the below scenario, length function # and a list of elements are used as # parameter. Here the length of string with # maximum alphabets will be returned println(maximum(length, ["GFG", "Geeks", "GeeksforGeeks"])) # In the below scenario, a list of # elements are shown and maximum elements are # returned as output println(maximum([5, 10, 15, 20])) # Getting the maximum value of an array # over the given dimensions A = [5 10; 15 20]; println(maximum(A, dims = 1)) println(maximum(A, dims = 2)) Output: The maximum!() is an inbuilt function in julia which is used to calculate the maximum value of the specified array over the specified singleton dimensions. Syntax: maximum!(r, A)Parameters: r: Specified singleton dimensions.A: Specified array. Returns: It returns the maximum value of the specified array over the specified singleton dimensions. Example: Julia # Julia program to illustrate # the use of maximum !() method # Getting the maximum value of the # specified array over the specified # singleton dimensions. A = [5 10; 15 20]; println(maximum !([1; 1], A)) println(maximum !([1 1], A)) Output: [10, 20] [15 20] Comment More infoAdvertise with us Next Article Find maximum element along with its index in Julia - findmax() Method K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads Getting minimum elements in Julia - minimum() and minimum!() Methods The minimum() is an inbuilt function in julia which is used to return minimum elements in different scenario. Syntax: minimum(f, itr) or minimum(itr) or minimum(A::AbstractArray; dims) Parameters: f: Specified function.itr: Specified list of elements.A::AbstractArray: Specified array of different d 2 min read Getting the maximum value from a list in Julia - max() Method The max() is an inbuilt function in julia which is used to return the maximum value of the parameters. Syntax: max(x, y, ...) Parameters: x: Specified 1st value. y: Specified 2nd value and so on. Returns: It returns the maximum value of the parameters. Example 1: Python # Julia program to illustrate 1 min read Getting last element of an array in Julia - last() Method The last() is an inbuilt function in julia which is used to return the last element of the specified iterable collection. Syntax: last(coll) Parameters: coll: Specified iterable collection. Returns: It returns the last element of the specified iterable collection. Example 1: Python # Julia program t 1 min read Find maximum element along with its index in Julia - findmax() Method The findmax() is an inbuilt function in julia which is used to return the maximum element of the specified collection along with its index. If there are multiple maximal elements are present in the collection, then the first one will be returned. If there is any data element is NaN, this element is 1 min read Getting first and last set of elements in Julia - front() and tail() Methods The front() is an inbuilt function in julia which is used to return a tuple consisting of all but the last component of x, where x is the specified tuple. Syntax: front(x::Tuple)::Tuple Parameters: x::Tuple: Specified tuple. Returns: It returns a tuple consisting of all but the last component of x, 2 min read Getting minimum element along with its index in Julia - findmin() Method The findmin() is an inbuilt function in julia which is used to return the minimum element of the specified collection along with its index. If there are multiple minimal elements are present in the collection, then the first one will be returned. If there is any data element is NaN, this element is 1 min read Like