Hello and welcome to the golden programming language course in the previous session.
It talked about iterate over a map and indecision.
We want to talk about the idea maths concept.
Sold map keys.
Keys, east lies created with store keys, value of man and then sought to slice the soul to this lie
used to preen values of map in key order.
Now go to this school program to illustrate how to salt a map by cheese.
First, create the map and initialize it, for the example on Seoul to mark calling equals to map index
type is dense and value.
Time is a strange and initialize the value of a 30 column change
50 Column G
40 column Alex,
20 Column Diego and End Element 10 column Jack.
Create this nice for eastern indexes of map, and the length of it is equal to length of map labor.
Now he's calling because lake function and set the time and
links zero and capacity east land
function on Seoul to map.
Now go to next line and append map keys in newest slice.
So do the following go.
I call him equals ranch in unsorted map
and he's
equal.
I pinched keys.
I reformat the call go to the next line and now sold Islamist by the sword package.
Because in this sample, keys are integers, so we use for information from sold, packaged to sorties
sold.
Hi Case got aids and said the very best.
He's
now E-Trade.
This lies elements go to the next line for indexes on their school and for the example, value quality
equals branch keys.
And if the value comma salted Mac Index Value three, formerly called save the project and execute the
program.
Now we can see the output.
We could sort the map elements based on the keys by creating a slice.
OK, now go twist, Knight and continue.
Sold map values.
To sort the key values of a Mac, you need to restore them in its lines and then sort this slice.
Now go to this school to illustrate how to solve a man by values.
First, clear the last gold.
Create a map and initialize it for the example.
And so did my very best calling equals map index type is agent and value type string.
Initialize it now create this list for Essop values of map and the length of it is equal to length of
memory.
The values column equals Make
this three zero and learn.
And so that map now append map values in numerous lines through the following fold instead of index
said on school comma value plan equals ranch in sorted map
values
append values by value.
Now, salt is sliced by the salt packets because in these sample values are strings, so be used from
eastern expansion transport package salt dot strings and set the values.
Now, iterate this nice elements by the following code for the value.
Crawling equals range in values and display value.
Reformat the clothes, save the project and execute the program.
Now we can see the output.
We could sort the map elements based on the values by creating a slice.
OK.
In order not to prolong the time of decision, we finished and we will continue the content in the next
session.
Goodbye.