WEBVTT 00:00.270 --> 00:03.200 In this video we will show an allegory that can sort narey. 00:03.210 --> 00:07.420 This is not one of the classic algorithms like babblers short or quicksort. 00:07.470 --> 00:09.560 I'm not even sure if this hologram has a name. 00:09.610 --> 00:15.150 There was of this video instead of creating our own algorithm in order to develop our Gorean be. 00:15.750 --> 00:19.380 The goal here is to sort of the narey in the soul descending order. 00:19.410 --> 00:28.070 What specifically have the put 4 8 0 7 12 and minus 1 with the name tepes we will get this out here. 00:28.090 --> 00:29.820 The here is not just words. 00:29.910 --> 00:35.010 These are going to wachs but to develop your own narcotic during this video you can learn a process 00:35.160 --> 00:37.560 that helps you develop a new al good. 00:37.680 --> 00:38.790 I want to glorify that. 00:38.790 --> 00:41.390 This is not the optimal allegoric for assaulting carteret. 00:41.400 --> 00:44.310 It is as use as an example for practice reasons. 00:44.310 --> 00:48.480 The first idea that we can think is to create a new party that will have the same size. 00:48.480 --> 00:53.830 Indeed the Final Four would have gone down all the numbers in D in order so I would call this a Virgo. 00:53.850 --> 00:59.080 They need to find the maximum number of the original added seeps into it into a bigger out. 00:59.130 --> 01:03.570 Then you can delete these number from toups in the next phase you will find again the maximum number 01:03.630 --> 01:07.820 of thing you are three tips and you will delete after you have saved in the big three. 01:07.860 --> 01:12.770 So the numbers from the tips had a really been run by one from the largest to the smallest ending. 01:12.760 --> 01:15.680 Bigger is getting bigger and bigger one at a time. 01:15.720 --> 01:21.300 This process needs to be repeated for end times where n is this size of tepes Added in the neveda one 01:21.300 --> 01:25.830 of these laws rules kind of tepe salary that remains to find the maximum number. 01:25.860 --> 01:29.160 So for various That would create the follow up from zero to N. 01:29.200 --> 01:30.620 Indeed never do one of them. 01:30.630 --> 01:32.720 We need to calculate the maximum number. 01:32.810 --> 01:37.620 If you remember from previous videos you needed to calculate the maximum number we need to initialize 01:37.620 --> 01:39.090 it with the first point of the array. 01:39.120 --> 01:45.290 So Mark C is equal to the troops in the position 0 and we need to see the corresponding position so 01:45.570 --> 01:47.170 ferry sequel does it. 01:47.250 --> 01:50.080 Then I will have a look that is from 0 of course. 01:50.130 --> 01:51.120 N minus. 01:51.450 --> 01:53.840 Because at first it is equal to zero. 01:53.880 --> 01:57.090 So we will have the whole array then icicle to 1. 01:57.150 --> 02:02.870 So we will have all the array except the last point until one intenational one of these lobes. 02:02.900 --> 02:06.030 We will include the code that calculate the maximum number. 02:06.030 --> 02:12.090 So if muggsy is less then tips off the point then thing your Maxin you seek will add to the tepes say. 02:12.150 --> 02:14.190 And of course vary is equal to g. 02:14.190 --> 02:20.030 Finally the most important part of this for law is to see within your marks some number in the big RV. 02:20.040 --> 02:20.740 So very good. 02:20.760 --> 02:25.720 Don't bent max by them ends you need to delete these point from the tips. 02:25.750 --> 02:26.830 Are they so dense. 02:26.840 --> 02:29.240 You've seen the position fairly yet. 02:29.310 --> 02:30.160 By and large. 02:30.240 --> 02:32.810 If you tried to implement this in any programming language. 02:32.850 --> 02:34.040 It will work perfectly. 02:34.050 --> 02:35.340 Again that can be wrong. 02:35.370 --> 02:37.770 This is not an optimize allegoric for assaulting. 02:38.010 --> 02:38.390 This is. 02:38.390 --> 02:43.440 As for practicing your skills especially the skills that enables you to solve a problem in finding your 02:43.470 --> 02:44.430 algorithm. 02:44.490 --> 02:48.920 As always we will first and this allows the ARI and then find the length of the arrow. 02:49.040 --> 02:52.830 We can name these Harry types and then you Berger. 02:54.060 --> 03:01.320 As we already talked about in the analysis we will do a follow up in that ain't from this zero to the 03:01.320 --> 03:03.650 end of the RV n in the column. 03:03.730 --> 03:09.240 We we're billing this allows the maximum number which is suquamish to their first point of the idea 03:09.450 --> 03:16.970 in their positions zero and fairie which is the position of the maximum number I should call digital. 03:16.980 --> 03:23.890 Then I will create the second look for it to be in that Aints zero cormark N minus. 03:24.240 --> 03:26.480 Again from the analysis. 03:26.960 --> 03:34.710 If now we need to calculate the maximum number so the maximum number is less than that keeps number 03:34.860 --> 03:35.810 in the position. 03:36.450 --> 03:39.910 We need to pertain to the maximum number in use. 03:40.080 --> 03:44.330 The new one saw maximum number now is equal to troops. 03:44.340 --> 03:51.890 This puts you on and off course fairy that their last position you see quote a day or two is a position. 03:52.020 --> 03:57.180 Now verga not a band gods will want to see the annual number with the max. 03:57.310 --> 04:04.030 So we when that the lead to the odd number saw Delta seeps in the positive you see on Fed. 04:04.650 --> 04:05.780 Let's bring this out. 04:07.800 --> 04:09.230 Everything seems correct. 04:09.300 --> 04:14.660 OK so we can put in the tip Saray in order to see that we don't have numbers anymore are there. 04:14.670 --> 04:17.720 As we already talked about your analysis again.