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