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 have

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

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 LinearNode(T elem) { next = null; element = elem; } public LinearNode getNext() { return next; } public void set Next (LinearNode node) { next = node; } public T getElement() { return element; } public void setElement(T elem) { element = elem; } } If you needed to store 25 names of students, and wanted to access them quickly, would arrays or linked lists be better? Explain

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!