answersLogoWhite

0

What is array in structures?

User Avatar

Anonymous

15y ago
Updated: 8/17/2019

array is used to store the ame datatypes syntex:

int array[]=new int[size];

dynamic declaration of array

insertion

array[1]=20;

2nd way:

int array[]={10,20,30};

*important:-

int array[20]={20,30,49,....}

this way is wrong in java as this is static way and in java all is done dynamically

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is an associative array?

An associative array is one of a number of array-like data structures where the indices are not limited to integers.


What do an array and a stack have in common?

Both are linear data structures.


What is a subarray and how is it defined in the context of data structures and algorithms?

A subarray is a contiguous sequence of elements within an array. In the context of data structures and algorithms, a subarray is defined as a subset of elements from an array that maintains the order of the original elements. It is commonly used in algorithms to analyze and manipulate specific parts of an array efficiently.


What is the use of matrix in data structures?

Nothing, but a two dimensional array can be used to represent a matrix.


What do you meant by array of structures?

The elements of the arrays are structures. Example: struct { int x, y, z; } cube [8]; cube[0].x = 1;


Should element in an array must be of primitive data type?

No, it can be array, structure or union as well.


What is the difference between string and char array?

3 differences.................. 1. length wise.... 2.initialization 3. null terminated length of char array is differ from string........ initialization of string is differ from char....... and string is null terminated...........


How do you get the mean median and mode in c programming?

By writing in C code the mathematical methods for finding the mean, median and mode of your data taking into account how your data is stored (eg an array; two separate arrays one with data and the other with frequencies; a two dimensional array containing both data and frequencies; an array of structures containing the data instead of arrays; a linked list of structures; etc).


What is the difference between an array of structures and an array within a structure?

The main differences between an array and a structure are: An Array is a collection of similar data items.An array is derived data type.It behave like a built in data type. An array can be increased or decreased. A structure is a collection of dissimilar data items.It is a user defined data types.It must be declared and defined.A structure element can be added if necessary.


Merge sorting program in data structures?

Merge sort is a divide-and-conquer algorithm used in data structures to sort an array or list. It works by recursively splitting the input array into two halves, sorting each half, and then merging the sorted halves back together. The process continues until the entire array is sorted. Merge sort is efficient, with a time complexity of O(n log n), making it suitable for large datasets.


Describe the advantages and disadvantages of array in data structure?

Array Pros:can access any element of an array directlycan be used to create other useful data structures (queues, stacks)light on memory usage compared to other structuresArray Cons:rigid structurecan be hard to add/remove elementscannot be dynamically resized in most languages


How many structure variables of a given type can you use in a C program?

You can use unlimited number of variables for a structure and you can also declare array of structures.