Question: One fundamental choice in algorithm (or ADT) design is whether to use arrays or linked lists to store information. Both of these data types

One fundamental choice in algorithm (or ADT) design is whether to use 

One fundamental choice in algorithm (or ADT) design is whether to use arrays or linked lists to store information. Both of these data types have advantages, and disadvantages, and choosing the appropriate one can make the different between constant and linear time operations. For reference, a standard implementation for the nodes of a singly linked list is given below: public class LinearNode { private LinearNode next; private T element; public Linear Node (T elem) { next = null; element = elem; } } public Linear Node getNext () { return next; } public void set Next (Linear Node node) { next = node; } public T getElement () { return element; } public void set Element (T elem) { element elem; } 1. If you needed to store 25 names of students, and wanted to access them quickly, would arrays or linked lists be better? Explain. [2 points]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

When it comes to storing 25 names of students and wanting to access them quickly arrays would be a b... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!