1 00:00:13,470 --> 00:00:18,750 Hello and welcome to the golden programming language course in the previous session. 2 00:00:18,780 --> 00:00:23,100 It talked about iterate over a map and indecision. 3 00:00:23,130 --> 00:00:25,920 We want to talk about the idea maths concept. 4 00:00:32,350 --> 00:00:33,820 Sold map keys. 5 00:00:34,660 --> 00:00:42,250 Keys, east lies created with store keys, value of man and then sought to slice the soul to this lie 6 00:00:42,430 --> 00:00:46,150 used to preen values of map in key order. 7 00:00:47,350 --> 00:00:53,200 Now go to this school program to illustrate how to salt a map by cheese. 8 00:00:55,440 --> 00:01:10,500 First, create the map and initialize it, for the example on Seoul to mark calling equals to map index 9 00:01:10,500 --> 00:01:13,890 type is dense and value. 10 00:01:13,890 --> 00:01:23,280 Time is a strange and initialize the value of a 30 column change 11 00:01:26,280 --> 00:01:29,610 50 Column G 12 00:01:32,670 --> 00:01:36,510 40 column Alex, 13 00:01:39,420 --> 00:01:50,430 20 Column Diego and End Element 10 column Jack. 14 00:01:55,260 --> 00:02:03,440 Create this nice for eastern indexes of map, and the length of it is equal to length of map labor. 15 00:02:05,220 --> 00:02:16,260 Now he's calling because lake function and set the time and 16 00:02:19,440 --> 00:02:25,890 links zero and capacity east land 17 00:02:28,170 --> 00:02:33,550 function on Seoul to map. 18 00:02:35,130 --> 00:02:40,500 Now go to next line and append map keys in newest slice. 19 00:02:40,980 --> 00:02:43,460 So do the following go. 20 00:02:44,040 --> 00:02:50,370 I call him equals ranch in unsorted map 21 00:02:53,760 --> 00:02:54,930 and he's 22 00:02:57,960 --> 00:02:58,680 equal. 23 00:02:59,730 --> 00:03:02,630 I pinched keys. 24 00:03:03,060 --> 00:03:10,800 I reformat the call go to the next line and now sold Islamist by the sword package. 25 00:03:11,010 --> 00:03:19,640 Because in this sample, keys are integers, so we use for information from sold, packaged to sorties 26 00:03:20,310 --> 00:03:21,130 sold. 27 00:03:21,510 --> 00:03:27,540 Hi Case got aids and said the very best. 28 00:03:27,780 --> 00:03:28,200 He's 29 00:03:30,870 --> 00:03:31,760 now E-Trade. 30 00:03:31,760 --> 00:03:45,090 This lies elements go to the next line for indexes on their school and for the example, value quality 31 00:03:45,090 --> 00:03:48,600 equals branch keys. 32 00:03:51,710 --> 00:04:08,190 And if the value comma salted Mac Index Value three, formerly called save the project and execute the 33 00:04:08,190 --> 00:04:08,790 program. 34 00:04:11,470 --> 00:04:13,360 Now we can see the output. 35 00:04:13,690 --> 00:04:19,360 We could sort the map elements based on the keys by creating a slice. 36 00:04:20,860 --> 00:04:24,340 OK, now go twist, Knight and continue. 37 00:04:29,640 --> 00:04:31,290 Sold map values. 38 00:04:32,340 --> 00:04:38,970 To sort the key values of a Mac, you need to restore them in its lines and then sort this slice. 39 00:04:39,780 --> 00:04:44,550 Now go to this school to illustrate how to solve a man by values. 40 00:04:46,410 --> 00:04:48,300 First, clear the last gold. 41 00:04:53,910 --> 00:04:57,180 Create a map and initialize it for the example. 42 00:04:57,430 --> 00:05:04,250 And so did my very best calling equals map index type is agent and value type string. 43 00:05:04,710 --> 00:05:12,450 Initialize it now create this list for Essop values of map and the length of it is equal to length of 44 00:05:12,460 --> 00:05:13,120 memory. 45 00:05:13,170 --> 00:05:20,130 The values column equals Make 46 00:05:23,160 --> 00:05:27,720 this three zero and learn. 47 00:05:31,140 --> 00:05:41,170 And so that map now append map values in numerous lines through the following fold instead of index 48 00:05:41,320 --> 00:05:50,380 said on school comma value plan equals ranch in sorted map 49 00:05:53,770 --> 00:05:54,510 values 50 00:05:57,340 --> 00:06:01,570 append values by value. 51 00:06:03,940 --> 00:06:10,630 Now, salt is sliced by the salt packets because in these sample values are strings, so be used from 52 00:06:10,630 --> 00:06:20,050 eastern expansion transport package salt dot strings and set the values. 53 00:06:22,270 --> 00:06:29,170 Now, iterate this nice elements by the following code for the value. 54 00:06:32,250 --> 00:06:41,480 Crawling equals range in values and display value. 55 00:06:46,300 --> 00:06:50,740 Reformat the clothes, save the project and execute the program. 56 00:06:52,080 --> 00:06:54,030 Now we can see the output. 57 00:06:54,090 --> 00:06:59,760 We could sort the map elements based on the values by creating a slice. 58 00:07:00,850 --> 00:07:01,270 OK. 59 00:07:01,300 --> 00:07:07,510 In order not to prolong the time of decision, we finished and we will continue the content in the next 60 00:07:07,510 --> 00:07:08,050 session. 61 00:07:08,180 --> 00:07:08,770 Goodbye.