1

00:00:00,600  -->  00:00:06,960
Hi there they're not let's look at maps which support the softening capability just like in the case

2

00:00:06,960  -->  00:00:10,990
of collection hierarchy where you have a socket set unnavigable set.

3

00:00:11,040  -->  00:00:15,760
We also have sorted map unnavigable map within the map hierarchy.

4

00:00:16,140  -->  00:00:21,660
In this lesson we will also look at tree map which implements the navigable map and we already know

5

00:00:21,660  -->  00:00:29,010
that Chrisette in Donelly uses Prema since we are to discuss the map interface on the hash map class

6

00:00:29,250  -->  00:00:34,470
and we have also seen the trees of glass things that we discussed in this lesson should be very familiar

7

00:00:35,430  -->  00:00:40,220
in case you skipped map hash map or sort that set on preset.

8

00:00:40,350  -->  00:00:46,720
Then I would strongly suggest you take a look at them before you get started with this lesson.

9

00:00:46,920  -->  00:00:54,600
Let's begin with Sogard map Sogard map allows sorting of mappings based on peace on this sorting can

10

00:00:54,600  -->  00:01:00,600
be either druken nature or auditing of the East or due to competitor which is provided during the creation

11

00:01:00,600  -->  00:01:01,420
of map.

12

00:01:01,800  -->  00:01:08,130
When the natural ordering of East it means that keys would implement the comparable interface.

13

00:01:08,130  -->  00:01:13,590
So the compatible and competitor interfaces which were discussed in the precept lesson also apply here

14

00:01:13,850  -->  00:01:19,340
as tree search is based on tree map unhinges disordered map definition.

15

00:01:19,380  -->  00:01:25,590
It implements the map interface and we can see that the methods are very similar to the ones we saw

16

00:01:25,650  -->  00:01:27,040
in sockets.

17

00:01:27,530  -->  00:01:29,690
In short it said it was all about elements.

18

00:01:29,820  -->  00:01:35,610
But here we are dealing with these in place of subset headset or DeLaet methods.

19

00:01:35,610  -->  00:01:38,930
Here we have some Map Head map on a map.

20

00:01:39,270  -->  00:01:46,490
The parameters are keys on all three of them written a stigma which is backed by the original map.

21

00:01:46,530  -->  00:01:52,530
Also note that these methods are specific to succored map and we did not see such kinds of methods in

22

00:01:52,530  -->  00:01:53,480
Hashomer.

23

00:01:53,910  -->  00:01:59,870
That's because there is no specific ordering in Hushmail as it is based on a hash function.

24

00:02:00,510  -->  00:02:06,180
So defining a method like subtype does not make sense with Hashima but it's not a map.

25

00:02:06,210  -->  00:02:11,040
There is an ordering and hence we can get specifics about maps.

26

00:02:11,040  -->  00:02:17,900
Next we have fusty and Laski methods Vittert and the Huskey and the Laskey from the socket mapping in

27

00:02:17,910  -->  00:02:22,980
socket set the corresponding methods were simply first and last.

28

00:02:22,980  -->  00:02:27,900
Like in the case of socket set we also have a competitor method which returns a competitor if there

29

00:02:27,900  -->  00:02:28,500
is one.

30

00:02:28,890  -->  00:02:34,990
Otherwise and none is return implying that a natural ordering is just the last three minutes or collection

31

00:02:35,190  -->  00:02:41,640
methods and they were discussed when we looked at the map interface keyset method will return the set

32

00:02:41,700  -->  00:02:46,290
of all these ordered according to the sorting criteria.

33

00:02:46,290  -->  00:02:52,740
Similarly the values that were read in the collection of values in the socket map on the order of I

34

00:02:52,740  -->  00:02:56,500
use is dependent on the corresponding keys.

35

00:02:56,520  -->  00:03:03,480
Recall that this method returns a collection rather than a set as values can how duplicate is undefined

36

00:03:03,480  -->  00:03:07,390
and method returns the set of all the mappings in the socket.

37

00:03:07,850  -->  00:03:15,210
And of course there are also socket Viki's that each mapping is an instance of the entry interface which

38

00:03:15,210  -->  00:03:19,290
is a nested interface defined within the map interface.

39

00:03:19,470  -->  00:03:25,440
Finally recalled that all three of these collection methods are also backed by the original model.

40

00:03:25,920  -->  00:03:31,350
So we know that any changes made in that or return view will be reflected in the original map and vice

41

00:03:31,350  -->  00:03:32,530
versa.

42

00:03:32,870  -->  00:03:36,210
How all of the written rules are collections rather than maps.

43

