How to resolve the algorithm Greatest element of a list step by step in the Bracmat programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Greatest element of a list step by step in the Bracmat programming language

Table of Contents

Problem Statement

Create a function that returns the maximum value in a provided set of values, where the number of values may not be known until run-time.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Greatest element of a list step by step in the Bracmat programming language

Source code in the bracmat programming language

  ( biggest
  =   max
    .   !arg:
      |   !arg:%?max ?arg
        & !arg:? (%@:>!max:?max) (?&~)
      | !max
  )
& out$("1:" biggest$(5 100000 -5 aap 3446 NOOT mies 0))
& out$("2:" biggest$)
&   out
  $ ( "3:"
        biggest
      $ (5 100000 -5 43756243978569758/13 3365864921428443 87512487957139516/27 3446)
    )


  

You may also check:How to resolve the algorithm Integer comparison step by step in the Ada programming language
You may also check:How to resolve the algorithm Array concatenation step by step in the NewLISP programming language
You may also check:How to resolve the algorithm Exponentiation operator step by step in the Lambdatalk programming language
You may also check:How to resolve the algorithm Sorting algorithms/Merge sort step by step in the FreeBASIC programming language
You may also check:How to resolve the algorithm Happy numbers step by step in the ACL2 programming language