Article
Collection Classes - LINKED LIST
PDF
1 vue
0 téléchargement
Résumé
Linked lists
Lecture recommandée Cours alignement conventionnel Cours alignement conventionnel en PDF, plus de 30 000 cours électromécanique gratuit, exercices gratuit, rapports pfe, l... Electromécanique Lire Collection Classes - LINKED LISTThe Java 2 platform contains a Collections API
This group of classes represent various data structures that store and manage objects
It includes classes such as ArrayList and LinkedList
Abstract Data Types – A Review
An abstract data type (ADT) is :
an organized collection of information containing
a set of operations used to manage that information
The set of operations includes methods such as add, delete , find etc..
The set of operations/methods define the interface to the ADT
A List ADT, for instance would define the operations that be used with the list, such as add, delete.
We have looked an array implementation of a list, now we will look at a Linked List.
DRAWBACKS OF ARRAYS
Static vs. Dynamic Structures
A static data structure has a fixed size
ac
Arrays are static; once you define the number of elements it can hold, it doesn’t change.
The array implementation of our collection has one serious drawback:
you must know the maximum number of items in your collection when you create it.
LINKED LIST
WHAT IF YOU DON’T KNOW THE NUMBER OF ITEMS BEFOREHAND?????
WHAT IF THE NUMBER OF ITEMS WILL VARY OVER TIME?
We need a dynamic data structure that grows and shrinks as necessary
ARRAYS LIMITATIONS
Arrays
Simple, Fast
but
Must specify size at construction time
WHICH GIVES RISE TO “Murphy’s law”
Construct an array with space for n
n = twice your estimate of largest collection
Tomorrow you’ll need n+1
Informations
- Format
- Domaine
- Cours JAVA/J2EE
- Publié le
- 8 avr. 2022
- Vues
- 1
Ressources liées
Cours JAVA/J2EE
MISE EN ŒUVRE DU MODELE ET DE LA PLATEFORME
PDF
Vues :3
Téléchargements :0
22 juin 2024
Cours JAVA/J2EE
Implémentation d'UML avec Java et Design patterns
PDF
Vues :2
Téléchargements :0
Taille :50 Ko
12 févr. 2024
Commentaires (0)
Connectez-vous pour laisser un commentaire.
Soyez le premier à commenter
Partagez votre avis sur ce document — questions, retours ou votre propre expérience.