Question

you have learned about linked lists and about the Java Collection Interface. What is a linked...

you have learned about linked lists and about the Java Collection Interface. What is a linked list? Why might we use them? What is the purpose of the Java Collection Interface? Your initial post should be at least 200 to 300 words.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Linked List :

Linked lists are linear data structures that hold data in individual objects called nodes. These nodes hold both the data and a reference to the next node in the list.

Linked lists are often used because of their efficient insertion and deletion. They can be used to implement stacks, queues, and other abstract data types.

Example : Head 320 10 360 3 400 9 null 320 360 400

Uses :

1. Image viewer – Previous and next images are linked, hence can be accessed by next and previous button.

2. Previous and next page in web browser – We can access previous and next url searched in web browser by pressing back and next button since, they are linked as linked list.

3. Music Player – Songs in music player are linked to previous and next song. you can play songs either from starting or ending of the list.

4. Time sharing problem - used by the scheduler during the scheduling of the processes in the Operating system.

5. Train coaches are connected with the next and the previous ones.

6. Browser cache which allows to use BACK button.

Purpose of Java Collection Interface :

Collections are like containers that group multiple items in a single unit. For example, a jar of chocolates, list of names, etc.

Collections are used in every programming language and when Java arrived, it also came with few Collection classes – Vector, Stack, Hashtable, Array.

Java 1.2 provided Collections Framework that is the architecture to represent and manipulate Collections in java in a standard way.

- When input size is dynamic.

                        • When data grows and shrinks frequently.

- Collection framework is nothing but the data structure in Java. So we can use its functionality instead of writing too much code.

- The framework had to be high-performance. The implementations for the fundamental collections (dynamic arrays, linked lists, trees, and hashtables) are highly efficient.

- The framework had to allow different types of collections to work in a similar manner and with a high degree of interoperability.

           • Whenever you are required to store heterogeneous data.

           • Extending and/or adapting a collection had to be easy.

Benefits :

Java Collections framework have following benefits:

Reduced Development Effort – It comes with almost all common types of collections and useful methods to iterate and manipulate the data. So we can concentrate more on business logic rather than designing our collection APIs.

Increased Quality – Using core collection classes that are well tested increases our program quality rather than using any home developed data structure.

Reusability and Interoperability

Reduce effort – to learn any new API if we use core collection API classes.

Add a comment
Know the answer?
Add Answer to:
you have learned about linked lists and about the Java Collection Interface. What is a linked...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must...

    Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must you be careful about the order in which you change the references? b) What code would be needed to change the references in a linked list when moving up one node? c) Why did we have a previous reference in our linked list implementation? d) Write a class for a linked list node with just one constructor that allows the initialization of all instance...

  • Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must...

    Data Structures and Algorithms (Java Programming) a) When devising an algorithm for linked lists, why must you be careful about the order in which you change the references? b) What code would be needed to change the references in a linked list when moving up one node? c) Why did we have a previous reference in our linked list implementation? d) Write a class for a linked list node with just one constructor that allows the initialization of all instance...

  • Interfaces 1. What is inside an interface definition? What does a class do to an interface...

    Interfaces 1. What is inside an interface definition? What does a class do to an interface and what keyword is involved? How does a class do this to an interface (what should we find in the class)? Can an interface have a generic parameter? How do you instantiate an interface as an object? What methods can’t you use on an interface type? Abstract Data Types 2. What does an ADT define? Does an ADT specify programming language and/or data structures...

  • Generic Linked Lists ( Program should be written in Java language). Modify the linked list class...

    Generic Linked Lists ( Program should be written in Java language). Modify the linked list class presented in this chapter so it works with generic types. Add the following methods drawn from the java.util.List interface: -void clear(): remove all elements from the list. -E get(int index): return the element at position index in the list. -E set(int index, E element): replace the element at the specified position with the specified element and return the previous element. Test your generic linked...

  • C# code Arrays and Linked Lists: Write C++/Java/C#/Python code to declare an array of linked lists...

    C# code Arrays and Linked Lists: Write C++/Java/C#/Python code to declare an array of linked lists of any primitive type you want. (Array of size 2020) (This could be based on MSDN libraries or the lab) – you do not need to instantiate any of the linked lists to contain any actual values. Paste your code for that here (this should only be one line) Based on your code or the lab from 4 or your doubly linked list from...

  • Explore a bit about JAVA on-line. What are some of the major applications written in Java....

    Explore a bit about JAVA on-line. What are some of the major applications written in Java. Also, what are some of the libraries used by Java. Post between 200 and 300 words. Use your own words - DO NOT merely copy something off the Internet or off of another student's paper.

  • Linked Lists: Suppose you have a doubly linked list with both head and tail pointers, that...

    Linked Lists: Suppose you have a doubly linked list with both head and tail pointers, that stores integers. Implement a non-recursive function that takes a linked list, searches for an integer, and removes the node with the first occurrence of that integer and also removes the node directly after it regardless of value . This function will return to address of the resulting list. You ca n assume that there will be at least three nodes, and if there is...

  • Recursion and Doubly Linked Lists Problem #1: Assume you have a doubly linked list of single...

    Recursion and Doubly Linked Lists Problem #1: Assume you have a doubly linked list of single characters. Plan the algorithm to insert character 'a' immediately before each character 'b' that is encountered. 3. What is the simple case: (what case does not require a loop?) How do we get to the next a smaller sub-problem? What information is needed for the function call: 4. If we insert ‘a, PRIOR to the recursive call, what do we need to be careful...

  • In this module, you’ve learned a lot about monopolies and how they impact prices. In many...

    In this module, you’ve learned a lot about monopolies and how they impact prices. In many industries, such as construction and home repairs, prices are set individually for each customer, rather than according to a posted price list. In your initial post to this discussion, address the following prompt based on what you’ve learned in this module: Explain why such firms might be able to engage in price discrimination. If you were hiring such a firm, what should you do...

  • CSBP 319 Data structures - Linked Lists - USE JAVA (NetBeans) A company would like to...

    CSBP 319 Data structures - Linked Lists - USE JAVA (NetBeans) A company would like to implement its inventory of computing machines as a linked list, called ComputerList. Write a Computer node class, called ComputerNode, to hold the following information about a Computer: • code (as a String) • brand (as a String) • model (as a String) • price (as double) • quantity (as int) ComputerNode should have constructors and methods (getters, setters, and toString()) to manage the above...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT