1 00:00:01,710 --> 00:00:02,370 Hi, everyone. 2 00:00:02,400 --> 00:00:07,620 So in this lesson, we are going to solve this question, find the smallest elements. 3 00:00:08,740 --> 00:00:17,000 So the input is basically in an area and I integer key, so we have to find the key smallest elements. 4 00:00:17,680 --> 00:00:20,380 So, for example, what are the key smallest elements here? 5 00:00:20,410 --> 00:00:23,010 So this is zero one five and six. 6 00:00:23,650 --> 00:00:26,440 So these are the four smallest elements. 7 00:00:28,380 --> 00:00:29,490 President in this area. 8 00:00:30,670 --> 00:00:37,160 So since the value of Gaisford, so say I will take four, so I have to find the smallest element. 9 00:00:37,570 --> 00:00:41,960 Now the first and the basic approach is basically what you will lose or you will apply the sorting algorithm. 10 00:00:42,310 --> 00:00:45,720 So if you are deciding now, what do I look like? 11 00:00:45,730 --> 00:00:49,260 So this is zero, then one, then five, six. 12 00:00:49,270 --> 00:00:50,500 So it will become eight. 13 00:00:50,500 --> 00:00:52,420 Then nine, then 10. 14 00:00:52,420 --> 00:00:53,170 And then 12. 15 00:00:54,220 --> 00:01:00,430 And then they have to do so, you have to find fast food, so take the first four elements and this 16 00:01:00,430 --> 00:01:01,160 is your answer. 17 00:01:01,780 --> 00:01:06,630 So this is your smallest elements now with the complexity of the solution. 18 00:01:07,030 --> 00:01:12,040 So that time complexities and low end because you have to sort the area and then after sorting the area, 19 00:01:12,040 --> 00:01:16,380 you can take the first four elements and basically the first key elements. 20 00:01:17,850 --> 00:01:20,700 You will take the first key elements, and that will be your answer. 21 00:01:21,600 --> 00:01:27,570 Now, this was the first way using Starting Now the time complexity for using Sardinians and Logan. 22 00:01:27,580 --> 00:01:31,350 But I want to solve this question in a longer time complexity. 23 00:01:32,230 --> 00:01:34,380 Now, this is long and this is logoff. 24 00:01:34,870 --> 00:01:41,560 So Loki's much, much less than Laugavegur because and it's basically the number of elements present 25 00:01:41,560 --> 00:01:43,490 in the area and will be very small. 26 00:01:43,720 --> 00:01:45,930 So basically, it is much, much less than in. 27 00:01:46,090 --> 00:01:49,150 So that's why lockyear will be much, much smaller than log often. 28 00:01:49,400 --> 00:01:52,750 So I want to solve this question in this much time complexity. 29 00:01:53,560 --> 00:01:55,900 Now let's discuss how we can solve this question. 30 00:01:57,520 --> 00:02:01,030 So basically, what I will do, I will create a maximum priority queue. 31 00:02:02,460 --> 00:02:09,840 So what I'm going to do, I will create a maximum priority queue and I will push for key elements so 32 00:02:10,270 --> 00:02:12,990 the value of Gaisford, so I will first push. 33 00:02:13,470 --> 00:02:16,240 So this is my original idea before sorting the inventory. 34 00:02:16,480 --> 00:02:19,680 So I will first push the key elements to the value of Gaisford. 35 00:02:19,920 --> 00:02:22,690 So push the first four elements into your maximum priority. 36 00:02:23,310 --> 00:02:26,550 So this is eight, then five, then 12 and then 10. 37 00:02:27,450 --> 00:02:32,630 Simple now consider elements one by one, so zero now. 38 00:02:33,240 --> 00:02:36,760 So basically the zero element is less than the largest element. 39 00:02:36,780 --> 00:02:39,920 So the maximum pressure to give you can only access the largest element. 40 00:02:40,080 --> 00:02:41,410 So zero is less than 10. 41 00:02:41,430 --> 00:02:44,290 So what I will do, I will slap 10 with zero. 42 00:02:44,850 --> 00:02:45,990 Now, this is my priority. 43 00:02:45,990 --> 00:02:46,950 Give it five. 44 00:02:47,260 --> 00:02:50,850 OK, so the maximum limit rostral, the maximum limit was 12. 45 00:02:50,850 --> 00:02:53,640 So zero will get slapped with 12. 46 00:02:53,700 --> 00:02:54,780 So 12 will come hit. 47 00:02:54,810 --> 00:02:56,460 So zero will come around the system. 48 00:02:58,770 --> 00:03:00,240 Now, the next element is one. 49 00:03:01,780 --> 00:03:07,690 So when you compare one with the largest element to the largest element is 10, because in the mix protect 50 00:03:07,690 --> 00:03:14,800 you, you only have access to the largest element using the top function to compare one with Pennsylvania's 51 00:03:14,800 --> 00:03:15,420 less than 10. 52 00:03:15,670 --> 00:03:17,370 So what I will do, I will strap. 53 00:03:17,620 --> 00:03:22,290 So this is eight five zero and then we will pop out done. 54 00:03:22,300 --> 00:03:25,190 And we will push one bob then and push one. 55 00:03:25,480 --> 00:03:29,170 So when now the next element is six. 56 00:03:30,100 --> 00:03:34,930 So six and what is the largest element, the largest element is currently eight now six is less than 57 00:03:34,930 --> 00:03:35,100 eight. 58 00:03:35,110 --> 00:03:40,470 So we will pop it and we will push six six five zero and one. 59 00:03:41,420 --> 00:03:42,700 The next element is nine. 60 00:03:43,060 --> 00:03:46,530 So campaign nine with the largest element to the largest element is six. 61 00:03:46,750 --> 00:03:48,790 So nine is bigger than six to do nothing. 62 00:03:49,420 --> 00:03:50,920 So do nothing. 63 00:03:54,430 --> 00:03:58,240 And the still remains him six, five, zero and one. 64 00:03:59,230 --> 00:04:01,600 And now basically we will reach the end of the year. 65 00:04:01,630 --> 00:04:02,710 So what is my answer? 66 00:04:02,740 --> 00:04:03,830 So this is my answer. 67 00:04:04,510 --> 00:04:07,380 The elements present in the mix and produce my answer. 68 00:04:07,570 --> 00:04:08,530 You can compare. 69 00:04:11,380 --> 00:04:12,740 See, the elements are correct. 70 00:04:12,760 --> 00:04:20,110 Six five 091 Now, since this is a dequeue so it will pop out elements, then the elements will come 71 00:04:20,110 --> 00:04:20,800 in the order. 72 00:04:21,040 --> 00:04:25,060 So first six will come, then five will come, then one will come and then zero will come. 73 00:04:26,440 --> 00:04:31,600 This is the Maksym element, so that's where it will come out first, so this will be an order, it 74 00:04:31,600 --> 00:04:34,150 will pop out the element from the MAKSYM priority you. 75 00:04:35,230 --> 00:04:41,140 If you want to retain the Olympics in started with what you will do, you will just reverse the elements. 76 00:04:41,360 --> 00:04:46,750 So after reversing, this will become zero one five and six and then you can print or you can do anything 77 00:04:46,750 --> 00:04:47,130 you want. 78 00:04:48,280 --> 00:04:53,620 So with the help of Maksym, where we can reconcile this question and local time and local time, because 79 00:04:53,620 --> 00:04:56,120 you can see what is the size of the mix compared to you. 80 00:04:56,150 --> 00:04:57,750 So it is containing key elements. 81 00:04:58,540 --> 00:05:02,410 So that's why the insert function and the function they will take. 82 00:05:02,650 --> 00:05:05,590 So basically they push and delete is actually pop. 83 00:05:05,800 --> 00:05:09,040 So push and pop, they will take log of their time. 84 00:05:10,130 --> 00:05:12,710 Simple, so let's take one more example to. 85 00:05:13,820 --> 00:05:15,200 I understand this question better. 86 00:05:16,410 --> 00:05:20,340 So let's say my area is said this is my area. 87 00:05:20,370 --> 00:05:22,880 Five, then six, then nine, then later. 88 00:05:22,960 --> 00:05:27,090 Well, then let's say three, then let's say 13 and then let's say two. 89 00:05:27,360 --> 00:05:29,430 And let's say the valley of KS three. 90 00:05:30,330 --> 00:05:34,000 I want to find out three smallest, smallest element. 91 00:05:34,020 --> 00:05:40,530 So again, I will create a maximum priority queue and I will push the first key elements. 92 00:05:40,800 --> 00:05:42,570 So push the first key elements. 93 00:05:42,570 --> 00:05:45,030 That is first three elements into to make priority. 94 00:05:45,600 --> 00:05:52,500 So this is five, then I have six and then I have nine now elementally so compared well with the largest 95 00:05:52,500 --> 00:05:55,760 elements that I just listen to a little girl then I do nothing. 96 00:05:56,550 --> 00:06:00,300 Now the next element is three now compared three with the largest element. 97 00:06:00,330 --> 00:06:01,910 So three is actually less than nine. 98 00:06:02,190 --> 00:06:04,890 So it will do pop nine and push three. 99 00:06:05,460 --> 00:06:06,670 So five, six, three. 100 00:06:07,290 --> 00:06:08,760 Now the next element is 13. 101 00:06:09,270 --> 00:06:13,160 So 13 the largest element in the mix and produce six. 102 00:06:13,260 --> 00:06:14,800 I don't lundie mix impractical. 103 00:06:14,920 --> 00:06:18,160 We only have access to the topmost element that is the largest element. 104 00:06:18,480 --> 00:06:21,270 So 13 will be 13 is good and six do nothing. 105 00:06:22,110 --> 00:06:27,040 Now, the next element is to show two, and the largest element is six, total is less than six, but 106 00:06:27,580 --> 00:06:28,800 will push through. 107 00:06:28,830 --> 00:06:30,720 We will pop six and we will push two. 108 00:06:31,300 --> 00:06:33,410 So this is we are five, then two and three. 109 00:06:33,930 --> 00:06:36,240 So this is the content of the priority. 110 00:06:36,250 --> 00:06:38,440 You and then I will reach the end of the area. 111 00:06:39,030 --> 00:06:40,110 So what is my answer? 112 00:06:40,140 --> 00:06:41,030 This is my answer. 113 00:06:41,370 --> 00:06:44,070 So the three smallest elements are five, two and three. 114 00:06:44,370 --> 00:06:48,810 And if you will pop out the elements, first of all, five will come, then three will come and then 115 00:06:48,810 --> 00:06:49,360 two will come. 116 00:06:49,620 --> 00:06:53,410 So these are the three smallest element present in this area. 117 00:06:54,000 --> 00:06:57,690 So with the help of maximum priority queue, you can easily solve this question. 118 00:06:59,210 --> 00:07:01,420 So if you are ready now, let us right the called. 119 00:07:07,500 --> 00:07:11,370 So let's say I want to return a vector of integers. 120 00:07:14,130 --> 00:07:20,340 And let's say the name of the function is Geissman list or before, let's say let's printhead only, 121 00:07:20,700 --> 00:07:25,560 we will not return, we will just print and we have to print Casemore list elements. 122 00:07:27,770 --> 00:07:30,560 So Casemore list, it will take areas and put. 123 00:07:31,840 --> 00:07:38,260 So it will take the size and it will also take the value of. 124 00:07:39,870 --> 00:07:43,800 So what we have to do is, first of all, I have to create a maximum priority to. 125 00:07:47,060 --> 00:07:53,060 So this is the syntax for creating a mix, in particular vintages, then I have to pop, I have to push 126 00:07:53,060 --> 00:07:54,110 first gay elements. 127 00:07:55,040 --> 00:07:56,150 So I am pushing. 128 00:07:58,200 --> 00:08:04,110 The first key elements into my priority given to my Maksym verdict also be Cadart Bush. 129 00:08:06,390 --> 00:08:07,950 Now, after pushing what we have to do. 130 00:08:08,980 --> 00:08:10,110 So they decided over. 131 00:08:10,600 --> 00:08:13,250 So this time I would start trading from next. 132 00:08:13,720 --> 00:08:18,280 I placeless, sorry, Ellerston and I placeless. 133 00:08:19,260 --> 00:08:25,260 Now, what we have to do, so we have to combat the element to the current element, so if Elfy is basically 134 00:08:25,260 --> 00:08:29,910 less than the topmost element of the priority, you sort of must element is actually. 135 00:08:30,970 --> 00:08:36,580 Your daughter up, so if my current element is less than the maximum present in the mix in particular, 136 00:08:36,580 --> 00:08:39,950 then what you can do to pop out the maximum elements would be good pop. 137 00:08:39,970 --> 00:08:41,230 You'll call the function pop. 138 00:08:43,120 --> 00:08:45,790 And they will push the current elements will be Art Bush. 139 00:08:47,070 --> 00:08:47,730 Elfy. 140 00:08:49,760 --> 00:08:50,450 And that's. 141 00:08:51,430 --> 00:08:55,090 And that's all that we have to do, so for printing the answer no. 142 00:08:56,690 --> 00:09:02,000 So it's time to bring it down, so I have my answer stored in the priority queue, so let us bring those 143 00:09:02,000 --> 00:09:02,450 elements. 144 00:09:03,620 --> 00:09:06,170 So while priority queue is not empty. 145 00:09:08,690 --> 00:09:09,440 What they have to do. 146 00:09:10,650 --> 00:09:13,240 You will take one by one and you will bring that element. 147 00:09:13,500 --> 00:09:15,930 So I only have access to the topmost element. 148 00:09:19,370 --> 00:09:21,560 So bigger and bigger, not Bob. 149 00:09:24,330 --> 00:09:27,420 And now let us pass let us create an integrated. 150 00:09:31,780 --> 00:09:33,460 Let's say the elements are. 151 00:09:34,980 --> 00:09:36,900 Five, six, nine. 152 00:09:40,760 --> 00:09:42,170 Well, let's say three. 153 00:09:43,490 --> 00:09:46,550 Let's say 13 and let's go to. 154 00:09:49,490 --> 00:09:51,380 So I have to call this function is my list. 155 00:09:55,570 --> 00:09:56,440 So I have to pass. 156 00:09:57,400 --> 00:10:02,410 What is the number of elements or one, two, three, four, five, six and seven? 157 00:10:02,470 --> 00:10:03,660 So seven elements are there. 158 00:10:04,150 --> 00:10:08,410 And lastly, I want to find out the smallest elements of the value of Kastari. 159 00:10:10,090 --> 00:10:15,190 The use prior to whatever have to you have to include prior to you or you can simply write. 160 00:10:20,630 --> 00:10:25,420 So if you do not want to write this, what you have to do this, it is actually implemented in July, 161 00:10:25,460 --> 00:10:27,440 so you have to include hash included QUE. 162 00:10:28,410 --> 00:10:29,890 So I think this much more will work. 163 00:10:29,910 --> 00:10:31,410 So let us test our program. 164 00:10:37,010 --> 00:10:38,720 So my answer is five, three and two. 165 00:10:40,450 --> 00:10:45,370 And I wouldn't say it's 100 percent correct because they had the same input that we give. 166 00:10:46,780 --> 00:10:52,510 We discussed here, so five to two was our answer, and they are also coming out to be five, three 167 00:10:52,510 --> 00:10:52,850 and two. 168 00:10:53,170 --> 00:10:55,100 So basically our goal is working fine. 169 00:10:55,120 --> 00:10:57,010 Now, let us discuss the time, complexity. 170 00:10:57,610 --> 00:11:00,820 So the size of my priority is actually key. 171 00:11:01,000 --> 00:11:04,690 And I am pushing key elements of their time, complexity for this party scale, Skalak. 172 00:11:05,980 --> 00:11:12,410 Again, this will run and minus good times and I am popping the element and pushing the elements, so 173 00:11:12,440 --> 00:11:17,550 again, lockyear times when and minus Killock and the size of the Prada Gucci. 174 00:11:17,560 --> 00:11:22,600 So I am popping out elements of Killock again, if you will, at this time complexity. 175 00:11:22,620 --> 00:11:24,610 So your time will come out to be alloca. 176 00:11:25,590 --> 00:11:27,630 Which is the desired time complexity. 177 00:11:29,360 --> 00:11:36,050 OK, so this way you will be able to find out the smallest elements so you can write the code in Davíð 178 00:11:36,060 --> 00:11:38,660 also, for example, what I'm doing here. 179 00:11:38,660 --> 00:11:42,140 So I'm comparing and then I'm pushing or popping the elements. 180 00:11:42,470 --> 00:11:45,820 But instead of this campaign, I pushed the elements and popped the element. 181 00:11:46,130 --> 00:11:48,380 So let me take an example. 182 00:11:48,410 --> 00:11:49,670 So let us take this example. 183 00:11:49,670 --> 00:11:50,760 Only five, six, nine. 184 00:11:51,980 --> 00:11:53,570 So what I want to show you. 185 00:11:56,070 --> 00:11:57,420 So finally, what do we want? 186 00:11:59,060 --> 00:12:05,840 So let's take an example first of the five, six, then let's say nine, then to 12, three, 13 and 187 00:12:05,840 --> 00:12:07,880 two and the value of case three. 188 00:12:08,390 --> 00:12:09,850 So finally, what will happen? 189 00:12:10,400 --> 00:12:12,050 Our maximum priority queue. 190 00:12:12,110 --> 00:12:16,160 So the size of the maximum vertical will be key because it will contain key elements. 191 00:12:16,340 --> 00:12:16,730 Correct. 192 00:12:17,090 --> 00:12:20,760 So finally, the size of a maximum priority is going to be key. 193 00:12:21,080 --> 00:12:23,120 So what we will do, we will maintain the size. 194 00:12:23,660 --> 00:12:26,330 So I maintain the size what I want to say. 195 00:12:26,990 --> 00:12:30,980 So you push the first element size is less then, correct? 196 00:12:31,430 --> 00:12:32,400 Less than I requested. 197 00:12:33,350 --> 00:12:34,670 Now push the next element. 198 00:12:36,060 --> 00:12:42,650 The size is two and the maximum size allowed is three, correct, because the next element nine. 199 00:12:42,780 --> 00:12:45,720 So the size is three and the maximum size allowed is three. 200 00:12:45,720 --> 00:12:48,150 Correct push the fourth element. 201 00:12:48,930 --> 00:12:50,250 Now the size is equal. 202 00:12:50,430 --> 00:12:55,630 Sorry, now the size is for the sizes four and the maximum size allowed is three. 203 00:12:55,980 --> 00:12:59,720 So what you will do, you will pop one element and which element we can bob. 204 00:12:59,730 --> 00:13:03,390 Obviously the maximum vertical so we can only possibly largest element. 205 00:13:03,510 --> 00:13:03,960 So I will. 206 00:13:03,960 --> 00:13:05,430 Popplewell Correct. 207 00:13:05,880 --> 00:13:06,870 Now push three. 208 00:13:07,560 --> 00:13:08,580 So Bush three. 209 00:13:09,980 --> 00:13:15,650 So, again, this is greater than the maximum size allowed, so you will pop the maximum element, what 210 00:13:15,650 --> 00:13:16,550 is the maximum element? 211 00:13:16,550 --> 00:13:18,330 Nine, so nine will get popped. 212 00:13:18,680 --> 00:13:22,130 So currently this is going to make symbiotically five six entry. 213 00:13:23,590 --> 00:13:29,420 So the next element is tradin so Bush starting now again, the has become forth, but this is not allowed. 214 00:13:29,480 --> 00:13:31,010 So make some element. 215 00:13:31,690 --> 00:13:32,950 So today we'll get Bob. 216 00:13:33,190 --> 00:13:37,210 Now, to add insult to again, the size becomes four to. 217 00:13:37,210 --> 00:13:44,150 So, Bob, did I just say, well, Bob, the largest element and this is the content of the mix in particular 218 00:13:44,200 --> 00:13:48,820 to five and three, and if you will eliminate one by one, so five will come first, then three will 219 00:13:48,820 --> 00:13:50,350 come first and then two will come first. 220 00:13:50,590 --> 00:13:51,490 So five, three, two. 221 00:13:51,970 --> 00:13:53,830 So in this way, you can also write the code. 222 00:13:54,430 --> 00:13:56,470 So we just have to maintain the size of the prior. 223 00:13:57,190 --> 00:13:59,710 So if you want, I can write this code for you. 224 00:13:59,740 --> 00:14:03,910 So, OK, so let me write this code for you so that you can understand it. 225 00:14:05,970 --> 00:14:09,610 But the logic is same, just the way of writing will be different. 226 00:14:10,380 --> 00:14:13,710 So what we have to do, let's comment about this called. 227 00:14:17,260 --> 00:14:23,140 So what I am saying, you have to create a protocol that is correct, so after creating the protocol, 228 00:14:23,770 --> 00:14:25,870 let's start inserting elements one by one. 229 00:14:25,880 --> 00:14:27,130 So I equals zero. 230 00:14:27,640 --> 00:14:29,530 I listen in, I placeless. 231 00:14:29,530 --> 00:14:32,530 I will just maintain the size of my mixing protocol. 232 00:14:33,910 --> 00:14:34,480 Symbol. 233 00:14:35,530 --> 00:14:39,970 So let's push the element, so let's push elements or picador push. 234 00:14:40,950 --> 00:14:47,510 If I am pushing the element and after pushing the limit, let's check the size so I have function to 235 00:14:48,240 --> 00:14:52,950 be good size, so the maximum size allowed is gey. 236 00:14:53,430 --> 00:14:55,560 So if the size becomes a gudinski. 237 00:14:57,510 --> 00:15:01,410 That makes them say the loudest, if the sides become bigger, then you will just pop. 238 00:15:01,410 --> 00:15:02,430 So Picador Pop. 239 00:15:04,950 --> 00:15:07,160 And that's all so what I'm doing. 240 00:15:08,190 --> 00:15:14,250 If the size becomes bigger than the size of the priority has to be key because our priority will contain 241 00:15:14,490 --> 00:15:21,120 key elements finally, so the size becomes bigger than you can basically pop and then you can just print 242 00:15:21,570 --> 00:15:23,130 the content of your priority queue. 243 00:15:24,090 --> 00:15:24,840 So while. 244 00:15:26,650 --> 00:15:28,150 The product is not empty. 245 00:15:30,580 --> 00:15:34,030 So I'm just writing the same code, you can copy paste this line. 246 00:15:37,000 --> 00:15:38,290 So bigger and bigger. 247 00:15:38,320 --> 00:15:38,740 ARTPOP. 248 00:15:41,980 --> 00:15:44,110 OK, so we are just getting over the. 249 00:15:44,920 --> 00:15:51,070 I am pushing every element and if the size becomes bigger, then you will pop the element which element 250 00:15:51,070 --> 00:15:51,650 will be popped. 251 00:15:51,910 --> 00:15:54,130 So the largest element will be popped out first. 252 00:15:54,520 --> 00:15:55,900 So largest element. 253 00:15:58,590 --> 00:15:59,460 Will be deleted. 254 00:16:02,220 --> 00:16:08,310 Correct, and then finally, the size of your priority queue, it is containing key elements and now 255 00:16:08,310 --> 00:16:10,390 let us push, not a sprint. 256 00:16:10,410 --> 00:16:13,100 Those key elements seem so here. 257 00:16:13,110 --> 00:16:16,200 Also, your answer was containing key elements. 258 00:16:18,630 --> 00:16:22,110 Inside your priority, you insider makes Embraer dequeue. 259 00:16:23,790 --> 00:16:30,050 So this court will also work fine, just like the Boven, if you want, I can run this court for you. 260 00:16:30,060 --> 00:16:34,310 So the output is going out to resolve this one, five, three and do so same. 261 00:16:34,320 --> 00:16:36,330 The output is coming out three, five, three and two. 262 00:16:36,930 --> 00:16:38,460 So let's run our program. 263 00:16:42,390 --> 00:16:47,760 So you can see the output is coming out to be five, three and two, and what is the time, complexity 264 00:16:47,760 --> 00:16:48,530 of the solution? 265 00:16:48,750 --> 00:16:53,850 So this solution is exactly the same as the previous one, but just the way of writing is different. 266 00:16:54,180 --> 00:17:01,050 So, again, this loop is running and times and I am doing logi work, so this will take a long time. 267 00:17:01,350 --> 00:17:03,180 So the time, complexities and Locky. 268 00:17:03,630 --> 00:17:06,069 And for this, the time, complexity, scale. 269 00:17:06,109 --> 00:17:12,690 OK, so again, if you will add these to the time complexity is going to be and logi so everything the 270 00:17:12,690 --> 00:17:14,780 same time, complexity, space, complexity. 271 00:17:14,790 --> 00:17:17,730 OK, so the space complexity is big off key because. 272 00:17:19,200 --> 00:17:25,410 My hope will contain key elements at any point of time, so this is the time and the space complexity, 273 00:17:25,410 --> 00:17:26,339 I'm repeating myself. 274 00:17:26,670 --> 00:17:29,640 The above me of writing the code and the below of writing the code. 275 00:17:29,850 --> 00:17:33,810 The logic is seem exactly the same logic, but the way of writing is different. 276 00:17:34,080 --> 00:17:38,550 And again, the time and the space complexity, the same for both the solutions. 277 00:17:42,590 --> 00:17:48,610 So in the next video, what will do so in the next video, we will discuss how we can use our inbuilt 278 00:17:48,620 --> 00:17:49,300 medium priority. 279 00:17:49,580 --> 00:17:52,520 So this is actually an example I would take you in the next video. 280 00:17:52,520 --> 00:17:57,500 We will discuss how to create how to use the inbuilt minimum priority protocol. 281 00:17:58,450 --> 00:17:59,320 I will see you there. 282 00:17:59,440 --> 00:17:59,860 Bye bye.