carlisle had to put the spices in an array on the spice rack before he closed it.
4 answers
Array is a class name, hence ought to be a value type.
1 answer
1>an array is a static data structure.after declaring an array it is impossible to change its size.thus sometime memory spaces are misused.
2>each element of array are of same data type as well as same size.we can not work with elements of different data type.
3>in an array the task of insertion and deletion is not easy because the elements are stored in contiguous memory location.
4>array is a static data structure thus the number of elements can be stored in it are somehow fixed.
5 answers
An array always stores the values in its different shells. Whenever the shell position or number or address is mentioned it means the address of the required value is mentioned. then the value of the mentioned address is fetched. So, array is a reference type in c language.
1 answer
d integers
1 answer
a pointer is a variable that contains memory location of another variable.the value u assign to the pointers are memory address of other variable.
1 answer
the priority queue is which depends on the data stored.in which their priority is maintained by checking the forth coming values stored in the queue
1 answer
No. Arrays can be defined at runtime, just as they can in C. It's just that it's generally more convenient to use vectors instead of dynamic arrays at runtime, thus arrays are generally used statically, at compile time.
1 answer
A single dimensional array is an array of items. A two-dimensional array is an array of arrays of items.
1 answer
An irregular dimensional array is a special type of multi-dimensional array.
First we must understand that a multi-dimensional array is just an array of arrays. Each element in the array is, itself, an array of elements.
A regular multi-dimensional array will be an array of size n, with each element containing a separate array of size m. That is, each sub-array has the same size.
An irregular multi-dimensional array will be a multi-dimensional array in which each sub-array does not contain the same number of elements.
Regular array:
array[0] = new array{0, 1, 2}
array[1] = new array{3, 4, 5}
array[2] = new array{6, 7, 8}
array[3] = new array{9, 10, 11}
This regular array is an array of size 4 in which each sub-array is of size 3.
Irregular array:
array[0] = new array{0, 1, 2}
array[1] = new array{3, 4}
array[2] = new array{5, 6, 7}
array[3] = new array{8, 9, 10, 11}
This irregular array is an array of size 4 in which the size of each sub-array is not the same.
1 answer
Option 1) Use a temporary variable:
int x = array[i];
array[i] = array[i+1];
array[i+1] = x;
Option 2) Use bit operators:
array[i] ^= array[i+1] ^= array[i];
1 answer
An array literal is a comma-separated list of the elements of an array. An array literal can be used for initializing the elements of an array.
1 answer
[]temp = array[1]
array[2]=array[1]
array[1]=[]temp
1 answer
By design; it makes the compiler's work easier.
1-based array's addressing-function:
Address (array, index) = Address (array) + (index-1)*Elemsize(array)
0-based array's addressing-function:
Address (array, index) = Address (array) + index*Elemsize (array)
1 answer
there r 2 types of array in cad - rectangular array and polar array...........
1 answer
You cannot delete from an array.
1 answer
sparse array is one which has contents lower than its maximum size, that is the array has free or empty locations....
2 answers
Basically,
&array[i];
That is, the memory location for an array object with index i.
Or, you can do:
(array + i);
2 answers
'a array' is substandard, if you use it, you might be frowned upon.
1 answer
public static int[] reverseArray(int[] array) {
int i = 0, j = array.length - 1;
for (i = 0; i < array.length / 2; i++, j--) {
int temp = array[i];
array[i] = array[j];
array[j] = temp;
}
return array;
}
1 answer
To double the size of an array efficiently, you can create a new array with double the capacity, copy the elements from the original array to the new array, and then update the reference to the original array to point to the new array. This process ensures that the array is resized without having to individually resize each element.
1 answer
C-style arrays can be used as data members, both as fixed-size arrays or as dynamic arrays. The following examples demonstrate how they could be used as one-dimensional data members.
class a {
private:
int b[10] {0}; // in-class initialisation (all elements zero).
public:
int& operator[] (unsigned index) {
if (index>=10) throw std::range_error();
return b[index]; }
};
class c {
public:
c (unsigned sz=10): size(sz), p (size?new int[size]:nullptr) {
memset (p, 0, size); }
c (const s& _s): size(_s.size), p (size?new int[size]:nullptr) {
if (size) memcpy (p, _s.p, size); }
c (s&& _s): size(_s.size), p (_s.p) { _s.p=nullptr; } // swap resources
c& operator= (const s& _s) {
if (p) delete [] p;
size = _s.size;
p = (size?new int[size]:nullptr);
if (size) memcpy (p, _s.p, size); }
c& operator= (s&& _s) {
size = _s.size;
p = _s.p;
_s.p=nullptr; } // swap resources
~c() { if (p) delete [] p; }
int& operator[] (unsigned index) {
if (index>=size) throw std::range_error();
return p[index]; }
private:
unsigned size {0};
int* p {nullptr};
};
A much simpler approach would be to use std::array<int> and std::vector<int> instead of primitive C-style arrays.
1 answer
An array is an aggregate of data elements of the same type. Arrays are allocated in contiguous memory. An element of an array can be another array type, also known as a multi-dimensional array.
1 answer
broad side array very important array in this attenna communication
1 answer
An array controller is a controller of any array of equivalent hardware components.
1 answer
A square array is an array in which the number of rows is the same as the number of columns.
1 answer
array
array_diff
(
array
$array1
,
array
$array2
[,
array
$...
] )
1 answer
void *array[2];
printf ("array[%d]=%p\n", i, array[i]);
1 answer
Object array is called universal array because it can store multiple variables of the same type
1 answer
A string in C is stored in a 1 dimension array so an array of strings is simply a two dimension array.
1 answer
A numericial array is an array with keys made up of only integers. An associative array is an array with keys made up of anything that is not an integer. In some languages, it is possible to mix integer keys and non-integer keys into a mixed array.
1 answer
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
?>
1 answer
void bubblesort (int* array, int size) {
if (!array size<2) return;
int last_swap = size;
while (last_swap>0) {
int n=last_swap;
for (int i=1; i<last_swap; ++i) {
if (array[i]<array[i-1]) {
array[i]^=array[i-1]^=array[i]^=array[i-1];
n=i;
}
last_swap = n;
}
}
1 answer
A multiplication array is for example 30<10times9<2times5times3times3 and2times3 times3times5 that what is an array
1 answer
Numeric array has numbers(+integers) that represent the values
Associative array has strings that represent the values
1 answer
I guess you wanted to ask, why is it scanf ("%s", array)and not scanf ("%s", &array).
Well, array is by definition a pointer to the first element: array = &array[0]
1 answer
You cannot add elements to a fixed array in C or C++.
If, however, the array is declared as a pointer to an array, you can add elements by allocating a new array, copying/adding elements as needed, reassigning the new array to the pointer, and deallocating the original array.
1 answer
A Jagged array is an array of arrays.
You can initialize a jagged array as −
int[][] scores = new int[2][]{new int[]{92,93,94},new int[]{85,66,87,88}};Where, scores is an array of two arrays of integers - scores[0] is an array of 3 integers and scores[1] is an array of 4 integers.
1 answer
An array is a 2-dimensional rectangle with length and width. An array also has area and perimeter.
1 answer
Array is not a struct. Array only has one datatype, struct has arbitrary different datatypes.
1 answer
A square array has the same number of columns and rows
the array [1] is a square array (a trivial example)
the array
[1 0]
[0 1]
is a square array
the array
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]
is a square array
the array
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
is not a square array
1 answer