What is an Array? (Explained simply)

Published: 01 January 1970
on channel: honestduane
351
37

What is an Array? How does it work? Here is a simple answer (and more).

Note: I rail against non-zero indexed based languages here because zero is the modern standard, but even though 0 based indexes for arrays are the norm, there are some languages that don't start at zero that still have specific or rare use:

Fortran (Existed before C, only used in special cases in modern times): INTEGER, DIMENSION(1:5) :: array ! Starts at 1

Lua: (Register Based Scripting Language) myArray = {10, 20, 30} -- myArray[1] is 10

MATLAB/Octave (For data science, mostly replaced by python): array = [10, 20, 30]; % array(1) is 10

Smalltalk (A LISP): array := #(1 2 3). "array at: 1" returns 1

COBOL(Used by banks and insurance companies): 01 TABLE-NAME OCCURS 10 TIMES INDEXED BY I.

ADA (gov use): type Index is range 1 .. 10; type My_Array is array(Index) of Integer;

Another one is "R" - used for data science like MATLAB - but it is mostly replaced by Python, and the "R" example isn't allowed by YouTube due to the angled brackets needed.

Join this channel to get access to perks:
   / @honestduane  


Watch video What is an Array? (Explained simply) online without registration, duration hours minute second in high quality. This video was added by user honestduane 01 January 1970, don't forget to share it with your friends and acquaintances, it has been viewed on our site 351 once and liked it 37 people.