Hi there Ali we are done with this very long chapter. 2
They look at some very sophisticated data structures that collections framework has to offer the framework 3
concepts of class hierarchies. 4
One of them is the collection hierarchy while the other is the mop hierarchy. 5
So we discussed tons of data structures and after looking at so many of them it could be very confusing 6
on when to use them are not a plan extent. 7
Overwhelming too. 8
So somebody let's focus only on the best parts of all the data structures that we studied. 9
That is we will look at in what situations those data structures can be used. 10
Right. 11
That's the most important thing to understand. 12
We should clearly understand when to use them. 13
We started off with a collection interface and within the collection hierarchy we began with modalist 14
list implementations. 15
We said that let's come into play one sequence or positioning matters. 16
So many of them a third big an index value as a barometer. 17
We've also looked at our list which probably is the most commonly used data structure. 18
It is basically a resizable implementation of an interface as it is based on an array. 19
It allows faster random access to constant time complexity that is given an index number. 20
You confessed the element and constant time appending elements are removing the last element also needs 21
only constant time. 22
Next we get a linked list which is a doubly linked list implementation of block list as well as a deck 23
interface so it can be used as a list undef need it as their dictu. 24
Hello Art Deco. 25
It is recommended the use of a deck and you can use a linked list. 26
If there would be frequent I normal operations during iteration. 27
OK so that's when you would want to use a linked list. 28
Next we look at Kure interface and we also looked at the sub interface deck on these interfaces come 29
into play when fast head or tail manipulations Macker and we know that link list is one off their implementations 30
. 31
We looked at other Dec which is an odd implementation of a deck interface. 32
All this keep in mind that the last name indicates the implementation how it is implemented. 33
It is recommended to use an already installed on a linked list when it comes to Dec implementation underexpose 34
fitful only for operations in constant time and even a linked list also has similar time complexity 35
. 36
But Java docs recommend using an added Deck as it is likely to be faster than a linked list than linked 37
list is used as a queue. 38
In fact according to one benchmark for large queues Arabic was found to be three times faster than English 39
blessed. 40
That's because with linked list we have to create an addition and not object with every newly added 41
element. 42
When actually get set interface which comes into play when uniqueness and fast lookups Magner we also 43
duplicate some interfaces. 44
Socket set unnavigable SEC the monkshood implementations. 45
The first look that has set which is a hash table implementation of a set interface. 46
We have seen the search is extremely fast when it comes to search insertion and deletion and they are 47
supported in content. 48
We also hope that an effective dollar item with sis always or we're right Hoshko matter when you all 49
were right. 50
Eclipse method. 51
Next we'll have that link has set which Exton sun has set Hassid does not Pezzo insertion order due 52
to its use of hash function self-preserving insertion order is a requirement then you need to use Menkhaus 53
it as it has a doubly linked list or running through its entries. 54
It is almost as fast as a set as it extends the Hosack nonfinite other elements will be sorted. 55
Then we can use a reset. 56
Recall the Cresset. 57
Is it a red black tree beside implementation of unnavigable second duffus unresearched is also pretty 58
fast on its supports. 59
I remove n contains operations Vitt that got indeed lower the mic complexity. 60
Next we look at the map interface which is the root of the map hierarchy and we looked at these three 61
implementations hash map linked hash map on Prema the corresponding set implementations are also shown 62
here just to highlight the fact that they in dentally use map implementations and we don't have to discuss 63
the benefits of these map implementations as they are same as their set counterparts only notable addition 64
is that linked hash map can also be used as an LRU cache. 65
Probably this was not discussed. 66
We know that linked Hachette extensor Hasek back has set actually extends the abstract class abstract 67
set. 68
Similarly trees it also extends the same class abstract set. 69
And as expected the designers also kept things consistent for the map implementations so both hash map 70
on Crea map extend the abstract class card abstract map but abstract set an abstract map are skeletal 71
implementations of set and map interfaces as actively abstract set. 72
Also expense abstract collection which is a skeleton implementation of the collection interface which 73
is the root interface. 74
Finally we also Lubet couple of algorithm classes and they are static utility classes just one was Arrius 75
and it is used to manipulate plain address. 76
We looked at several of its methods that we can see here. 77
Like as list saut binary search NFU few others as this is probably the most commonly used method here 78
undertakes Inari on iterate and set fixed size list. 79
Since it is fixed size vs we cannot go from our normal operations on the return list. 80
However we can perform the set operation as Abbasid on strict. 81
So it is as list method. 82
And in case you're wondering about how to convert an array into a set then one approach is to simply 83
invoke the Hassett constructor which takes a collection of input and passed the list returned by this 84
as list method. 85
So there is no set method so you have to use this kind of an alternate deal. 86
Another option is to use. 87
I don't limit it from that Collections class adheres to Collections class which is used to manipulate 88
the data structures that we have seen in this chapter. 89
This class also includes methods like salt and binary search. 90
However note that it does not help bottleful soc which was present in the race class. 91
It was not included due to performance reasons as performing a battle of saut on an array is very efficient 92
but performance would be poor when used with a list. 93
OK and finally we looked at this particular item item 43 which says that if your method returns a collection 94
or Inari and if the method does not how any did aggro return then it should return an empty collection 95
on an empty ID but not and not of value. 96
And we are told very briefly mention about this other simple item which is optimized judiciously. 97
It tells us not to optimize prematurely and focus more on writing good programs that use good design 98
principles. 99
Good programs will allow us to optimize later if needed. 100
So that's about it. 101
I think that somebody colour's the best properties of each of the data structures that we have seen 102
in this chapter. 103
So memorize them and keep reviewing them in their resources section. 104
I'm including a document that is taken from a site called big ole Chichi dot com and it includes algo 105
to commit complexities of many other data structures too including the ones which we have seen in this 106
chapter. 107
So that's all your friends. 108
So that's about it. 109
And I hope you enjoyed learning about collection's framework. 110
Thank you and good bye for now.