What is the difference between an ARRAY and a LIST?

1 Answer

Answer :

Answer1
Array is collection of homogeneous elements.
List is collection of heterogeneous elements.  
For Array memory allocated is static and continuous.
For List memory allocated is dynamic and Random.  
Array: User need not have to keep in track of next memory allocation. List: User has to keep in Track of next location where memory is allocated.  
Answer2
Array uses direct access of stored members, list uses sequencial access for members.
//With Array you have direct access to memory position 5
Object x = a[5]; // x takes directly a reference to 5th element of array
//With the list you have to cross all previous nodes in order to get the 5th node: list mylist;
list::iterator it;
for( it = list.begin() ; it != list.end() ; it++ )
{
if( i==5)
{
x = *it;
break;
}
i++;
}

Related questions

Description : A system wherein items are added from one and removed from the other end. a) Stack b) Queue c) Linked List d) Array

Last Answer : Answer: b Explanation: In a queue, the items are inserted from the rear end and deleted from the front end

Description : Python : Append to Numpy array Vs append to list -Web-Development

Last Answer : answer:

Description : Python: How to get the indices of several elements in a list or numpy array at once? -Web-Development

Last Answer : answer:

Description : Python : how to find the frequency(count) of each element of a list or array? -Web-Development

Last Answer : answer:

Description : Python : How to find the indices of elements in a sublist in a list or numpy array -Web-Development

Last Answer : answer:

Description : How to compare two array list when one array list always fluctuate rows?

Last Answer : I am creating one array list and attempting to equals to another array list, the reader through CSV file. CSV row is not in the same order, changing everything when downloading. I tried ... from row number, everything is the same .For more Information Subscribe to our page - softwaretestingboard

Description : List out the differences between Array and ArrayList in C#?

Last Answer : Array stores the values or elements of the same data type but ArrayList stores values of different data types. Arrays will use the fixed length but ArrayList does not use fixed length like an array.

Description : What type of data is: a=[(1,1),(2,4),(3,9)]? a) Array of tuples b) List of tuples c) Tuples of lists d) Invalid type

Last Answer : b) List of tuples

Description : Define array. List its type.

Last Answer : Array is a fixed-size sequential collection of elements of the same type. Types: 1. One dimensional 2. Multi dimensional

Description : Define array. List its types. 

Last Answer : An array is a homogeneous data type where it can hold only objects of one data type. Types of Array:  1)One-Dimensional 2)Two-Dimensional 

Description : What is an array processor ?

Last Answer : An array processor is a processor that can process multiple data through the same command.

Description : UNIVAC was a first generation computer. What is its full form? A) Universal Automatic Computer B) Universal Array Computer C) Unique Automatic Computer D) Unvalued Automatic Computer

Last Answer : Answer : A

Description : Which of the following is correct acronym of VGA? A) Video Graphics Array B) Visual Graphics Array C) Volatile Graphics Array D) Video Graphics Adapter

Last Answer : Answer : A

Description : WAN is a most used abbreviation in Networking, what is its full form? A) WAP Area Network B) Wide Area Network C) Wide Array of Network D) Wireless Access Network

Last Answer : Answer : B

Description : VGA is A) Video Graphics Array B) Visual Graphics Array C) Volatile Graphics Array D) Video Graphics Adapter

Last Answer : Answer : A

Description : ALU is A) Arithmetic Logic Unit B) Array Logic Unit C) Application Logic Unit D) None of above

Last Answer : Answer : A

Description : WAN stands for A) Wap Area Network B) Wide Area Network C) Wide Array Net D) Wireless Area Network

Last Answer : Answer : B

Description : The full form of ALU is A) Arithmetic Logic Unit B) Array Logic Unit C) Application Logic Unit D) None of above

Last Answer : Answer : A

Description : UNIVAC is A) Universal Automatic Computer B) Universal Array Computer C) Unique Automatic Computer D) Unvalued Automatic Computer

Last Answer : Answer : A

Description : UNIVAC is A) Universal Automatic Computer B) Universal Array Computer C) Unique Automatic Computer D) Unvalued Automatic Computer

Last Answer : Answer : A

Description : Another name for 1-D arrays. a) Linear arrays b) Lists c) Horizontal array d) Vertical array

Last Answer : Answer: a Explanation: Linear arrays are the 1-Dimensional arrays wherein only one row is present and the items are inserted

Description : RAID stands for __________ a) Redundant array of independent disks b) Redundant array of individual disks c) Reusable Array of independent disks d) Reusable array of individual disks

Last Answer : Answer: a Explanation: RAID is a multiple-disk database design which is viewed as a single logical disk by the operating system. Data are distributed across the physical drives of the array. It guarantees the recovery of data in case of data failure

Description : What does SVGA stands for? a) Standard Visual Graphics Array b) Super Visual Graphics Array c) Standard Video Graphics Array d) Super Video Graphics Array

Last Answer : Answer: d Explanation: Super Video Graphics Array is a type of Visual Display Unit. It supports 1024 by 768 pixels with 60,000 different colors

Description : In which of the following terminals the screen is regarded as an array of pixels, where each pixel is either on or off: a) Character Map Terminal b) Bit Map Terminal c) RS 232 C Terminal d) None of The Above

Last Answer : b) Bit Map Terminal

Description : Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

Last Answer : Mergesort always makes recursive calls to sort subarrays that are about half size of the original array, resulting in O(n log n) time.

Description : Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

Last Answer : quicksort ((data + 222), 100)

Description : The technology used in the electronic printer is called (1) Micro array (2) Micro millimetric (3) Micro technology (4) Micro encapsulation

Last Answer : Micro encapsulation

Description : Identify the LIFO (Last In First Out) structure among the following: (1) Stack (2) Queue (3) De-queue (4) Array

Last Answer : Stack

Description : PDA stands for (1) Personal Digital Assistant (2) Personal Development Agency (3) Personal Data Authority (4) Personal Data Array

Last Answer : Personal Digital Assistant

Description : What is the difference between array data structure and raw data structure?

Last Answer : Data typing is static, but weakly enforced

Description : What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?

Last Answer : The first one performs a deep copy of the array, the second one is shallow. 

Description : What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?

Last Answer : The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a ... create a new instance of each element's object, resulting in a different, yet identacle object.

Description : Define what is the difference between Array and LinkedList?

Last Answer : The array is a simple sequence of numbers which are not concerned about each other’s positions. they are independent of each other’s positions. adding, removing or modifying any array element is very easy. Compared to arrays, a linked list is a complicated sequence of numbers.

Description : Define what is the difference between Array and ArrayList?

Last Answer : An array is a collection of the same type. The size of the array is fixed in its declaration. A linked list is similar to an array but it doesn’t have a limited size.

Description : State difference between array and string. 

Last Answer : Array String Array can be of any type like int, float, char.   String can contain only characters. Element Elements in an array can be accessed using its position like a[2]. ... . Array size once declared cannot be changed   String size can be modified using pointer.  

Description : Solids may be considered to be either crystalline noncrystalline. The basic difference between them is that a crystal, in contrast to a noncrystal: w) has a sharp melting point x) has an irregular array of atoms y) exhibits double refraction z) has a completely regular atomic or molecular structure

Last Answer : ANSWER: Z -- HAS A COMPLETELY REGULAR ATOMIC OR MOLECULAR STRUCTURE