0

First off I want to say these are three separate questions on a study guide of mine.

  • "What are the differences between the array and linked implementations of the list ADT".
  • "What are the differences between the array and linked implementations of the stack ADT".
  • "What are the differences between the array and linked implementations of the queue ADT".

I thought that they all have the same differences which is based on the two memory allocation schemes I will explain below.

I know that arrays use an contiguous memory allocation where it is all in one contiguous block of memory. For the linked version it uses multiple non-contiguous memory blocks. I understand the pros and cons to both contiguous and non-contiguous memory allocation so I am not looking for an explanation on that. I have been searching through both my notes and java book for more differences between them.

I am curious if there is more differences between an array and a linked implementation for stack, list, and queue ADT or if it is only based on the contiguous and non contiguous memory allocations.

Batiaev
  • 1,173
  • 1
  • 14
  • 30
Drizzy
  • 105
  • 1
  • 1
  • 10
  • Please use your favorite search tool and look for "difference between arraylist and linkedlist". This question has been asked and answered thousands of times on the web. – Jim Garrison May 03 '16 at 06:12
  • @JimGarrison I have and read through chapters in my book. I havnt found any other answers thats why I am asking here. My question is if there are any other differences between the two depending on if they are implemented using a stack, list, or queue. So if there is more differences besides the CMA and non CMA or is that the only difference. – Drizzy May 03 '16 at 06:19
  • 1
    @Drizzy refer to http://stackoverflow.com/questions/10224888/java-are-1-d-arrays-always-contiguous-in-memory: Java arrays are not guaranteed to be contiguous in memory. – Andy Turner May 03 '16 at 06:21
  • @AndyTurner Thank you for actually providing some information. That is interesting as my professor has not said this. – Drizzy May 03 '16 at 06:25

0 Answers0