High there is little wonder Lodo. 2
And welcome back. 3
Let's not known about collections framework which is part of the job that you do package which encrypted 4
utility classes that mainly represent sophisticated data structures. 5
That is true. 6
It also has other kinds of classes like the big class but many of the classes represent data structures 7
. 8
So these are ready to use highly efficient data structures which we can use right out of the box without 9
having to implement them ourselves. 10
Notice goneness collection's framework as the data that supports basically whole collection of elements 11
. 12
So let's go ahead and get started with the chapter. 13
So for me a little bit only one data structure visuals and audio on below that are of different dimensions 14
or is very powerful and it's a most fundamental data structure in any programming language but it is 15
very difficult to build software using just andare as we generally how more requirements that are it 16
cannot fulfill. 17
For example here are some limitations so far this first one is that nobody can hold any fixed number 18
of values. 19
And we also know that an hour is not automatically extendable. 20
That is if you want to add elements beyond the array size then it is simply not possible to do that 21
. 22
Adam Insearch is expensive. 23
It is linear in terms of complexity on here are different kinds of requirements which we normally need 24
other kinds of data structures for fulfilling those requirements. 25
What I meant is that sometimes we do not how any knowledge about the number of elements that we are 26
going to deal with. 27
And so we need to be able to create data structures without specifying that data structure size. 28
Sometimes we want that data structure to be automatically extendable when it reaches its maximum size 29
which we know is not possible within. 30
Sometimes like in the case of Inari be fast random access but of course with some other benefits on 31
a fast random access. 32
What we mean is for the UN index we should be able to extract the element of the index in a constant 33
time. 34
In some cases we want fast lookups. 35
That is elementary search should be extremely fast like constant time and a requirement would be to 36
preserve the order in which elements are added. 37
That has been retrieved the elements. 38
We get them back in the same order in which they were inserted and sometimes we just don't get a book 39
in social order. 40
Sometimes we want a data structure that can hold duplicate elements and sometimes we want a data structure 41
that holds only unique elements. 42
We may also want a data structure that can hold null values and sometimes we dont want the data structure 43
to hold any null values. 44
That is it should throw an exception if we try to add a null value. 45
Sometimes you want the elements to be automatically sorted. 46
And finally we sometimes want a data structure to hold key value pairs which would allow us to extract 47
a value based on a given key. 48
This would be supported by a hash table implementation. 49
So collections framework includes different kinds of data structures that would meet one or more of 50
these requirements collection's framework includes several interfaces lots of different classes which 51
implement those interfaces and also a few classes that provide genetic algorithms like searching and 52
sorting off different data structures. 53
Unhidden according to physicists and the collections framework. 54
So these are interfaces are not process and as you can see there are two distinct areas here. 55
One of them has a physical collection as a root interface and the other has a map of the route into 56
this collection would represent a collection of objects. 57
Right. 58
Motard represent a collection of key value pairs on these end of business of different implementations 59
. 60
So since this interfaces allow us to define common protocol we do get the benefit of polymorphism which 61
would allow us to manipulate collections independently of implementations. 62
And here are some of the most commonly used implementations here for the list interface. 63
We how our list on linked list in addition to a list link list also implements BQ interface which is 64
open to us Dick which is a sub interface off queue for such interface. 65
We How has said create or link has it on for cubie how did Dick unlink list for map how hash map tree 66
map are linked hash map. 67
Note that the class names are quite similar for both set as well as MAP implementations. 68
And that's because set implementations internally use map implementations and you can also see that 69
there are two interfaces socket set on soldered up on as the names implied then should that the data 70
store is automatically socket. 71
So as you insert elements into them dig it automatically sorted and are placed at the appropriate positions 72
. 73
So we will be discussing all of these interfaces and implementations in this chapter along with that 74
complexity analysis really for us just because the collection interfaces Un-Dead implementations. 75
After that we will discuss Marchman defense and their implementations. 76
Finally we were discussing two classes quite recent collections that include genetic algorithms. 77
Next song being on searching. 78
Note that all of these implementations are Serializable they implement the clone method on most of them 79
. 80
Also I'm maturing not to use Hollywood. 81
Not all the implementations are synchronized which means that none of their methods are synchronized 82
. 83
That is these methods do not have the synchronized keyword in their declaration so they can be accessed 84
by multiple threads at the same time. 85
For example if we consider an instance of a then the method of this instance can be accessed by more 86
than one thread at the same time. 87
So we are talking about a single or oldest object and one method which can be accessed by multiple threads 88
at the same time. 89
Now if we do not want more than one third to access these methods at the same time then we can still 90
provides synchronization and it can be done externally undone. 91
We will discuss in multithreading chapter 1. 92
Note that there are these three implementations. 93
Vector hash table on stack. 94
These are legacy implementations which are synchronized. 95
The Odeo implementations were not synchronized. 96
However it is recommended to not use them any more as synchronization slows things down and it can always 97
be added externally instead of vector. 98
It is recommended to use an idealist and in place of has table. 99
It is recommended to use Hashima and an other deck is recommended to be used in an office doc. 100
So that's about it. 101
As we saw collections framework includes two distinct inheritance trees on pro-rights highly sophisticated 102
data structures that can be used for Dola being powerful applications. 103
So let's go ahead and get an in-depth understanding of collections from