1 00:00:06,570 --> 00:00:08,010 - In the previous section, 2 00:00:08,010 --> 00:00:10,890 we saw how to use vector or vec, 3 00:00:10,890 --> 00:00:13,770 which is one of the standard collection classes, 4 00:00:13,770 --> 00:00:16,710 I should say, structures in Rust. 5 00:00:16,710 --> 00:00:18,330 It turns out there were actually quite a lot 6 00:00:18,330 --> 00:00:19,410 of other structures, 7 00:00:19,410 --> 00:00:21,330 other collection structures you can use 8 00:00:21,330 --> 00:00:25,110 in Rust in the std::collections module. 9 00:00:25,110 --> 00:00:27,660 This one isn't imported by default, 10 00:00:27,660 --> 00:00:31,140 so you'd have to import that into your application 11 00:00:31,140 --> 00:00:32,580 when you first want to use them. 12 00:00:32,580 --> 00:00:35,700 So, for example, in the std::collections module, 13 00:00:35,700 --> 00:00:40,140 we have HashMap, which is a dictionary, key value pairs, 14 00:00:40,140 --> 00:00:44,730 and it uses hashing some kind of mathematical calculation. 15 00:00:44,730 --> 00:00:47,790 When you insert an item, it takes the key, 16 00:00:47,790 --> 00:00:48,623 performs some kind 17 00:00:48,623 --> 00:00:51,750 of mathematical hash algorithm on that key 18 00:00:51,750 --> 00:00:53,880 and that will determine where the item 19 00:00:53,880 --> 00:00:57,150 gets stored within HashMaps memory like a bucket. 20 00:00:57,150 --> 00:00:59,340 And then, when you retrieve the item by key 21 00:00:59,340 --> 00:01:02,520 it can use the hash algorithm to find it quickly. 22 00:01:02,520 --> 00:01:04,410 So, HashMap uses hashing 23 00:01:04,410 --> 00:01:07,410 to find keys quickly in a key value pair. 24 00:01:07,410 --> 00:01:10,710 And then, we have a BTreeMap, which is a binary tree. 25 00:01:10,710 --> 00:01:13,650 So, items organized into a binary tree. 26 00:01:13,650 --> 00:01:17,580 We have each node has an element on the left 27 00:01:17,580 --> 00:01:19,290 and an element on the right, 28 00:01:19,290 --> 00:01:23,910 and when you insert an item into a Btree, 29 00:01:23,910 --> 00:01:25,710 it'll choose where to insert it, 30 00:01:25,710 --> 00:01:27,270 so they can then find it again quickly 31 00:01:27,270 --> 00:01:30,480 using like a binary chop, a binary tree algorithm. 32 00:01:30,480 --> 00:01:32,763 So, we have a HashMap and a binary tree. 33 00:01:32,763 --> 00:01:34,990 Both of which contain key value pairs. 34 00:01:34,990 --> 00:01:39,060 And then, we also have a HashSet and a BTreeSet. 35 00:01:39,060 --> 00:01:41,850 So, a set basically is a unique collection. 36 00:01:41,850 --> 00:01:44,040 If you try to insert the same item twice, 37 00:01:44,040 --> 00:01:45,900 it only stores it once. 38 00:01:45,900 --> 00:01:49,770 And a HashSet uses hashing to find items. 39 00:01:49,770 --> 00:01:52,890 And a BTreeSet obviously uses a binary tree arrangement 40 00:01:52,890 --> 00:01:55,710 to find items quickly, and it doesn't allow duplicates. 41 00:01:55,710 --> 00:01:58,980 So, there are lots of other collection classes 42 00:01:58,980 --> 00:02:00,990 available in the Rust library. 43 00:02:00,990 --> 00:02:02,670 We are gonna have a look at HashMap, 44 00:02:02,670 --> 00:02:05,850 because it's probably the most useful one in practice. 45 00:02:05,850 --> 00:02:09,090 So, HashMap is a dictionary of key value pairs. 46 00:02:09,090 --> 00:02:12,330 Each entry, each row is a key value pair. 47 00:02:12,330 --> 00:02:15,330 The key is usually a simple type like a string, 48 00:02:15,330 --> 00:02:17,700 something you can look up quickly on integer 49 00:02:17,700 --> 00:02:20,430 and the value might be a complete object. 50 00:02:20,430 --> 00:02:24,180 So, for example, a HashMap of employees in a company, 51 00:02:24,180 --> 00:02:26,779 the key might be the employee code 52 00:02:26,779 --> 00:02:29,670 and the value would be the employee object. 53 00:02:29,670 --> 00:02:30,990 You look at the code, 54 00:02:30,990 --> 00:02:33,040 you get back the value for that employee. 55 00:02:34,140 --> 00:02:35,640 So, we got two different ways 56 00:02:35,640 --> 00:02:38,850 to create a HashMap object, two different syntaxes. 57 00:02:38,850 --> 00:02:40,290 In the first syntax here, 58 00:02:40,290 --> 00:02:43,770 I've declared m as a multiple HashMap, 59 00:02:43,770 --> 00:02:48,030 where the key is a string and the value is a integer. 60 00:02:48,030 --> 00:02:50,523 And I've created an empty HashMap here. 61 00:02:51,360 --> 00:02:54,420 In the second case, I've put the type information 62 00:02:54,420 --> 00:02:57,450 on the right-hand side instead of on the left-hand side. 63 00:02:57,450 --> 00:03:02,450 So, m is a multiple HashMap of string i32. 64 00:03:03,390 --> 00:03:04,740 So, one way or the other, 65 00:03:04,740 --> 00:03:06,630 it needs to know the key type 66 00:03:06,630 --> 00:03:08,490 and the value type in the HashMap, 67 00:03:08,490 --> 00:03:10,620 the key type and the value type. 68 00:03:10,620 --> 00:03:12,330 Either of those syntaxes would work. 69 00:03:12,330 --> 00:03:14,730 And by the way, there's no equivalent 70 00:03:14,730 --> 00:03:17,940 to the vec macro that we saw that earlier. 71 00:03:17,940 --> 00:03:20,520 The vec macro can create a vector 72 00:03:20,520 --> 00:03:24,810 and populate it immediately using straightforward syntax. 73 00:03:24,810 --> 00:03:27,270 There is no equivalent for HashMap. 74 00:03:27,270 --> 00:03:30,041 You literally have to create an empty HashMap first, 75 00:03:30,041 --> 00:03:32,452 and then add items to it later. 76 00:03:32,452 --> 00:03:35,160 So, to add an item to a HashMap, 77 00:03:35,160 --> 00:03:36,480 you can call the insert function. 78 00:03:36,480 --> 00:03:38,358 Give it the key and the value. 79 00:03:38,358 --> 00:03:42,300 If the key doesn't exist, then it gets inserted. 80 00:03:42,300 --> 00:03:45,423 If the key does exist, then the value gets overwritten. 81 00:03:46,320 --> 00:03:48,420 So, this really is more like an upsert. 82 00:03:48,420 --> 00:03:52,740 It'll update the key in the value if the key already exists. 83 00:03:52,740 --> 00:03:53,850 It'll insert the key 84 00:03:53,850 --> 00:03:56,523 in the value if it doesn't already exist. 85 00:03:57,390 --> 00:04:00,090 If you want to guard against overwrite an item 86 00:04:00,090 --> 00:04:02,970 that is already there, only insert it 87 00:04:02,970 --> 00:04:04,581 if it isn't already there, 88 00:04:04,581 --> 00:04:06,870 then you can use this approach instead. 89 00:04:06,870 --> 00:04:10,013 A little bit more lengthy. You take your HashMap. 90 00:04:10,013 --> 00:04:13,464 The HashMap structure has an entry function, 91 00:04:13,464 --> 00:04:17,310 which is like it's an enum, actually. 92 00:04:17,310 --> 00:04:19,227 It gives it back an entry enum. 93 00:04:19,227 --> 00:04:24,030 And that entry enum tells you whether the key exists or not. 94 00:04:24,030 --> 00:04:28,200 And that if it doesn't exist, then it'll insert this value. 95 00:04:28,200 --> 00:04:32,227 So, if you want to explain it in simple terms. 96 00:04:35,130 --> 00:04:36,360 Get the entry 97 00:04:36,360 --> 00:04:39,240 and if the entry doesn't exist, then insert this value, 98 00:04:39,240 --> 00:04:42,090 but only if the entry doesn't already exist. 99 00:04:42,090 --> 00:04:44,880 If it does exist, it doesn't get overwritten. 100 00:04:44,880 --> 00:04:46,530 So, that's quite useful actually. 101 00:04:47,520 --> 00:04:51,060 To get a value for a key, you can use square brackets. 102 00:04:51,060 --> 00:04:53,550 You take your HashMap and you use square brackets. 103 00:04:53,550 --> 00:04:55,950 You give it the key and hopefully you'll get back the value, 104 00:04:55,950 --> 00:04:57,963 the actual value, like an integer 32. 105 00:04:59,250 --> 00:05:03,210 That will perform a check. 106 00:05:03,210 --> 00:05:06,660 And if the key is missing, then your program crashes. 107 00:05:06,660 --> 00:05:09,330 It panics, key not found. 108 00:05:09,330 --> 00:05:11,940 It's like an exception. Your program terminates. 109 00:05:11,940 --> 00:05:13,311 So, that's not great. 110 00:05:13,311 --> 00:05:15,450 If you want the more forgiven lookup 111 00:05:15,450 --> 00:05:17,970 where it's allowed not to be there, 112 00:05:17,970 --> 00:05:19,740 then you can use the get function instead. 113 00:05:19,740 --> 00:05:21,600 This will look up the key safely. 114 00:05:21,600 --> 00:05:23,940 And as you would probably expect by now, 115 00:05:23,940 --> 00:05:26,310 when you call the get function, give it the key, 116 00:05:26,310 --> 00:05:27,681 it returns an option, 117 00:05:27,681 --> 00:05:29,820 which may contain the value 118 00:05:29,820 --> 00:05:32,452 for the key if it exists or none. 119 00:05:32,452 --> 00:05:34,230 So, you then take this option 120 00:05:34,230 --> 00:05:37,530 and you'd use a match statement to see where you stand. 121 00:05:37,530 --> 00:05:39,600 You can say this option that was returned 122 00:05:39,600 --> 00:05:42,510 when I looked at the key, does it contain some value? 123 00:05:42,510 --> 00:05:44,860 What is the value for that key? In other words. 124 00:05:45,750 --> 00:05:46,620 And it'll give you the value 125 00:05:46,620 --> 00:05:48,243 that corresponded to the key. 126 00:05:49,500 --> 00:05:52,710 Otherwise, if the key was missing, 127 00:05:52,710 --> 00:05:55,950 if there's an invalid key, then you get back none. 128 00:05:55,950 --> 00:05:57,000 And that tells you 129 00:05:57,000 --> 00:05:59,253 there is no such key, no such value either. 130 00:06:00,870 --> 00:06:01,703 Right. 131 00:06:01,703 --> 00:06:03,330 You can iterate over items 132 00:06:03,330 --> 00:06:06,960 in a HashMap using this kind of syntax, quite familiar. 133 00:06:06,960 --> 00:06:10,050 On each iteration, you'll get back an entry 134 00:06:10,050 --> 00:06:12,060 and the entry gives you the key 135 00:06:12,060 --> 00:06:13,803 and the value for the current row. 136 00:06:15,045 --> 00:06:17,219 Notice again, the ampersand 137 00:06:17,219 --> 00:06:21,600 when we use the for loop over HashMap, 138 00:06:21,600 --> 00:06:23,670 as with a vector actually, 139 00:06:23,670 --> 00:06:27,030 the ampersand indicates borrowing. 140 00:06:27,030 --> 00:06:31,020 It means that we're referring to the items as we iterate. 141 00:06:31,020 --> 00:06:33,723 We're not destroying the items as we iterate. 142 00:06:35,134 --> 00:06:37,347 If you accidentally forgot the ampersand, 143 00:06:37,347 --> 00:06:40,320 then the map would be drained as you iterate. 144 00:06:40,320 --> 00:06:43,260 The items would actually be removed from the collection, 145 00:06:43,260 --> 00:06:44,760 which isn't what you want at all. 146 00:06:44,760 --> 00:06:45,720 Probably not anyway. 147 00:06:45,720 --> 00:06:47,670 So, remember the ampersand there. 148 00:06:47,670 --> 00:06:49,350 You're basically taking a reference to 149 00:06:49,350 --> 00:06:53,040 or borrowing the map without actually destroying it. 150 00:06:53,040 --> 00:06:56,463 So, it's a non-destructive iteration. Very important. 151 00:06:57,510 --> 00:06:58,343 Right. 152 00:06:58,343 --> 00:07:02,640 So, the HashMap structure implements the debug interface. 153 00:07:02,640 --> 00:07:05,940 So, we can use debug output like this, 154 00:07:05,940 --> 00:07:07,770 which is actually very useful. 155 00:07:07,770 --> 00:07:09,420 You can take a HashMap 156 00:07:09,420 --> 00:07:11,070 and you can run it through debug format 157 00:07:11,070 --> 00:07:12,480 and it'll print all the items, 158 00:07:12,480 --> 00:07:14,310 the key value pairs for each item, 159 00:07:14,310 --> 00:07:16,980 for each entry in the HashMap. 160 00:07:16,980 --> 00:07:18,690 Okay. So, I think it's time for an example. 161 00:07:18,690 --> 00:07:19,890 Let's go back to our project. 162 00:07:19,890 --> 00:07:22,140 Lesson five, compounds collections. 163 00:07:22,140 --> 00:07:25,380 This is the last example we're gonna look at in this lesson. 164 00:07:25,380 --> 00:07:26,493 Demo maps. 165 00:07:27,480 --> 00:07:29,782 Right. So, here's our code. 166 00:07:29,782 --> 00:07:32,460 Notice that I've introduced 167 00:07:32,460 --> 00:07:35,536 the HashMap structure into scope. 168 00:07:35,536 --> 00:07:40,104 If I didn't do this, it's not automatically in scope. 169 00:07:40,104 --> 00:07:42,960 So, in the absence of that use statement, 170 00:07:42,960 --> 00:07:46,443 in my code, whenever I refer to HashMap, 171 00:07:47,310 --> 00:07:52,310 instead, I'd have had to have said std::, 172 00:07:52,650 --> 00:07:57,453 excuse me, std::collections::HashMap. 173 00:07:59,010 --> 00:08:01,470 That's gonna get quite tiresome quite quickly. 174 00:08:01,470 --> 00:08:03,510 So, let's just bring it into scope 175 00:08:03,510 --> 00:08:04,500 in the top of our program. 176 00:08:04,500 --> 00:08:07,350 That means we can now use the HashMap name directly, 177 00:08:07,350 --> 00:08:08,433 which is much better. 178 00:08:09,720 --> 00:08:11,040 Right. So, there's the code. 179 00:08:11,040 --> 00:08:13,350 Let me run it, so you can actually see the output, 180 00:08:13,350 --> 00:08:14,500 and then we'll discuss. 181 00:08:15,661 --> 00:08:16,530 (keys clacking) 182 00:08:16,530 --> 00:08:17,523 Cargo run. 183 00:08:20,910 --> 00:08:22,140 I've made the same mistake as before. 184 00:08:22,140 --> 00:08:23,310 I can't believe this. 185 00:08:23,310 --> 00:08:25,533 I forgot to actually run the function. 186 00:08:26,760 --> 00:08:29,193 So, let's do that. Does help. 187 00:08:30,510 --> 00:08:31,923 Let's run that again. 188 00:08:34,950 --> 00:08:36,810 Right. So, let's see then. 189 00:08:36,810 --> 00:08:39,360 So, using maps, here we are. 190 00:08:39,360 --> 00:08:40,470 Good. 191 00:08:40,470 --> 00:08:45,470 So, I've created a multiple HashMap using that syntax. 192 00:08:45,840 --> 00:08:47,700 The key is a string. 193 00:08:47,700 --> 00:08:50,640 So, it's gonna be a country code in this example. 194 00:08:50,640 --> 00:08:54,363 The value will be the telephone code for that country. 195 00:08:55,380 --> 00:08:57,210 So, I can either use that syntax 196 00:08:57,210 --> 00:08:59,670 to create my HashMap of string and init, 197 00:08:59,670 --> 00:09:01,637 or I could use this syntax 198 00:09:01,637 --> 00:09:04,230 to create my HashMap of string and init. 199 00:09:04,230 --> 00:09:08,670 I'm not gonna use m2 in my demo, hence, the underscore. 200 00:09:08,670 --> 00:09:11,520 To avoid getting warnings about unused variables. 201 00:09:11,520 --> 00:09:14,130 m is going to be what I'm gonna use. 202 00:09:14,130 --> 00:09:16,770 So, I insert a new string. 203 00:09:16,770 --> 00:09:18,150 I'm gonna explain later on, 204 00:09:18,150 --> 00:09:20,430 I am gonna discuss what this actually means. 205 00:09:20,430 --> 00:09:22,740 String::from. 206 00:09:22,740 --> 00:09:27,740 Technically, that's how you create a string object in Rust. 207 00:09:28,320 --> 00:09:29,640 So, that's what you need to do. 208 00:09:29,640 --> 00:09:32,220 I'll talk about why later on. 209 00:09:32,220 --> 00:09:33,690 So, that's basically the UK. 210 00:09:33,690 --> 00:09:36,413 The telephone code for the UK is 44. 211 00:09:36,413 --> 00:09:38,400 The telephone code for Norway, 212 00:09:38,400 --> 00:09:41,490 I do a lot of work in Norway, 47. 213 00:09:41,490 --> 00:09:45,393 And Singapore. The telephone code for Singapore is 65. 214 00:09:46,860 --> 00:09:51,860 And here, insert only if not present already 215 00:09:51,870 --> 00:09:54,000 a key, South Africa. 216 00:09:54,000 --> 00:09:57,660 And the international dialing code for South Africa is 27. 217 00:09:57,660 --> 00:10:00,990 So, if SA was already present, 218 00:10:00,990 --> 00:10:03,005 then this statement would have no effect. 219 00:10:03,005 --> 00:10:07,259 It only inserts if the key isn't already there, 220 00:10:07,259 --> 00:10:08,940 which it isn't at the moment. 221 00:10:08,940 --> 00:10:11,730 So, that will actually do the insertion. 222 00:10:11,730 --> 00:10:15,540 Look up a key, look up the UK, you'll get back the value. 223 00:10:15,540 --> 00:10:18,000 It looks up UK, it is there. 224 00:10:18,000 --> 00:10:20,823 Good. And it'll gimme back the value 44. 225 00:10:22,161 --> 00:10:25,590 And that's the value printed here. Very good. 226 00:10:25,590 --> 00:10:27,660 And then, obviously, what I call the get function, 227 00:10:27,660 --> 00:10:31,076 that's gonna gimme back some value, 228 00:10:31,076 --> 00:10:34,410 because UK is present in my HashMap 229 00:10:34,410 --> 00:10:37,083 and the value again is going to be 44, 230 00:10:37,980 --> 00:10:39,600 like so. 231 00:10:39,600 --> 00:10:41,840 And then, to iterate over the items 232 00:10:41,840 --> 00:10:43,350 in HashMap, remembering again, 233 00:10:43,350 --> 00:10:45,900 the importance of the borrowing syntax. 234 00:10:45,900 --> 00:10:48,150 All will be revealed later. 235 00:10:48,150 --> 00:10:49,320 It'll output. 236 00:10:49,320 --> 00:10:50,670 When you output an entry, 237 00:10:50,670 --> 00:10:52,110 the entry structure, 238 00:10:52,110 --> 00:10:55,197 I feel like it also implements debug formatting. 239 00:10:55,197 --> 00:10:58,410 So, you can just output an entry in one go. 240 00:10:58,410 --> 00:11:01,290 And each entry displays itself like this, 241 00:11:01,290 --> 00:11:03,030 the key and the value. 242 00:11:03,030 --> 00:11:05,040 When you iterate over a HashMap, 243 00:11:05,040 --> 00:11:08,910 the order in which you get items back isn't predictable. 244 00:11:08,910 --> 00:11:10,530 It's not a sequential collection 245 00:11:10,530 --> 00:11:14,095 where with a vector, when you insert at the beginning, 246 00:11:14,095 --> 00:11:16,500 you get it back at the beginning. 247 00:11:16,500 --> 00:11:19,950 But with a HashMap, it uses hashing 248 00:11:19,950 --> 00:11:22,740 to determine the sequence inside the HashMap. 249 00:11:22,740 --> 00:11:24,630 You can never really predict the order 250 00:11:24,630 --> 00:11:26,670 you're gonna get back items when you iterate. 251 00:11:26,670 --> 00:11:29,400 You don't care either. You don't really care. 252 00:11:29,400 --> 00:11:31,140 What you really care about is you can look up a key 253 00:11:31,140 --> 00:11:32,490 and get back the value. 254 00:11:32,490 --> 00:11:34,110 When you iterate over HashMap, 255 00:11:34,110 --> 00:11:36,780 who knows the order in which the items are gonna come back. 256 00:11:36,780 --> 00:11:38,550 It depends on the hashing algorithm. 257 00:11:38,550 --> 00:11:40,710 So, I gap up all the keys and values, 258 00:11:40,710 --> 00:11:42,390 but not necessarily in the order 259 00:11:42,390 --> 00:11:44,992 that I would've expected maybe. 260 00:11:44,992 --> 00:11:49,110 Okay, finally then, output the whole HashMap in one go. 261 00:11:49,110 --> 00:11:53,130 So, the HashMap will output Norway, 47. 262 00:11:53,130 --> 00:11:58,027 South Africa, 27, Singapore, 65, UK, 44. 263 00:12:00,030 --> 00:12:01,980 So, it uses that kind of syntax. 264 00:12:01,980 --> 00:12:05,310 That syntax looks reminiscent of a... 265 00:12:05,310 --> 00:12:09,450 Or an object in JSON or a dictionary in Python 266 00:12:09,450 --> 00:12:11,493 and I don't think that's accidental. 267 00:12:12,600 --> 00:12:14,580 Okay, one last thing. 268 00:12:14,580 --> 00:12:16,663 What if I look up a key 269 00:12:16,663 --> 00:12:19,920 that's actually not present in my HashMap? 270 00:12:19,920 --> 00:12:21,573 If I look up the key for, 271 00:12:23,130 --> 00:12:25,023 let's say Switzerland, CH, 272 00:12:26,310 --> 00:12:30,340 Switzerland isn't listed in my HashMap, so 273 00:12:31,470 --> 00:12:35,943 well this get will be okay, it'll just say no value. 274 00:12:37,050 --> 00:12:38,050 Let's just try that. 275 00:12:40,740 --> 00:12:43,650 So, it gives me a no value output there. 276 00:12:43,650 --> 00:12:44,490 I mean, that's the whole point 277 00:12:44,490 --> 00:12:45,690 of returning the option, isn't it? 278 00:12:45,690 --> 00:12:47,520 That it can fail gracefully. 279 00:12:47,520 --> 00:12:49,950 But if I use the square brackets 280 00:12:49,950 --> 00:12:54,120 and I give it an invalid key, at this point, it'll panic. 281 00:12:54,120 --> 00:12:55,920 In other words, it'll raise an error 282 00:12:55,920 --> 00:12:58,290 and terminate on line 131. 283 00:12:58,290 --> 00:13:00,330 (keys clacking) 284 00:13:00,330 --> 00:13:01,770 Okay, so let's have a look. 285 00:13:01,770 --> 00:13:04,200 Oh, yes, I did envisage this come in. 286 00:13:04,200 --> 00:13:06,120 My main thread has panicked, 287 00:13:06,120 --> 00:13:07,620 crashed, in other words. 288 00:13:07,620 --> 00:13:12,620 No entry found for key, and it was on line 131. 289 00:13:12,960 --> 00:13:15,483 So, I'd go back in here and I'd fix it. 290 00:13:16,856 --> 00:13:18,690 NO for Norway. 291 00:13:18,690 --> 00:13:20,490 Let's run it again. 292 00:13:20,490 --> 00:13:21,480 And this time, 293 00:13:21,480 --> 00:13:25,863 it'll give me the international dialing code for Norway, 47. 294 00:13:26,760 --> 00:13:27,630 Good. Fantastic. 295 00:13:27,630 --> 00:13:29,580 So, that concludes the lesson. 296 00:13:29,580 --> 00:13:32,940 We've seen how to use arrays and tuples. 297 00:13:32,940 --> 00:13:36,240 An array is a fixed size homogeneous collection. 298 00:13:36,240 --> 00:13:39,120 A tuple is a fixed size heterogeneous collection 299 00:13:39,120 --> 00:13:40,860 with different types of elements. 300 00:13:40,860 --> 00:13:43,740 A vector is like a resizeable array. 301 00:13:43,740 --> 00:13:45,600 And a HashMap is like a dictionary 302 00:13:45,600 --> 00:13:48,450 where you can look up keys and get the values back. 303 00:13:48,450 --> 00:13:50,520 Okay, there are other collection classes as well. 304 00:13:50,520 --> 00:13:54,210 Have a look at the std::collections module 305 00:13:54,210 --> 00:13:57,243 for a list of all the available structures.