1 00:00:01,020 --> 00:00:01,680 Hi, everyone. 2 00:00:01,710 --> 00:00:07,290 So in this video, we are going to cover the situation, find the minimum depth of a binary tree. 3 00:00:07,760 --> 00:00:09,850 OK, so what is the meaning of minimum depth? 4 00:00:09,870 --> 00:00:14,730 So it is basically the distance between the root node and the nearest leaf. 5 00:00:16,040 --> 00:00:16,550 OK. 6 00:00:17,860 --> 00:00:22,070 The distance between the road and the nearest cliff, so let us take an example. 7 00:00:22,300 --> 00:00:23,620 So consider this example. 8 00:00:23,920 --> 00:00:25,630 So basically, this is the route node. 9 00:00:25,840 --> 00:00:27,820 OK, this is the route node. 10 00:00:27,820 --> 00:00:29,440 And 15 is a leaf node. 11 00:00:29,440 --> 00:00:30,700 Seven is a leaf node. 12 00:00:30,790 --> 00:00:32,049 Nine is a leaf node. 13 00:00:32,060 --> 00:00:33,440 So I have three leaf node. 14 00:00:33,490 --> 00:00:35,690 OK, I have three leaf node. 15 00:00:36,100 --> 00:00:40,240 This is the nearest leaf and also node one and not two. 16 00:00:40,250 --> 00:00:43,990 So the minimum depth of this by Newton is basically two. 17 00:00:44,530 --> 00:00:44,930 OK. 18 00:00:45,730 --> 00:00:47,360 Now let us go through this example. 19 00:00:47,380 --> 00:00:50,900 So this is the root node and this is the nearest leaf node. 20 00:00:50,920 --> 00:00:53,110 OK, 52 is also a leaf node. 21 00:00:53,290 --> 00:00:57,670 Seventy two is also a leaf node, but it is the nearest road you can see. 22 00:00:57,820 --> 00:00:59,980 I have to find out the nearest leaf node, OK. 23 00:01:00,190 --> 00:01:01,430 Now the distance basically. 24 00:01:01,450 --> 00:01:05,860 So this is Neptun, this is that two and this is that tree. 25 00:01:05,930 --> 00:01:09,700 OK, so the minimum depth for this binary trees, basically three. 26 00:01:10,570 --> 00:01:12,370 Now let us consider this example. 27 00:01:12,650 --> 00:01:16,720 OK, so this is the root node and this is the nearest leaf node. 28 00:01:16,930 --> 00:01:20,800 One and seven are also leaf node, but five is the nearest leaf node. 29 00:01:21,070 --> 00:01:26,520 So now let's find out the depth so that when that two and that tree. 30 00:01:26,980 --> 00:01:31,000 So the minimum depth for this binary is basically three. 31 00:01:31,600 --> 00:01:33,600 OK, so I hope you understood the question. 32 00:01:33,640 --> 00:01:38,530 We have to find the minimum that OK, we have to find the minimum that offered by Nutri. 33 00:01:39,460 --> 00:01:40,590 Now let us know. 34 00:01:40,630 --> 00:01:42,730 Let us discuss how we can solve this question. 35 00:01:42,760 --> 00:01:45,310 OK, so basically this question is nothing. 36 00:01:45,340 --> 00:01:48,390 It is just the implementation of level of the traversal. 37 00:01:48,460 --> 00:01:50,950 OK, so this question is basically. 38 00:01:52,170 --> 00:01:54,400 The implementation of law and order traversal. 39 00:01:54,420 --> 00:01:57,950 Now let's see how, OK, let us consider a big example, OK? 40 00:02:08,699 --> 00:02:14,530 OK, so consider this as a reminder to consider this example now what is the newest leaf? 41 00:02:14,550 --> 00:02:16,830 And also don't tease the nearest leaf node. 42 00:02:17,650 --> 00:02:21,970 OK, so what we will do so we will do the level of the cells on the laboratory. 43 00:02:22,360 --> 00:02:25,560 First I will visit this, then I will visit this. 44 00:02:25,890 --> 00:02:27,380 Then I will visit this. 45 00:02:27,390 --> 00:02:34,320 So basically that one, I will also order that daptone that to that tree and then I will visit this 46 00:02:34,320 --> 00:02:34,590 level. 47 00:02:34,620 --> 00:02:37,170 So this is level four or you can say that for now. 48 00:02:37,170 --> 00:02:38,400 You can see I have a node. 49 00:02:39,410 --> 00:02:40,970 So this is basically a relief note. 50 00:02:41,000 --> 00:02:44,060 So it is a relief not so left and right is also. 51 00:02:44,600 --> 00:02:47,960 So as soon as you encounter, then as soon as in control. 52 00:02:47,960 --> 00:02:49,710 If not, we will return it. 53 00:02:50,120 --> 00:02:54,740 So it's Leptis basically for to answer for this by nutri the minimum. 54 00:02:54,740 --> 00:02:55,850 That is basically food. 55 00:02:56,060 --> 00:02:59,210 OK, so what we have to do, our logic is very simple. 56 00:03:00,020 --> 00:03:02,210 We will perform the law and order traversal. 57 00:03:03,850 --> 00:03:08,980 We will perform the laboratory and while performing the level of the trial itself, we will also order 58 00:03:08,990 --> 00:03:11,650 that, OK, I will also order that. 59 00:03:12,730 --> 00:03:15,720 Now, as soon as when we are performing the lutrova. 60 00:03:16,030 --> 00:03:21,890 So as soon as we encounter a leaf node, as soon as we encounter a leaf node, we will return the depth 61 00:03:21,940 --> 00:03:22,290 value. 62 00:03:22,600 --> 00:03:25,880 OK, so in this case, for this adaptive value. 63 00:03:25,900 --> 00:03:28,630 So the minimum depth for this Binit is basically for. 64 00:03:29,620 --> 00:03:35,620 Now, let us do an example, let us consider an example and let us perform the laboratory, Wortzel. 65 00:03:35,680 --> 00:03:39,250 OK, so let us consider this example. 66 00:03:44,640 --> 00:03:46,640 OK, so let us consider this example. 67 00:03:47,100 --> 00:03:51,420 Now let us perform the level of the trials and so when we are performing LEVEL-HEADED Traversal, we 68 00:03:51,420 --> 00:03:51,780 knew that. 69 00:03:51,840 --> 00:03:54,600 Q Okay, so initially MICU will be empty. 70 00:03:55,200 --> 00:03:56,650 Initially my will be empty. 71 00:03:56,700 --> 00:04:02,420 OK, now what I will do so I will push the root node and it's left to lose its depth values basically. 72 00:04:02,490 --> 00:04:03,840 And so I will push two things. 73 00:04:04,410 --> 00:04:06,810 Sartwell is the root value and when is start depth. 74 00:04:06,990 --> 00:04:07,710 Very simple. 75 00:04:08,610 --> 00:04:11,230 Now, what I will do, our simple approach. 76 00:04:11,250 --> 00:04:14,220 OK, so what I will do so pop different element. 77 00:04:15,630 --> 00:04:22,200 Check so left exist, right exist, push them and their debit values basically do OK, so ablated up 78 00:04:22,200 --> 00:04:23,880 to value, which is true, and Bush. 79 00:04:24,540 --> 00:04:30,840 So I will push seven its debit values to I will push 51 its delta values basically to. 80 00:04:31,890 --> 00:04:39,150 OK, now again, Bob, different element, so seven is different element, now check so left. 81 00:04:39,200 --> 00:04:44,100 So first of all, I will adapt to adapt values basically three OK, so left exist. 82 00:04:44,100 --> 00:04:44,910 Right exist. 83 00:04:44,910 --> 00:04:45,480 Push them. 84 00:04:46,170 --> 00:04:47,850 So eat them that value three. 85 00:04:48,850 --> 00:04:51,650 I have nine and 12 is basically three. 86 00:04:51,740 --> 00:04:58,800 OK, now again, but I will pop different elements of 51 and two, so I will update them to adapt to 87 00:04:58,810 --> 00:04:59,430 a loose three. 88 00:04:59,470 --> 00:05:00,870 OK, left exist. 89 00:05:00,890 --> 00:05:02,260 No, right exist. 90 00:05:02,270 --> 00:05:02,530 Yes. 91 00:05:02,590 --> 00:05:03,580 So push seven. 92 00:05:03,580 --> 00:05:05,140 And that values basically three. 93 00:05:05,890 --> 00:05:08,470 So push seven and that values basically three. 94 00:05:09,020 --> 00:05:11,230 OK, now again what Bob. 95 00:05:11,350 --> 00:05:13,120 Different element eight and three. 96 00:05:13,540 --> 00:05:16,210 So I will update adaptively it'll become four. 97 00:05:16,210 --> 00:05:17,690 So check left exists. 98 00:05:17,950 --> 00:05:18,220 Right. 99 00:05:18,220 --> 00:05:19,570 Existant also pushpin. 100 00:05:20,600 --> 00:05:27,980 That values for OK now a different element, main commentary, so I will update the to values or values 101 00:05:27,980 --> 00:05:30,230 basically for now Jack left exists. 102 00:05:30,230 --> 00:05:31,260 No right exists. 103 00:05:31,340 --> 00:05:36,590 So Bush dual debit values basically for OK now pop different elements. 104 00:05:36,630 --> 00:05:37,430 Seven commentary. 105 00:05:37,700 --> 00:05:41,270 OK, so this is seven different element left exist. 106 00:05:41,270 --> 00:05:42,570 No right exist. 107 00:05:42,640 --> 00:05:42,850 No. 108 00:05:43,010 --> 00:05:44,480 So basically this is a Leaford. 109 00:05:45,920 --> 00:05:48,170 Left do not exist, right do not exist. 110 00:05:48,200 --> 00:05:49,850 So what I will do, I will stop. 111 00:05:50,990 --> 00:05:55,970 And what I said in my answer will be three, OK, my answer will be three. 112 00:05:57,620 --> 00:06:03,980 I will stop as soon as we encounter a leaf node, and my answer will be basically that that will do 113 00:06:04,010 --> 00:06:04,900 so, which is tree. 114 00:06:05,240 --> 00:06:07,240 OK, so this is simple. 115 00:06:07,610 --> 00:06:12,130 The driver said, OK, so this is the level of the traversal implementation problem. 116 00:06:12,230 --> 00:06:15,570 OK, this is simply traversal implementation problem. 117 00:06:16,280 --> 00:06:20,090 Now since you have understood the logic, so I think we can now write the call. 118 00:06:20,120 --> 00:06:22,550 OK, so now let's write the code. 119 00:06:23,000 --> 00:06:28,280 So before writing the code, now let us discuss what is the time and the space complexity. 120 00:06:28,580 --> 00:06:30,770 So basically what to with the time complexity. 121 00:06:30,800 --> 00:06:36,830 So again, this is simple, but I wasn't a big orphan and the space complexity also big often. 122 00:06:37,040 --> 00:06:40,520 OK, so this is the time and the space complexity for this solution. 123 00:06:41,600 --> 00:06:43,020 Now you can see yourself. 124 00:06:43,040 --> 00:06:47,040 So basically the level of the traversal is basically iterative traversal. 125 00:06:47,090 --> 00:06:47,450 OK. 126 00:06:48,730 --> 00:06:55,560 Laboratory attitude reversal in the space complexities, this one, and where is the order preordained 127 00:06:55,570 --> 00:06:56,510 Bulstrode reversal. 128 00:06:56,530 --> 00:07:02,020 So in order to bring order and the poster traversal, so their time complexity is also this much, but 129 00:07:02,200 --> 00:07:04,800 they are all recursive approach, OK? 130 00:07:05,580 --> 00:07:07,090 They are all recursive approach. 131 00:07:07,360 --> 00:07:15,130 So basically the laboratory, it uses glue, it uses glue as data structure and all these traversal 132 00:07:15,130 --> 00:07:16,690 basically use stack. 133 00:07:18,000 --> 00:07:24,630 I asked you to structure, OK, so this is the difference between the level reversals and all these 134 00:07:24,990 --> 00:07:25,650 reversals. 135 00:07:25,680 --> 00:07:28,630 OK, time, complexity and space complexity, they are the same. 136 00:07:28,860 --> 00:07:30,090 So this is 881. 137 00:07:30,090 --> 00:07:31,400 All these three are recursive. 138 00:07:31,530 --> 00:07:34,140 It uses skill and it uses a stack, OK. 139 00:07:34,460 --> 00:07:37,070 So now let's write the code for this problem. 140 00:07:37,110 --> 00:07:39,060 OK, minimum adaptive ability. 141 00:07:39,270 --> 00:07:41,970 So as you can see, I have to store two things inside the. 142 00:07:42,460 --> 00:07:45,220 OK, I have to store two things inside the queue. 143 00:07:45,250 --> 00:07:47,030 So let us construct the structure. 144 00:07:47,190 --> 00:07:50,670 What you can see a class so I will construct a class. 145 00:07:50,670 --> 00:07:54,960 Glass will contain two things the order value and basically the that. 146 00:07:56,100 --> 00:07:59,480 OK, northern, that I have to say two things, OK? 147 00:08:00,610 --> 00:08:07,410 So fostering two things, I have options, so what I can do, I can construct a bed or I can use the 148 00:08:07,750 --> 00:08:11,110 bed or I can use I can construct my own bed. 149 00:08:11,140 --> 00:08:12,980 So let us construct our own bed. 150 00:08:13,000 --> 00:08:15,220 OK, so let's name it item. 151 00:08:17,210 --> 00:08:20,440 So itemise store this item. 152 00:08:20,750 --> 00:08:23,770 It will be stored now, it will contain two things. 153 00:08:23,780 --> 00:08:26,030 First is the node. 154 00:08:26,900 --> 00:08:29,180 So PNTR, let's call it not only. 155 00:08:30,980 --> 00:08:34,010 And secondly, it will contain the depth, so depth will be in. 156 00:08:36,210 --> 00:08:37,080 Now, what I will do. 157 00:08:38,350 --> 00:08:43,390 So now let us complete this function return represented here and then put is basically a tree. 158 00:08:44,140 --> 00:08:46,260 OK, so what I have to do again, the best case. 159 00:08:46,270 --> 00:08:48,480 So basically if the root canal. 160 00:08:50,030 --> 00:08:54,720 So Rudimental, that means the tree does not exist, so if tree does not exist. 161 00:08:55,010 --> 00:08:56,480 So what will that mean? 162 00:08:56,630 --> 00:08:57,620 That will be zero. 163 00:08:57,770 --> 00:09:00,680 OK, now let us construct a Q. 164 00:09:01,680 --> 00:09:07,930 So this time, I will not construct queue of Renauld that this will be wrong because I have to start 165 00:09:07,960 --> 00:09:08,330 putting. 166 00:09:08,520 --> 00:09:09,990 OK, so first two things. 167 00:09:09,990 --> 00:09:12,020 I have constructed this structure. 168 00:09:12,570 --> 00:09:16,890 So what I will write, so I will construct Q off two item. 169 00:09:18,600 --> 00:09:24,900 OK, so this one item I'm constructing, Q of Q item, OK, so let's name it. 170 00:09:24,930 --> 00:09:25,260 Q. 171 00:09:26,740 --> 00:09:28,600 Now, let us construct a quantum. 172 00:09:30,470 --> 00:09:39,860 So this item, let's name it, basically Q Guey, OK, so it will contain two things root and the depth 173 00:09:39,890 --> 00:09:41,320 of root is basically one. 174 00:09:41,600 --> 00:09:44,510 OK, now let us push the first element inside that. 175 00:09:44,710 --> 00:09:45,110 So good. 176 00:09:45,110 --> 00:09:45,620 Not push. 177 00:09:46,590 --> 00:09:47,040 QE. 178 00:09:47,110 --> 00:09:48,780 OK, QE. 179 00:09:49,840 --> 00:09:51,520 So what I'm doing here is basically. 180 00:09:52,770 --> 00:09:58,560 So what I have to do, I have to push the first element, OK, so I am pushing three trees, the particularly 181 00:09:58,560 --> 00:10:01,960 the root element, so I have to push through, baptise one. 182 00:10:02,050 --> 00:10:04,620 OK, so this is basically a item. 183 00:10:06,240 --> 00:10:11,510 This is a great time, you can see this is a key item, the name is basically Kuai, you can name it 184 00:10:11,520 --> 00:10:14,880 anything and I am pushing this item inside the queue. 185 00:10:15,160 --> 00:10:18,510 OK, I am pushing this item inside the queue. 186 00:10:20,060 --> 00:10:25,700 Now, let us start our laboratory traversal, OK, so I was standard cold for LEVEL-HEADED traversal. 187 00:10:26,760 --> 00:10:28,470 So while the queue is not empty. 188 00:10:31,340 --> 00:10:33,650 What we have to do, we have to find a leaf node. 189 00:10:34,340 --> 00:10:38,360 OK, so let us get the first element, OK, so. 190 00:10:40,120 --> 00:10:40,500 Item. 191 00:10:41,530 --> 00:10:44,080 Let's call it first, let's call it friend. 192 00:10:44,110 --> 00:10:46,180 OK, so this will be basically culotte friend. 193 00:10:49,120 --> 00:10:50,980 And then we have to do culotte Bob. 194 00:10:52,030 --> 00:10:53,000 OK, good. 195 00:10:53,020 --> 00:10:54,220 OUTFRONT tonight, Bob. 196 00:10:55,600 --> 00:10:57,310 So now let's find out, Donald. 197 00:10:58,530 --> 00:10:59,640 So what is Donald? 198 00:11:00,660 --> 00:11:04,080 So it is basically, let's call it north. 199 00:11:04,120 --> 00:11:05,560 So this is basically so. 200 00:11:06,460 --> 00:11:06,950 If. 201 00:11:07,030 --> 00:11:11,370 OK, so what I will write, so this is f dot naude. 202 00:11:11,950 --> 00:11:14,480 OK, so this one after a.. 203 00:11:14,720 --> 00:11:18,610 OK, after not and let us also find out depth that. 204 00:11:18,640 --> 00:11:21,450 OK, so in depth. 205 00:11:21,580 --> 00:11:24,220 So this is basically f dot net. 206 00:11:25,960 --> 00:11:32,950 If not that, OK, now what I will also check whether this node check whether this node is leaf node 207 00:11:32,950 --> 00:11:33,340 or not. 208 00:11:33,370 --> 00:11:39,290 OK, so if leaf node, so basically the left and right, they both will be null. 209 00:11:39,400 --> 00:11:42,010 OK, so if left is null. 210 00:11:44,870 --> 00:11:46,690 And basically, right is also null. 211 00:11:47,000 --> 00:11:49,550 OK, so not the error rate. 212 00:11:51,620 --> 00:11:58,110 Is also tunnel, then this is basically Leelanau, so if this is not what I can do, so I can read and 213 00:11:58,130 --> 00:11:58,500 adapt. 214 00:11:58,790 --> 00:12:03,920 OK, so this one I can do that because that will be my answer. 215 00:12:03,950 --> 00:12:04,270 OK. 216 00:12:05,380 --> 00:12:12,850 So what I am doing here is I am checking for Liefeld, so my target was to find if not and if I find 217 00:12:12,850 --> 00:12:17,620 out the lymph node, I can return it, that otherwise I was turned up left and right exist. 218 00:12:17,660 --> 00:12:17,980 OK. 219 00:12:19,320 --> 00:12:25,980 So our standard approach is basically what I will do, so check left exist, then Bush left. 220 00:12:28,390 --> 00:12:32,330 So if left exist, then what I have to do so. 221 00:12:32,460 --> 00:12:34,430 So let us construct an item, OK? 222 00:12:34,450 --> 00:12:38,590 So I have this item, let's name it basically a. 223 00:12:39,980 --> 00:12:45,800 So what its value and so the value will be, so the note will be no right or left and the debate will 224 00:12:45,800 --> 00:12:47,830 be so this debt plus one, OK? 225 00:12:48,890 --> 00:12:50,510 So this depth plus one. 226 00:12:51,570 --> 00:12:58,410 Simple and then what I will do you not push this item is a simple. 227 00:12:59,500 --> 00:13:03,460 Now we will do the same thing for the right one, for the right separately. 228 00:13:03,520 --> 00:13:03,870 OK. 229 00:13:06,290 --> 00:13:14,180 So basically, the right exist, so if that exist, construct a new item, so the node will be right 230 00:13:14,780 --> 00:13:19,580 and that is again that plus one and Geldart wish a simple. 231 00:13:20,240 --> 00:13:21,890 So this is the complete code. 232 00:13:21,890 --> 00:13:22,960 I think they should work fine. 233 00:13:22,960 --> 00:13:23,170 OK. 234 00:13:23,900 --> 00:13:27,800 So in order to submit first we will run our code and then we will submit. 235 00:13:27,980 --> 00:13:28,310 OK. 236 00:13:32,950 --> 00:13:36,100 OK, so this is an excited, convolutional, OK? 237 00:13:41,930 --> 00:13:45,260 So Q I don't mind getting a read this line. 238 00:13:48,410 --> 00:13:54,320 OK, so basically what we are getting so we are getting the compilation error because that it was integer, 239 00:13:54,340 --> 00:13:55,730 so I have to return something. 240 00:13:55,760 --> 00:13:58,190 OK, so I have to return something. 241 00:13:59,250 --> 00:14:00,300 Now, let's return. 242 00:14:01,870 --> 00:14:04,240 A garbage value, so let us return zero. 243 00:14:04,330 --> 00:14:04,690 OK? 244 00:14:06,090 --> 00:14:12,990 So although this line will never get executed, OK, this will never get executed, but this is due 245 00:14:12,990 --> 00:14:14,760 to the completion purpose. 246 00:14:14,790 --> 00:14:18,620 OK, so this is only due to completion purposes. 247 00:14:18,630 --> 00:14:19,800 We have to return something. 248 00:14:21,330 --> 00:14:22,980 Because they don't have the function is in. 249 00:14:25,020 --> 00:14:26,280 So I have to return something. 250 00:14:32,380 --> 00:14:33,730 Now, let us Amitabha, good. 251 00:14:39,170 --> 00:14:44,460 OK, so our goal is working fine now let us take a small example and let us write a novel code. 252 00:14:44,480 --> 00:14:45,160 What is happening? 253 00:14:45,170 --> 00:14:48,180 OK, so let's take a very small example. 254 00:14:48,200 --> 00:14:53,270 So three nine 20, the example given in the question, OK, 15 and seven. 255 00:14:53,660 --> 00:15:03,590 So what I'm doing so construct a Q item, construct a Q of the data type Kuwata, so construct a Q item 256 00:15:03,590 --> 00:15:04,250 and then push. 257 00:15:04,280 --> 00:15:05,750 So basically if this is the Q. 258 00:15:06,930 --> 00:15:11,370 So I am pushing three Gormogon, OK, I am pushing through Gormogon. 259 00:15:13,610 --> 00:15:19,190 OK, now, while the queue is not empty, so the queue is not empty, get different element and pop. 260 00:15:19,390 --> 00:15:20,390 OK, so Bob. 261 00:15:21,320 --> 00:15:24,920 So basically, what is F so F is basically three Guaman. 262 00:15:26,440 --> 00:15:28,330 Now, it is basically Edward not. 263 00:15:28,600 --> 00:15:37,210 So this is not and this is after that, so basically the node is basically three and that is basically 264 00:15:37,210 --> 00:15:40,600 one, OK, now left and right exist. 265 00:15:40,600 --> 00:15:43,970 So for three, left exist and right exist. 266 00:15:43,990 --> 00:15:45,400 So this condition is false. 267 00:15:45,790 --> 00:15:46,390 Move ahead. 268 00:15:46,600 --> 00:15:52,650 So if left exist, construct a new item and push the left and the a value plus one. 269 00:15:52,660 --> 00:15:55,540 OK, so that value plus one. 270 00:15:55,540 --> 00:15:58,810 So that will become to construct a new item. 271 00:15:59,020 --> 00:16:02,810 So it will be basically first three years left. 272 00:16:02,880 --> 00:16:05,140 OK, so three arrow left which is nine. 273 00:16:05,750 --> 00:16:07,900 So I will push nine Khama two. 274 00:16:08,650 --> 00:16:10,540 So push nine Komada inside the cube. 275 00:16:10,550 --> 00:16:11,680 So I have nine. 276 00:16:14,100 --> 00:16:19,780 Now getting check for the ride, so right is basically to write this basically 20, so I will push it. 277 00:16:20,160 --> 00:16:23,840 So it is a is basically going Takamatsu. 278 00:16:24,510 --> 00:16:26,070 So Bush during the Commodore. 279 00:16:28,190 --> 00:16:33,710 20 comida, OK, grundy's the root value and two is basically the debt. 280 00:16:34,580 --> 00:16:37,850 Now again, while the queue is not empty, queue is not empty. 281 00:16:38,180 --> 00:16:39,320 Bob, different element. 282 00:16:39,950 --> 00:16:43,290 So different element this time around is basically OK. 283 00:16:43,310 --> 00:16:44,330 So this is friend. 284 00:16:45,600 --> 00:16:48,030 So is basically nine to. 285 00:16:49,380 --> 00:16:56,760 Now, the Norder value is basically F Naude, which is nine LDAP values, basically after that, which 286 00:16:56,760 --> 00:16:58,190 is two again. 287 00:16:58,650 --> 00:17:01,550 So this time Majak for nine left is not right. 288 00:17:02,370 --> 00:17:03,030 So left. 289 00:17:03,060 --> 00:17:04,680 Mesnil right is nil. 290 00:17:04,980 --> 00:17:06,770 So basically this condition is true. 291 00:17:07,230 --> 00:17:08,150 This condition is true. 292 00:17:08,190 --> 00:17:08,910 But I will return. 293 00:17:08,910 --> 00:17:09,680 I will return that. 294 00:17:10,079 --> 00:17:11,569 What is the depth and baptista. 295 00:17:11,819 --> 00:17:13,170 So I will return to. 296 00:17:14,130 --> 00:17:14,890 I will return to. 297 00:17:14,910 --> 00:17:19,930 And two is the correct answer for this binary twisty correct answer for discriminately. 298 00:17:19,950 --> 00:17:22,260 OK, so I am returning to here. 299 00:17:23,250 --> 00:17:24,540 You can see done that. 300 00:17:25,770 --> 00:17:30,930 So basically, that's how the school is working and as discussed, their time complexities big often 301 00:17:30,930 --> 00:17:33,360 and the space complexity is also big often. 302 00:17:33,450 --> 00:17:33,770 OK. 303 00:17:36,120 --> 00:17:42,600 So basically, this line will never get executed because we will always have a leaf out of a tree will 304 00:17:42,600 --> 00:17:48,600 always exist, so this line will never get executed because as we know, the meaning of a tree, the 305 00:17:48,600 --> 00:17:50,850 leaf node of the tree will exist. 306 00:17:51,000 --> 00:17:56,490 OK, but this line is important for the completion purposes because they don't have the function is 307 00:17:56,490 --> 00:17:57,290 basically integer. 308 00:17:57,300 --> 00:18:01,110 So we have to return something, otherwise the completion will be delayed. 309 00:18:01,140 --> 00:18:01,470 OK. 310 00:18:02,570 --> 00:18:05,000 So if you have any doubt in this question, you can ask me. 311 00:18:05,060 --> 00:18:06,290 OK, thank you.