answersLogoWhite

0

Please rephrase your question. An array usually has a fixed size and I don't recall ever having to "go below its size". This implies that the missing elements are not within the range of the array.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

Do you use an array when you only have two or three items to track?

Yes. Using an array when multiple elements need to be created at a time is always a better idea than declaring multiple variables. For ex: Int i, j, k; Int[] arr; I have declared 3 int variables and another array just below it. Here since we are using only 3 variables, we can manage to use them without issues but if the number crosses 5 or even more then definitely using an array is always the best option.


How do you create a two dimentional array?

A one-dimensional array is an array where each element in the array points to a specific value of the type specified by the array (all values must be of the same type). For example, we can store integer values in an integer array, character values in a character array and strings in a string array. Multi-dimensional arrays are implemented as one-dimensional arrays where every element is itself a one-dimensional array, for as many dimensions as required. The overall size of any array (in elements) is the product of all its dimensions, thus a two-dimensional array of 4x5 elements has 20 elements in total, divided into 4 arrays of 5 elements each. However, because all the elements are allocate contiguously, any multi-dimensional array can be treated as if it were one-dimensional. Note that every element of an array must be exactly the same length, even when that element is another array. The most common type of array we use is a pointer array (an array of pointer elements). Given that a non-null pointer does not store any size information (the number of elements being referred to), we typically use null-terminated pointer arrays, where a null pointer denotes the end of the array being referred to. This makes it possible to implement "jagged" or "irregular" multi-dimensional arrays, where each dimension can be a different length. An array of variable-length strings is an example of a jagged array, such that each element points to a null-terminated character array.


What is the C plus plus program to find the sum of elements above and below the diagonal?

In order to sum the elements above and below the diagonal, the array must be perfectly square. To guarantee the array is square we'll use a class template to implement an array of N arrays of length N. The following program demonstrates the minimal implementation required to sum the elements above and below the diagonal and will work for any array type for which operator+ is defined, which includes all the built-in numeric types such as int and double. operator


What is declaration syntax of an array?

In what language? c and c++ a 5 x 5 array of Int int nMultiIntArray[5][5]; Answer: in java int array[][]=new int[5][5]; in vb dim array(5,5) as Integer


No of occurrence of element in an array?

The below is an example to find the instance of a string in a string array. You can modify this to any kind of array and also pass the array and value to be checked as parameters. public class ArrayTest { /** * @param args */ public static void main(String[] args) { String[] strArr = new String[] {"One", "Two", "Three", "Four", "One"}; String txt = "One"; int size = strArr.length; int counter = 0; for(int i = 0; i < size; i++){ String temp = (String) strArr[i]; if(temp.trim().equals(txt)){ counter++; } } System.out.println("The word '" + txt + "' occurs " + counter + " Times in the array"); } } The output of this program would be: The world 'One' occurs 2 Times in the array

Related Questions

What numbers are missing from the pattern below?

Please provide the pattern you would like me to analyze, and I'll help identify the missing numbers.


Difference between 1D array and 2D arrays?

1d array contains single row and multiple columns and 2d array contains multiple row and multiple columns. 2d array is a collection of 1d array placed one below another,while 1d array is simple a collection of elements.


What are the elements below uranium?

Below uranium in the periodic table are all the elements with atomic numbers between 1 and 91.The atomic number of uranium is 92.


How do you empty an array in PHP?

To empty an array in PHP you need to use the unset function like shown below: <?php $array = array('hello', 'hi', 'weee'); unset($array); // empty ?>


What is the missing number in the sequence shown below 3 -5 - 0-1?

The answer will depend on where in the sequence the missing number is. It is not clear whether the dash is used as a minus sign or to separate numbers in the sequence.


What is RAID in the computers?

Redundant Array of Independent Disks OR Redundant Array of Inexpensive Disks See link below


What is the hump below the water on a ship's bow?

Radar array.


The two rows of elements placed at the bottom of the periodic table represent what elements?

The two rows of elements at the bottom of the periodic table are the lanthanides and actinides. The lanthanides are elements with atomic numbers 57 to 71, while the actinides are elements with atomic numbers 89 to 103. These rows are known as the f-block elements and are placed below the main body of the periodic table to conserve space.


What is the missing number in the sequence shown below 1 2 3 5 13 21?

The sequence is 1,2,3,5,8,13,21.......8 is the missing number. This is known as a Fibonacci Sequence. The first two numbers are supplied and then further numbers in the sequence are formed from the sum of the two prior numbers. 3 = 1 + 2 5 = 2 + 3 8 = 3 + 5.....and so on.


What body part is Candy missing?

Candy is missing her left leg below the knee.


How can you mix up the order of values in a PHP array?

To shuffle an array in PHP is easy to do, all you need to use is the shuffle() function like shown below: <?php $array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); shuffle($array); // array results will be randomly shuffled ?>


Who invented piriodic table?

Dmitri Mendeleev created the first periodic table according to atomic mass in 1869. Others before Mendeleev had organized the elements according to their properties and were able to discern periodicity, although Mendeleev is generally accepted as the creator of the table.With the information he gathered about the elements, he was able to see that there were missing elements that hadn't been discovered. He could figure out the atomic masses of the missing elements by averaging the atomic masses of the elements above and below the missing one. One such element, which he called "eka-silicon" (eventually Ge) was missing, but with understanding of the patterns the periodic table made, he predicted the elements appearance, melting point, atomic mass, density, formula of oxide, and formula of chloride.Throughout the years, other scientists were able to find or create these missing elements to form the table we know today. Today's periodic table is ordered by atomic number instead of atomic mass (as Mendeleev had started). Henry Moseley was the first to order the elements by atomic number so elements would fit together in groups/families and periods better in 1913.