1 00:00:05,260 --> 00:00:08,820 In this video, we'll learn more about the stl deque container. 2 00:00:10,120 --> 00:00:13,919 In order to use the deque, we must pound include the deque header file. 3 00:00:15,030 --> 00:00:17,490 The deque acts like a double-ended queue. 4 00:00:18,469 --> 00:00:21,670 The deque size is dynamic, and it's handled by the stl so 5 00:00:21,670 --> 00:00:23,250 that's very much like a vector. 6 00:00:23,620 --> 00:00:26,490 But unlike a vector, the elements in the deque are not 7 00:00:26,490 --> 00:00:28,170 stored in contiguous memory. 8 00:00:29,410 --> 00:00:32,619 The deque allows direct element access using the subscript 9 00:00:32,619 --> 00:00:34,419 operator and the .at method. 10 00:00:35,239 --> 00:00:38,410 But unlike a vector that allows efficient insertion and deletion 11 00:00:38,430 --> 00:00:42,470 only at the back, the deque allows efficient insertion and deletion 12 00:00:42,470 --> 00:00:44,180 at the back and at the front. 13 00:00:44,830 --> 00:00:48,370 However, inserting elements into any other part of the deque other than the 14 00:00:48,370 --> 00:00:50,319 front or back is not as efficient. 15 00:00:51,380 --> 00:00:54,080 The deque supports all of the iterators and the iterators may 16 00:00:54,080 --> 00:00:57,990 become invalid again especially when the deque changes size. 17 00:00:58,360 --> 00:01:01,090 Let's first look at a few ways to initialize deques and then we'll 18 00:01:01,090 --> 00:01:02,610 see some of its member methods. 19 00:01:04,780 --> 00:01:08,000 In the first example in this slide, I declared d as a deque of integers 20 00:01:08,460 --> 00:01:10,920 and initialized it to 1 2 3 4 and 5. 21 00:01:11,570 --> 00:01:14,710 In the second example, I declare d1 as a deque of integers. 22 00:01:15,240 --> 00:01:18,109 And I'm using an overloaded constructor to create 10 integers 23 00:01:18,139 --> 00:01:19,690 and initialize them all to 100. 24 00:01:20,970 --> 00:01:23,720 Of course, like all the stl containers, the deque supports 25 00:01:23,720 --> 00:01:27,050 copy and move semantics for initialization and assignment. 26 00:01:28,330 --> 00:01:31,429 In the third example, I'm declaring stooges as a deque of 27 00:01:31,430 --> 00:01:36,250 std strings, and I'm initializing it to Larry Moe and Curly. 28 00:01:36,460 --> 00:01:38,729 Now notice that Moe is a c-style string. 29 00:01:39,870 --> 00:01:43,580 Like vectors and std arrays, deques also support assignment 30 00:01:43,580 --> 00:01:45,019 via initializer list. 31 00:01:45,660 --> 00:01:48,740 So let's see some common methods provided by the deque container. 32 00:01:50,280 --> 00:01:53,089 In this slide, we'll see what a simple deque looks like. 33 00:01:53,990 --> 00:01:57,910 We declare d as a deque of integers, and we initialize it to 1 2 3. 34 00:01:58,460 --> 00:02:00,570 The deque has a front and a back. 35 00:02:00,840 --> 00:02:04,479 The front in this case is the element 1 and the back is element 3. 36 00:02:05,770 --> 00:02:09,160 With the deque, we can efficiently add elements and remove elements 37 00:02:09,160 --> 00:02:10,940 from both the front and the back. 38 00:02:13,230 --> 00:02:16,730 In a deque, the push back method works very much as it does in a vector. 39 00:02:17,080 --> 00:02:19,939 The element to be added is pushed at the back of the deque. 40 00:02:21,109 --> 00:02:24,309 And the push front method adds the element to be inserted 41 00:02:24,309 --> 00:02:25,470 at the front of the deque. 42 00:02:26,310 --> 00:02:29,530 Now let's see how the elements in the deque might be stored in memory. 43 00:02:31,270 --> 00:02:34,560 Remember, the deque's elements are not in contiguous memory. 44 00:02:35,259 --> 00:02:39,719 So usually a deque is implemented as a collection of memory blocks, and 45 00:02:39,719 --> 00:02:43,110 these memory blocks contain elements that are in a contiguous memory. 46 00:02:43,480 --> 00:02:45,950 But the blocks themselves are not in contiguous memory. 47 00:02:46,220 --> 00:02:49,780 So a good way to think of a deque is as a linked list of vectors. 48 00:02:50,370 --> 00:02:54,280 So when we add an element at the front, it adds it if there's space. 49 00:02:54,370 --> 00:02:57,640 If not, it will allocate a new block, add the element to that 50 00:02:57,640 --> 00:02:59,149 block and then link in the block. 51 00:03:00,090 --> 00:03:02,400 The same happens when we add an element at the back. 52 00:03:04,530 --> 00:03:09,470 Again, please refer to the c++ stl documentation for details on 53 00:03:09,540 --> 00:03:11,109 all of the methods for the deque. 54 00:03:11,370 --> 00:03:13,650 There's a lot there, and that's the place to go to. 55 00:03:14,040 --> 00:03:15,759 The documentation is your friend. 56 00:03:16,170 --> 00:03:19,360 Don't think programmers keep all these details in our heads, we don't. 57 00:03:19,560 --> 00:03:22,390 We refer to the c++ docs very often. 58 00:03:23,000 --> 00:03:25,150 Generally, it's open on a second monitor. 59 00:03:25,300 --> 00:03:27,080 It's the same for java programmers. 60 00:03:27,260 --> 00:03:30,270 Usually, they've got the java docs open in a second monitor. 61 00:03:30,530 --> 00:03:32,619 And that's where all the good information is. 62 00:03:33,240 --> 00:03:35,070 So let's see some of these methods. 63 00:03:35,070 --> 00:03:36,590 Let's start with the size method. 64 00:03:36,870 --> 00:03:39,640 This method returns the number of elements that are in the deque. 65 00:03:40,190 --> 00:03:43,290 The max size we've already seen with vectors and std arrays, it's 66 00:03:43,470 --> 00:03:46,870 a pretty big number that just says how many elements can i store. 67 00:03:47,010 --> 00:03:50,890 Deques also allow individual access using either the subscript operator 68 00:03:50,900 --> 00:03:55,140 or the .at method and the rules are the same here if you use the subscript 69 00:03:55,140 --> 00:03:57,420 operator, no balance checking is done. 70 00:03:57,660 --> 00:04:01,530 But if you use the .at method, balance checking will happen 71 00:04:01,550 --> 00:04:03,770 and an exception will be thrown if you're out of bounce. 72 00:04:04,770 --> 00:04:08,809 In this case, you can see that I'm using d.at0, that 73 00:04:08,809 --> 00:04:14,299 refers to the 1 in the deque d, and d sub-1 refers to the 2. 74 00:04:16,500 --> 00:04:20,470 The deque also provides front and back methods that return references 75 00:04:20,470 --> 00:04:23,429 to the elements at the front of the deque and at the back of the deque. 76 00:04:23,690 --> 00:04:28,370 So in this example, d.front refers to the 1 and d d.back refers to the 5. 77 00:04:31,129 --> 00:04:33,840 As I previously mentioned, the deque allows for efficiently 78 00:04:33,990 --> 00:04:36,670 inserting and removing elements at the front and at the back. 79 00:04:37,570 --> 00:04:41,099 Inserting is done with the pushback method and the push front method. 80 00:04:41,809 --> 00:04:45,610 We also have a pop back and a pop front which you officially remove 81 00:04:45,610 --> 00:04:46,939 elements from the back of the front. 82 00:04:47,379 --> 00:04:50,640 In this slide, we have a deque of person objects and called it d. 83 00:04:51,620 --> 00:04:55,080 We can create a person p1 named Larry who is 18 years old. 84 00:04:55,690 --> 00:04:59,799 And we can use the push back method to insert p1 at the back of the deque. 85 00:05:00,509 --> 00:05:02,539 We can also remove it using pop back. 86 00:05:03,309 --> 00:05:06,740 Similarly, we can add a person object to the front of the deque with push 87 00:05:06,750 --> 00:05:08,760 front and remove it with pop front. 88 00:05:09,390 --> 00:05:13,280 Remember, all container classes make copies of the elements they store. 89 00:05:14,320 --> 00:05:18,110 The deque container also supports in place front and in place back, 90 00:05:18,370 --> 00:05:21,979 which are super efficient ways to create initialize objects and store 91 00:05:21,980 --> 00:05:23,439 them in the deque right in place. 92 00:05:23,980 --> 00:05:25,870 So now let's head over to the IDE. 93 00:05:26,050 --> 00:05:27,380 We'll see some examples. 94 00:05:27,520 --> 00:05:29,630 And in the video after that we'll have some challenge 95 00:05:29,630 --> 00:05:31,270 exercises that use deques. 96 00:05:32,900 --> 00:05:37,090 Okay, so I'm in the IDE. I'm in the section 20 workspace 97 00:05:37,360 --> 00:05:38,900 in the deque project. 98 00:05:40,309 --> 00:05:42,230 And this is a really simple example. 99 00:05:42,740 --> 00:05:46,030 The idea behind using a deque is that we're going to use the 100 00:05:46,030 --> 00:05:47,520 front of it or the back of it. 101 00:05:47,840 --> 00:05:50,430 We're not really going to be inserting things into the middle of it. 102 00:05:50,440 --> 00:05:53,240 If you need to do that kind of thing, you're probably 103 00:05:53,240 --> 00:05:54,519 better off using a list. 104 00:05:54,520 --> 00:05:55,769 We'll talk about the list later. 105 00:05:56,009 --> 00:05:58,790 So I'm not going to go into any of the fancy stuff where you can insert 106 00:05:58,790 --> 00:06:00,080 things into the middle of a deque. 107 00:06:00,080 --> 00:06:02,400 I'm just going to keep it really simple because that's 108 00:06:02,400 --> 00:06:04,040 usually the way we use a deque. 109 00:06:04,380 --> 00:06:07,280 So let's start with looking at what we've got here. 110 00:06:07,280 --> 00:06:10,492 We're including a deque, a vector and an algorithm. 111 00:06:10,679 --> 00:06:13,619 We're using the vector in a minute just to do a little simple example. 112 00:06:14,200 --> 00:06:18,299 And here I've got my display function that will display any type of deque. 113 00:06:18,330 --> 00:06:21,510 I'm only using deques of integers in this example, but it's nice 114 00:06:21,510 --> 00:06:22,900 to have this template function. 115 00:06:22,910 --> 00:06:25,730 You can play around with it and practice writing these actually. 116 00:06:25,940 --> 00:06:27,590 This is a really, really easy one to write. 117 00:06:27,900 --> 00:06:31,739 I went over this one in the previous video, the video for vectors. 118 00:06:32,630 --> 00:06:34,159 Okay, so let's take a look at test 1. 119 00:06:34,420 --> 00:06:35,360 I've already run the program. 120 00:06:35,360 --> 00:06:37,380 The output is over here, on the right in the console. 121 00:06:37,640 --> 00:06:39,580 And let's walk through these tests so you can understand 122 00:06:39,580 --> 00:06:40,390 what's happening here. 123 00:06:40,810 --> 00:06:42,080 So this is test 1 right here. 124 00:06:42,080 --> 00:06:44,220 You can see the output of test 1 right up here. 125 00:06:45,070 --> 00:06:48,370 First thing we're doing is we're declaring d as a deque of integers, 126 00:06:48,700 --> 00:06:50,270 and we're putting 1 to 5 in there. 127 00:06:50,540 --> 00:06:51,809 And then we're displaying the deque. 128 00:06:51,809 --> 00:06:54,139 So there it is right here, just as we would expect. 129 00:06:55,369 --> 00:06:56,800 Then I've got an assignment. 130 00:06:56,800 --> 00:06:59,880 I'm using the initializer list to assign, which, again, is really handy. 131 00:06:59,880 --> 00:07:02,570 So now d is 2 4 5 6, and I'm displaying that. 132 00:07:02,870 --> 00:07:04,880 You can see 2 4 5 6 right here. 133 00:07:05,590 --> 00:07:09,480 Now just like we did with the vector here, I'm creating 10 134 00:07:10,160 --> 00:07:12,550 100s, and I'm putting them in the deque and displaying them. 135 00:07:12,559 --> 00:07:14,280 You can see all 100s right here. 136 00:07:15,220 --> 00:07:17,590 And the last thing is right here. 137 00:07:17,590 --> 00:07:19,480 We're doing direct access to the deque. 138 00:07:19,850 --> 00:07:21,690 You don't often do this with a deque. 139 00:07:22,090 --> 00:07:23,930 Remember, the deque -- the whole point of a deque is 140 00:07:23,930 --> 00:07:25,320 to be a doubly ended queue. 141 00:07:25,320 --> 00:07:27,619 So you're going to work on the front, and you're going to work at the back. 142 00:07:27,650 --> 00:07:28,520 That's the idea. 143 00:07:28,799 --> 00:07:32,690 But it lets you have random access to the elements within it at in 144 00:07:32,710 --> 00:07:34,080 constant time, which is cool. 145 00:07:34,370 --> 00:07:38,849 So d sub-0 with the index operator is this is d now, so 146 00:07:38,849 --> 00:07:40,430 it's going to put 100 in here. 147 00:07:41,360 --> 00:07:44,870 And d at 1 we'll put 200 in there. 148 00:07:45,460 --> 00:07:48,413 And when we display that, you can see right here the 100 and 149 00:07:48,413 --> 00:07:50,650 the 200 replaced the 1 and the 2. 150 00:07:52,110 --> 00:07:53,860 All right, so that's pretty straightforward. 151 00:07:54,100 --> 00:07:54,900 Let's look at test 2. 152 00:07:55,690 --> 00:07:57,849 Test 2 is the real workhorse here. 153 00:07:57,849 --> 00:07:59,680 This is the way you typically use a deque. 154 00:07:59,980 --> 00:08:03,360 We're using push back and push front and pop back and so forth. 155 00:08:03,599 --> 00:08:05,810 So let's go over this one because these are the methods that you're 156 00:08:05,810 --> 00:08:07,330 going to really use a lot with the deque. 157 00:08:07,990 --> 00:08:11,200 So what I'm doing here is I'm creating a deque called d again 158 00:08:11,390 --> 00:08:14,049 of integers, and it's 0 0 0. 159 00:08:14,380 --> 00:08:16,810 And the reason I put 0 0 0 in there is just so we can have 160 00:08:16,810 --> 00:08:18,230 these 3 0s in the center. 161 00:08:18,460 --> 00:08:20,830 That way we can really understand how things are being pushed in. 162 00:08:21,259 --> 00:08:24,149 And we're displaying it, you can see right there the 3 0s. 163 00:08:25,020 --> 00:08:27,980 Now we're saying push back a 10, and then push back a 20. 164 00:08:28,500 --> 00:08:29,620 That means at the back. 165 00:08:29,620 --> 00:08:32,490 So first, I push back the 10 and then the 20. 166 00:08:33,000 --> 00:08:37,280 Remember, they're being pushed back this way, and display them and you can 167 00:08:37,280 --> 00:08:40,558 see what we've got 3 0s, 10 and a 20. 168 00:08:41,659 --> 00:08:42,669 Now I want to push front. 169 00:08:42,669 --> 00:08:45,460 So now I'm going to push these guys at the front 100 and then I push 200. 170 00:08:46,070 --> 00:08:48,720 I'm pushing them this way, and I'm displaying it again. 171 00:08:48,950 --> 00:08:52,339 And I've got right here 200 100 the 3 0s and then the 10 and the 172 00:08:52,340 --> 00:08:54,310 20, of course, are still there. 173 00:08:55,320 --> 00:08:57,919 We've got our front method which returns a reference to 174 00:08:57,920 --> 00:09:01,189 the front element, which in this case is that guy right here. 175 00:09:01,910 --> 00:09:04,760 I've got my back method, which returns a reference to the back 176 00:09:04,780 --> 00:09:09,010 element which is the 20 right here and the size, which is 7. 177 00:09:09,370 --> 00:09:11,970 So when we look at the output right here, you can see the front 178 00:09:11,970 --> 00:09:16,519 is 200, the back is 20 and the size is 7, and we display it right 179 00:09:16,520 --> 00:09:18,140 after we pop a few things off it. 180 00:09:18,140 --> 00:09:18,870 So let's try that. 181 00:09:19,120 --> 00:09:21,040 So first thing we do is we pop the back. 182 00:09:21,740 --> 00:09:22,630 That guy's gone. 183 00:09:22,900 --> 00:09:26,380 And then we pop the front, and that guy's gone, and we display it again. 184 00:09:26,599 --> 00:09:29,920 So now we're going to display 100 0 0 0 10. 185 00:09:29,920 --> 00:09:31,850 Notice how the 200 and the 20 are gone. 186 00:09:32,170 --> 00:09:34,800 So this is really the way you're going to use the deque. 187 00:09:35,510 --> 00:09:38,710 If you find yourself using a deque and fiddling around with the middle 188 00:09:38,720 --> 00:09:41,390 elements and inserting things into the middle and doing all kinds of 189 00:09:41,390 --> 00:09:44,420 stuff like that, maybe the deque is not what you should be using. 190 00:09:44,610 --> 00:09:46,979 Consider using a list, and we'll talk about a list in the 191 00:09:46,980 --> 00:09:48,360 next section of the course. 192 00:09:49,210 --> 00:09:51,010 Okay, so that takes care of test 2. 193 00:09:51,939 --> 00:09:53,519 Let's take a look at test 3. 194 00:09:54,660 --> 00:09:56,090 And what I've got here in test 3. 195 00:09:56,090 --> 00:09:57,130 This is what i wanna do. 196 00:09:57,380 --> 00:10:01,220 I've got a vector of 10 integers right here, 1 through 10. 197 00:10:01,680 --> 00:10:03,530 And I've got a deque d, which is empty. 198 00:10:04,120 --> 00:10:07,100 And what I want to do is I want to insert all the even numbers 199 00:10:07,200 --> 00:10:10,210 into the back of the deque and all the odd numbers into the front. 200 00:10:10,820 --> 00:10:11,839 It's pretty easy to do. 201 00:10:11,840 --> 00:10:14,290 I could just use a range-based for loop right here. 202 00:10:14,620 --> 00:10:16,750 And I can iterate over that vector. 203 00:10:16,800 --> 00:10:19,270 Remember, we're coming from a vector to a deque this time. 204 00:10:19,900 --> 00:10:23,929 And if the element mod 2 is 0, that means it is even. 205 00:10:24,929 --> 00:10:29,789 And if it's even, I'm pushing it onto the back, right. 206 00:10:29,789 --> 00:10:30,680 So where we start. 207 00:10:30,720 --> 00:10:33,106 We're starting with the number is even, we're pushing it in the back. 208 00:10:33,106 --> 00:10:35,949 The number is odd, we're pushing it into the front. 209 00:10:36,260 --> 00:10:41,870 So we're going to have the 1 the 2 the 3 the 4 the 5 the 6. 210 00:10:41,880 --> 00:10:45,259 This is what's going to happen, the 8 the 9 and the 10. 211 00:10:45,299 --> 00:10:46,559 That's the result right there. 212 00:10:47,389 --> 00:10:51,069 And when we look at the display for test 3, right here, 213 00:10:51,430 --> 00:10:52,700 that's exactly what we've got. 214 00:10:52,710 --> 00:10:57,209 We've got all the odd numbers here and all the even numbers right there. 215 00:10:59,400 --> 00:11:00,670 Now let's take a look at test 4. 216 00:11:00,910 --> 00:11:03,400 Test 4 is simple but important. 217 00:11:04,320 --> 00:11:06,140 It shows you the ordering of things. 218 00:11:06,330 --> 00:11:08,990 When we push stuff on the front versus we push stuff on the back, 219 00:11:09,230 --> 00:11:12,980 the ordering is obviously different, but this confuses people sometimes. 220 00:11:13,340 --> 00:11:15,569 And I've seen a lot of little mistakes from programmers 221 00:11:15,580 --> 00:11:19,879 that use deques this way and it comes up a lot in code reviews. 222 00:11:19,889 --> 00:11:20,860 So let's take a look. 223 00:11:21,339 --> 00:11:24,060 Here we've got a vector again, 1 through 10. 224 00:11:24,600 --> 00:11:27,250 And what I'm doing is I'm going through the entire vector this time. 225 00:11:27,430 --> 00:11:28,320 There's no if statement. 226 00:11:28,320 --> 00:11:29,430 There's no odd even stuff. 227 00:11:29,460 --> 00:11:32,630 That's all I'm doing is I'm going through that vector and 228 00:11:32,630 --> 00:11:35,510 I'm grabbing each element and I'm pushing it in the front. 229 00:11:35,809 --> 00:11:36,720 So we're starting at the 1. 230 00:11:36,720 --> 00:11:41,799 So we're pushing it 1 2 3 4 5. 231 00:11:41,820 --> 00:11:43,400 Remember, we're pushing things on the front. 232 00:11:43,750 --> 00:11:44,979 So this is the result. 233 00:11:46,060 --> 00:11:47,270 That's a 9 right there. 234 00:11:47,610 --> 00:11:48,439 That's the result. 235 00:11:48,440 --> 00:11:50,960 So when I display this -- and again, I'm in test 4. 236 00:11:51,400 --> 00:11:53,870 You can see it's 10 9 8, all the way down to 1. 237 00:11:54,780 --> 00:11:56,099 I'm gonna clear the deque here. 238 00:11:56,380 --> 00:11:58,760 Then I'm going to do the same thing except now I'm going to push back. 239 00:11:58,799 --> 00:12:00,489 This time we're pushing this way, right. 240 00:12:00,809 --> 00:12:05,880 So we're going to have 1 2 3 4 5 6 7 8 9 and 10. 241 00:12:06,680 --> 00:12:09,720 And when we display that, you can see that that's exactly what we get. 242 00:12:10,160 --> 00:12:12,120 Obviously, the order is going to be different, right. 243 00:12:12,120 --> 00:12:13,986 One's going to be going from 1 to 10, the other from 10 to 244 00:12:13,986 --> 00:12:18,420 1, depending on whether we do a push front or a push back. 245 00:12:18,720 --> 00:12:22,030 And as I said, this is -- sounds simple, but I've seen a lot of 246 00:12:22,030 --> 00:12:25,360 little mistakes using this because somehow people get confused. 247 00:12:25,960 --> 00:12:29,190 Let's take a look at the last test, test 5. 248 00:12:30,380 --> 00:12:32,929 So what we're going to do now is we're going to do the same thing 249 00:12:32,929 --> 00:12:35,829 we did in test 4 except we're going to use std copy to do it. 250 00:12:36,270 --> 00:12:36,970 So what do we have. 251 00:12:36,970 --> 00:12:40,730 We have the same vector, and we have a deque that's empty again. 252 00:12:41,300 --> 00:12:44,000 And what we're going to do is we're simply going to copy everything 253 00:12:44,000 --> 00:12:46,530 in the vector from begin to end. 254 00:12:47,000 --> 00:12:49,580 And we're going to use the front inserter iterator to do 255 00:12:49,580 --> 00:12:52,799 it, so one line of code handles this really, really easily. 256 00:12:53,100 --> 00:12:56,199 So again, loop through the vector at the entire vector. 257 00:12:56,550 --> 00:13:01,420 And for each element in that vector, insert it to the front of the deque d. 258 00:13:02,250 --> 00:13:03,780 So this is test 5. 259 00:13:04,240 --> 00:13:06,640 When we display that, this is what we get right here. 260 00:13:07,190 --> 00:13:11,420 Notice it's the same as test 4 because we're inserting at the front. 261 00:13:12,150 --> 00:13:14,550 And we can clear the deque and do it again. 262 00:13:14,560 --> 00:13:17,440 So copy vec.begin to vec.n. 263 00:13:17,700 --> 00:13:19,410 And this time we're going to do the back inserter. 264 00:13:19,410 --> 00:13:21,209 We're inserting at the back this way. 265 00:13:22,090 --> 00:13:25,260 And what we're going to get is the same thing we got with test 4. 266 00:13:25,750 --> 00:13:30,469 So which should you use, I tend to like this, this is much more expressive. 267 00:13:30,510 --> 00:13:33,030 Most programmers will understand this. 268 00:13:33,580 --> 00:13:39,199 A lot of programmers are not real familiar with the stl algorithms. 269 00:13:39,450 --> 00:13:43,690 So this kind of code right here is foreign to them, and they 270 00:13:43,690 --> 00:13:46,089 could really mess things up, especially junior programmers. 271 00:13:46,090 --> 00:13:50,510 Junior programmers -- the stl is a complicated beast, and a 272 00:13:50,510 --> 00:13:53,150 lot of junior programmers just know the very basics of it. 273 00:13:53,390 --> 00:13:58,340 So when you get a lot of algorithms put together with iterators and 274 00:13:58,710 --> 00:14:01,830 inserters, it's likely a lot of the junior programmers haven't seen that. 275 00:14:01,830 --> 00:14:03,440 So there you go. 276 00:14:04,529 --> 00:14:04,999 That's it. 277 00:14:05,109 --> 00:14:06,829 So that takes care of the deque. 278 00:14:07,490 --> 00:14:10,560 In the next video, we'll do the first challenge for the deque.