00:03:36,390  -->  00:03:39,420
So things can only be if we move using them.

44

00:03:39,450  -->  00:03:44,910
So things can only be deleted using them for instance in case of the collection which is returned by

45

00:03:44,910  -->  00:03:50,520
the block use method if you remove a particular value then the corresponding mapping will be remote

46

00:03:50,520  -->  00:03:52,430
from the original map.

47

00:03:52,530  -->  00:03:59,040
But as we can see there is no way to either mapping through any of them as data collection of elements

48

00:03:59,130  -->  00:04:01,770
rather than collection of mappings.

49

00:04:01,770  -->  00:04:06,700
Even the secretary and preset method does not permit our operations.

50

00:04:06,900  -->  00:04:13,740
And if you try to add something then it will throw an unsupported operation exception next just navigable

51

00:04:13,740  -->  00:04:16,210
map which extends the slaughtered map.

52

00:04:16,530  -->  00:04:22,980
And we have seen it's analog navigable set which included navigation networks that were broke on a given

53

00:04:22,980  -->  00:04:24,640
search target.

54

00:04:25,050  -->  00:04:31,380
Unnavigable said we have seen methods like lower floor ceiling and higher.

55

00:04:31,380  -->  00:04:38,370
And here we have met that slightly lower key floor ceiling D and hierarchy all of which take a search

56

00:04:38,450  -->  00:04:45,010
target ungrouped and the closest matching t and we already know the semantics of these matters.

57

00:04:45,570  -->  00:04:51,900
Similarly we also have slight variations of these methods like the lower entry floor and ceiling entry

58

00:04:51,900  -->  00:04:58,980
on higher entry methods and all of them make a key a search target under and the closest matching entry

59

00:04:58,980  -->  00:05:00,010
.

60

00:05:00,060  -->  00:05:06,210
Next we have descending keyset method Vittert instead of the worst view of the keys in the sorted map

61

00:05:06,210  -->  00:05:07,110
.

62

00:05:07,140  -->  00:05:09,280
And it is written as unnavigable said.

63

00:05:09,790  -->  00:05:16,160
Recall that in navigable set glass there was a similar method called descending set next month there

64

00:05:16,160  -->  00:05:20,720
is descending map Richard and said a reverse view of this map.

65

00:05:21,070  -->  00:05:28,280
Next we help bald faced angry unpleasantry visually more underdone the first unlost and Drees respectively

66

00:05:28,310  -->  00:05:29,040
.

67

00:05:29,400  -->  00:05:33,010
Inapplicable said we had both the first and last.

68

00:05:33,590  -->  00:05:39,760
Finally there are also few range it's like in the case of navigable set which include a boolean parameter

69

00:05:39,880  -->  00:05:41,460
all inclusive.

70

00:05:42,050  -->  00:05:48,040
Here you have the head map method and if he pass true as argument value for the inclusion parameter

71

00:05:48,440  -->  00:05:54,710
then this method would return a head map whose D's are less than or equal to that to keep it ometer

72

00:05:55,800  -->  00:05:56,920
what other variations.

73

00:05:56,930  -->  00:06:02,290
You can take a look at the API so that supports sorted map unnavigable map.

74

00:06:02,360  -->  00:06:03,690
Let's head over to Ed..

75

00:06:03,710  -->  00:06:07,170
I do a very quick them off Prema.

76

00:06:08,720  -->  00:06:09,980
It's going to be a very quick.

77

00:06:09,980  -->  00:06:11,920
Them all as we.

78

00:06:11,990  -->  00:06:18,110
Most of the math related methods in our hash map them up and we also look at the sorting related methods

79

00:06:18,190  -->  00:06:19,690
in our trees or them.

80

00:06:19,880  -->  00:06:27,920
OK just not a tree map implements the navigable map unexposed operation such as contains the get put

81

00:06:28,060  -->  00:06:31,810
under remote that logarithmic time complexity.

82

00:06:32,000  -->  00:06:35,460
If you recall it was mentioned during our discussion on Chrisette.

83

00:06:35,750  -->  00:06:40,890
OK so it would be Lagat MacBain complexity for such kind of methods are.

84

00:06:40,890  -->  00:06:43,370
I'd Andri moment that's good.

85

00:06:43,670  -->  00:06:50,000
So here we have a new method called remap them all within the map to more class and we are just going

86

00:06:50,000  -->  00:06:51,850
to do a very quick DM all it.

87

00:06:51,880  -->  00:07:01,250
The initial code has been just copied from the hash map them omitted from here and here and we just

88

00:07:01,250  -->  00:07:03,320
have three users here.

89

