What is the difference between an array and a list?

Hi, I need to know what is the difference between an array and a list

1 Like

Varies for programming languages.
https://www.google.com/search?q=array+vs+list&oq=array+vs+list

1 Like

It’s probably worth looking up for the specific programming language you are interested in.

While lists and arrays have universal basic concepts, how you interact with them and their limitations differ depending on their implementation.

For a more general view on Computer Science concepts I highly recommend the Base CS blog series and podcast.

https://www.codenewbie.org/basecs

As others said, depends on the particular implementation.
But generally speaking,

  • A C-like array is implemented as a consecutive memory space. If one int takes 4 bits, and you have an array of 4 ints starting from memory address 0, your array will end at memory address 16. It means you can access any element in constant time, by doing address calculation math.

  • A linked list is a sequence of objects that hold some data and a pointer to the next element of the list, therefore, these objects are not necessarily in sequence in memory. It means that you cannot access arbitrary elements in constant time - you would have to follow the pointers until you find the element you are looking for.

2 Likes

That really depends on if it’s a homework assignment, but this is a list.

17 Jan Hi, i need to know is there difference between sets and groups in tableau
15 jan Hi, I need to know what is the difference between an array and a list
13 jan Hi, what is the latest version of tableau desktop
11 jan Hi, I need to know what is type conversion in python
9 jan Hi, I am looking for what is thr difference between live connection and an extract
8 jan Hi,i want to know how is python an interpreted language
2 jan Hi, how can we know that our python is properly installed or not
24 dec Hi, i want to know how memory managed in python
replied: 5 jan Hi Thanks for explanation helpful
31 dec Hi, i need to know how do we testing in tableau
22 dec Hi, I want to know the process of compilation and linking in python
20 dec i want to know job tracker in hadoop

Surprised it has taken this long. I can also see how the language of stackoverflow would never work for jhon either though.

@richards12 no offense meant, do tell us more about yourself, what you do and where you are. Sometimes, “correct” answers without context are not the valuable thing.

3 Likes