In this example, x, y, and z are variables.
The result of adding "Julia" + " " + "Julia":
Write an algorithm which receives an array of integers and prints its maximum.
Write an algorithm which receives an array of integers and prints its minimum.
Write an algorithm which receives an array of integers and prints the position of its minimum.
The lowest number is .
Write a function which returns an array of n random numbers, n being the only received parameter.
function randomArray(n) {
The main goal of pseudo code is to write down the logic behind an algorithm, so that you can easily translate it
into human speech or code.
Given the algorithm below
- with your word explain its purpose
- translate it into Python and Javascript
function in_array(element,list_elements) {
boolean exist = false
for I = 0 until length($list_elements) do {
if $element == $list_elements[I] then {
$exist = true
}
}
return $exist
}
This function has two arguments: element and list_elements. The boolean exist is defined as false. The function will look for the "element" in the array till this will be found. Once the element is found, we are receiving the answer "true". Is element is not found, the function returns "false".
Variant 1
function inArray(element, list_elements) {Variant 2
function inArray(element, list_elements) {III - sort an array
Click the button to sort the array in ascending order.