00:07:03,310  -->  00:07:09,610
We are creating an instance of tree map and we are inserting 3 users John-Roger on it along with their

90

00:07:09,620  -->  00:07:12,930
ages and we are simply printing them here.

91

00:07:13,250  -->  00:07:18,380
And also we are reading through the map and we are printing the corresponding Giessen values separately

92

00:07:18,710  -->  00:07:18,970
.

93

00:07:19,160  -->  00:07:21,880
So let's just go ahead and run this.

94

00:07:21,920  -->  00:07:22,680
Here we are.

95

00:07:22,910  -->  00:07:25,650
So we added John Raj and Anita.

96

00:07:25,820  -->  00:07:32,950
But then when we print it that automatically is sorted according to the Keys in ascending order.

97

00:07:33,120  -->  00:07:40,260
OK so monetised first Dianas John and the third is Rotch OK and the same thing is happening here.

98

00:07:40,490  -->  00:07:45,380
We are reading through the entry cert we are invoking the entry sig which is returning a set of all

99

00:07:45,380  -->  00:07:46,310
the mappings.

100

00:07:46,460  -->  00:07:52,770
And we're reading through them and we are printing the main island h in each of the markings.

101

00:07:52,900  -->  00:07:58,180
OK now let's go ahead and do this.

102

00:07:58,220  -->  00:07:59,400
So here you are saying.

103

00:07:59,420  -->  00:08:05,010
If the key of the current mapping is John then we said the H 2 to be 6.

104

00:08:05,090  -->  00:08:11,290
Ok so this is just to show that the set value method can also be used in the earlier demo we did not

105

00:08:11,300  -->  00:08:12,920
use this particular method.

106

00:08:12,940  -->  00:08:16,300
Set value we only a monster to get key and get value.

107

00:08:16,310  -->  00:08:18,870
So let's go ahead and do this.

108

00:08:18,920  -->  00:08:22,150
So with this the regional map will also be changed.

109

00:08:22,190  -->  00:08:26,570
OK because the original map is backing this particular set.

110

00:08:26,820  -->  00:08:29,260
OK so let's go ahead and run this.

111

00:08:29,690  -->  00:08:35,260
And here is the origin on map and H for John has been updated ACORDA 6.

112

00:08:35,260  -->  00:08:42,260
Now one last thing is there are these methods like the floor tree lot and tree ceiling and tree and

113

00:08:42,250  -->  00:08:48,860
higher and tree all of which are done in map and we get out of it you are done an entry and the thing

114

00:08:48,860  -->  00:08:53,040
is we cannot directly involved a set value matter on them.

115

00:08:53,330  -->  00:09:01,100
And that's because those matters return an entry but the output that is generated the value that is

116

00:09:01,100  -->  00:09:04,860
produced for this is a snapshot a doc instance of.

117

00:09:05,300  -->  00:09:08,580
So that entry is not backed by the old gentleman.

118

00:09:08,770  -->  00:09:14,690
So if we cannot add any value it will throw an error and run it.

119

00:09:15,200  -->  00:09:16,810
And here it is.

120

00:09:17,150  -->  00:09:18,770
Going on it again.

121

00:09:19,520  -->  00:09:20,220
Here it is.

122

00:09:20,230  -->  00:09:23,870
So it says unsupported operation exception.

123

00:09:23,910  -->  00:09:25,200
Line 110.

124

00:09:25,850  -->  00:09:28,200
Climb on all four here.

125

00:09:28,210  -->  00:09:34,000
That's because the set volume entered cannot is not supported by the return.

126

00:09:34,120  -->  00:09:35,100
And 3 here.

127

00:09:35,170  -->  00:09:42,160
So when four and three is invoked it returns an entry on that particular instance off entry does not

128

00:09:42,160  -->  00:09:44,620
support seq value mattered and when when will it.

129

00:09:44,620  -->  00:09:50,360
It is throwing this unsupported operation exception case or the set value method does not work here

130

00:09:50,600  -->  00:09:56,070
although the circular argument that looks here when we are iterating through the entries.

131

00:09:56,620  -->  00:10:02,420
It's just that these kind of matters like the floor and the ceiling and tree and those kinds of Mathare

132

00:10:02,420  -->  00:10:05,560
Trivett should return a specific entry there.

133

00:10:05,570  -->  00:10:10,820
We cannot invoke it as they produce a snapshot at that particular instance of.

134

00:10:11,240  -->  00:10:12,080
So that's about it.

135

00:10:12,140  -->  00:10:15,680
And this new method is also available in the resources section.

136

00:10:15,910  -->  00:10:16,380
Thank you.

137

00:10:16,390  -->  00:10:17,150
Unhappy coding
