title
7.13 Radix Sort - Easiest explanation with Code | Sorting Algorithms | Data Structures Tutorials

description
Discussed Radix sort with its code, Analysis of Radix Sort. Step by step instructions showing how Radix Sort works. DSA Full Course: https: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bbKJzrsKfMpo_grxuLl8LU ****************************************** See Complete Playlists: C Programming Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31a8UcMN9-35ghv8qyFWD9_S C++ Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YU5Wx1dopka58teWP9aCee Python Full Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31bZSiqiOL5ta39vSnBxpOPT Printing Pattern in C: https://www.youtube.com/playlist?list=PLdo5W4Nhv31Yu1igxTE2x0aeShbKtVcCy DAA Course: https://www.youtube.com/playlist?list=PLdo5W4Nhv31ZTn2P9vF02bkb3SC8uiUUn Placement Series: https://www.youtube.com/playlist?list=PLdo5W4Nhv31YvlDpJhvOYbM9Ap8UypgEy Dynamic Programming: https://www.youtube.com/playlist?list=PLdo5W4Nhv31aBrJE1WS4MR9LRfbmZrAQu Operating Systems: //www.youtube.com/playlist?list=PLdo5W4Nhv31a5ucW_S1K3-x6ztBRD-PNa DBMS: https://www.youtube.com/playlist?list=PLdo5W4Nhv31b33kF46f9aFjoJPOkdlsRc ************************************************** Connect & Contact Me: Facebook: https://www.facebook.com/Jennys-Lectures-CSIT-Netjrf-316814368950701/ Quora: https://www.quora.com/profile/Jayanti-Khatri-Lamba Instagram: https://www.instagram.com/jayantikhatrilamba/ #sortingalgorithm #radixsort #dsa #jennyslectures

detail
{'title': '7.13 Radix Sort - Easiest explanation with Code | Sorting Algorithms | Data Structures Tutorials', 'heatmap': [{'end': 538.206, 'start': 471.73, 'weight': 0.895}, {'end': 1273.082, 'start': 1208.766, 'weight': 0.821}, {'end': 1771.441, 'start': 1702.752, 'weight': 0.821}], 'summary': 'Discusses the application and implementation of counting sort as a subroutine in radix sort, covering topics such as sorting elements based on one digit, updating array indexes, and modifying for loop logic for counting digit frequency, highlighting the time and space complexity of radix sort.', 'chapters': [{'end': 181.847, 'segs': [{'end': 46.024, 'src': 'embed', 'start': 21.889, 'weight': 4, 'content': [{'end': 28.393, 'text': "if you don't know the working of counting sort, then it would be very tough for you, i guess, to understand this radix sort.", 'start': 21.889, 'duration': 6.504}, {'end': 31.195, 'text': 'so first of all, go through that video.', 'start': 28.393, 'duration': 2.802}, {'end': 32.595, 'text': 'so let us take this example.', 'start': 31.195, 'duration': 1.4}, {'end': 34.277, 'text': 'we are going to take this array.', 'start': 32.595, 'duration': 1.682}, {'end': 38.279, 'text': 'fine, number of elements are 10 and we are going to apply radix sort on this array.', 'start': 34.277, 'duration': 4.002}, {'end': 43.722, 'text': 'why we cannot apply counting sort on such kind of array that i have already discussed in the previous video?', 'start': 38.279, 'duration': 5.443}, {'end': 46.024, 'text': 'fine, what are the drawbacks of counting sort?', 'start': 43.722, 'duration': 2.302}], 'summary': 'Understanding counting sort is crucial for grasping radix sort. discusses application on an array of 10 elements and the drawbacks of counting sort.', 'duration': 24.135, 'max_score': 21.889, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp021889.jpg'}, {'end': 82.647, 'src': 'embed', 'start': 57.13, 'weight': 1, 'content': [{'end': 65.322, 'text': 'in this case, counting sort would be applied digit by digit according to the place value of the digit.', 'start': 57.13, 'duration': 8.192}, {'end': 69.664, 'text': 'see like we have three digits in this.', 'start': 65.322, 'duration': 4.342}, {'end': 71.864, 'text': 'let us suppose we are going to take this one, 199.', 'start': 69.664, 'duration': 2.2}, {'end': 73.265, 'text': 'so we are having three digits.', 'start': 71.864, 'duration': 1.401}, {'end': 82.647, 'text': 'so three time counting sort would be applied, first of all on this nine, then this nine, then this one according to the place value.', 'start': 73.265, 'duration': 9.382}], 'summary': 'Using counting sort for three-digit number 199, sorting digit by digit based on place value.', 'duration': 25.517, 'max_score': 57.13, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp057130.jpg'}, {'end': 156.592, 'src': 'embed', 'start': 103.602, 'weight': 0, 'content': [{'end': 113.207, 'text': 'you cannot apply on the most significant bit and go to least significant bit because that in that case the array would not be sorted.', 'start': 103.602, 'duration': 9.605}, {'end': 122.37, 'text': 'if numbers are given, if in the strings values are given, names are given, in that case you apply from msb to lsp.', 'start': 113.207, 'duration': 9.163}, {'end': 127.692, 'text': 'but in case of integers or numbers, you are going to apply from lsb to msb.', 'start': 122.37, 'duration': 5.322}, {'end': 128.412, 'text': 'in this direction.', 'start': 127.692, 'duration': 0.72}, {'end': 130.853, 'text': 'we are going to apply counting sort.', 'start': 128.412, 'duration': 2.441}, {'end': 138.115, 'text': 'fine, so first of all, how many, how many times counting sort would be applied that you have to count?', 'start': 130.853, 'duration': 7.262}, {'end': 140.829, 'text': 'so, out of given array?', 'start': 139.167, 'duration': 1.662}, {'end': 145.015, 'text': 'first thing is you have to find out the maximum data in this array.', 'start': 140.829, 'duration': 4.186}, {'end': 154.171, 'text': 'the maximum data is what 677 and count how many digits are there in the maximum data one, two and three digits.', 'start': 145.015, 'duration': 9.156}, {'end': 156.592, 'text': 'so how many times counting sort would be applied?', 'start': 154.171, 'duration': 2.421}], 'summary': 'Apply counting sort from lsb to msb for integers, count max data digits.', 'duration': 52.99, 'max_score': 103.602, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0103602.jpg'}], 'start': 0.129, 'title': 'Counting sort and radix sort', 'summary': 'Discusses the prerequisite of understanding counting sort as a sub routine in radix sort and explains the application of counting sort by place value using the example of a three-digit number (199) and its application to a given array with a maximum of three digits.', 'chapters': [{'end': 57.13, 'start': 0.129, 'title': 'Radix sort and counting sort', 'summary': "Discusses the prerequisite of understanding counting sort as a sub routine in radix sort, advising viewers to refer to a previous video to grasp counting sort's working before delving into radix sort, which is illustrated using an example array of 10 elements.", 'duration': 57.001, 'highlights': ['The chapter emphasizes the importance of understanding counting sort as a prerequisite for comprehending radix sort, urging viewers to refer to a previous video before delving into radix sort.', 'The video advises viewers to watch a linked tutorial on counting sort before proceeding with radix sort to ensure a better understanding of the concepts.', 'The example array of 10 elements is used to illustrate the application of radix sort, emphasizing the practical implementation of the sorting algorithm.']}, {'end': 103.602, 'start': 57.13, 'title': 'Counting sort by place value', 'summary': 'Explains the application of counting sort by place value, using the example of a three-digit number (199) and applying counting sort three times according to the place value of each digit, starting from the least significant bit to the most significant bit.', 'duration': 46.472, 'highlights': ['Counting sort is applied digit by digit according to the place value of the digit, as demonstrated with the example of a three-digit number (199).', 'The sorting process starts from the least significant bit and progresses towards the most significant bit.']}, {'end': 181.847, 'start': 103.602, 'title': 'Counting sort application', 'summary': 'Introduces the application of counting sort, emphasizing the need to count the maximum number of digits in the given array, which is 3, and then making all numbers three-digit numbers by adding leading zeros.', 'duration': 78.245, 'highlights': ["The maximum data in the array is 677 and has three digits, indicating the need to apply counting sort three times. {'maximum_number': 677, 'number_of_digits': 3, 'counting_sort_applications': 3}", "The process involves making all numbers three-digit by adding leading zeros, ensuring uniformity for applying counting sort. {'original_numbers': [8], 'modified_numbers': [800], 'total_numbers_modified': 4}"]}], 'duration': 181.718, 'thumbnail': '', 'highlights': ['The maximum data in the array is 677 and has three digits, indicating the need to apply counting sort three times.', 'The process involves making all numbers three-digit by adding leading zeros, ensuring uniformity for applying counting sort.', 'Counting sort is applied digit by digit according to the place value of the digit, as demonstrated with the example of a three-digit number (199).', 'The sorting process starts from the least significant bit and progresses towards the most significant bit.', 'The example array of 10 elements is used to illustrate the application of radix sort, emphasizing the practical implementation of the sorting algorithm.']}, {'end': 467.669, 'segs': [{'end': 213.934, 'src': 'embed', 'start': 181.847, 'weight': 0, 'content': [{'end': 185.992, 'text': 'now. next step is what you are supposed to apply now, the counting sort.', 'start': 181.847, 'duration': 4.145}, {'end': 193.276, 'text': 'now i am going to show you how actually count sort would be applied in redix sort.', 'start': 185.992, 'duration': 7.284}, {'end': 195.758, 'text': 'so three passes would be there now.', 'start': 193.276, 'duration': 2.482}, {'end': 197.019, 'text': 'first pass.', 'start': 195.758, 'duration': 1.261}, {'end': 198.04, 'text': 'in first pass.', 'start': 197.019, 'duration': 1.021}, {'end': 203.745, 'text': 'you are going to apply count sort in on this place, value on the ones place.', 'start': 198.04, 'duration': 5.705}, {'end': 213.934, 'text': 'here you can say here, here on these key values, on the least significant bit we are going to apply the count sort.', 'start': 203.745, 'duration': 10.189}], 'summary': 'Applying counting sort in radix sort for three passes.', 'duration': 32.087, 'max_score': 181.847, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0181847.jpg'}, {'end': 262.86, 'src': 'embed', 'start': 234.182, 'weight': 1, 'content': [{'end': 236.884, 'text': 'so you are, you are going to take the range 0 to 9.', 'start': 234.182, 'duration': 2.702}, {'end': 238.525, 'text': 'so k value is 9.', 'start': 236.884, 'duration': 1.641}, {'end': 241.447, 'text': 'so the size of this count array is what.', 'start': 238.525, 'duration': 2.922}, {'end': 243.849, 'text': 'so this is our count array.', 'start': 242.708, 'duration': 1.141}, {'end': 248.291, 'text': 'size is 10 and first of all, we are going to initialize this array with 0.', 'start': 243.849, 'duration': 4.442}, {'end': 249.892, 'text': 'now, what you are going to fill in this array?', 'start': 248.291, 'duration': 1.601}, {'end': 256.837, 'text': 'we are going to count, the count, the elements, the frequency of the elements, according to the distinct key values.', 'start': 249.892, 'duration': 6.945}, {'end': 258.618, 'text': 'fine, that i have discussed in count sort.', 'start': 256.837, 'duration': 1.781}, {'end': 262.86, 'text': 'that is why i am again and again saying please watch that video first of all.', 'start': 258.618, 'duration': 4.242}], 'summary': 'Using count array of size 10 to count element frequencies from 0 to 9.', 'duration': 28.678, 'max_score': 234.182, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0234182.jpg'}, {'end': 361.296, 'src': 'embed', 'start': 336.303, 'weight': 2, 'content': [{'end': 345.01, 'text': 'see, in this case, 9 is only one time at the once place only because now we are applying the count sort on the one digit only.', 'start': 336.303, 'duration': 8.707}, {'end': 348.866, 'text': 'fine, now you are going to update this count array.', 'start': 345.01, 'duration': 3.856}, {'end': 358.373, 'text': 'second step was you are going to update this count array and such that this count array would contains the actual position of these elements in the sorted array.', 'start': 348.866, 'duration': 9.507}, {'end': 361.296, 'text': 'fine, so how to update this count array?', 'start': 358.373, 'duration': 2.923}], 'summary': 'Applying count sort on one digit; updating count array for element positions.', 'duration': 24.993, 'max_score': 336.303, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0336303.jpg'}, {'end': 449.991, 'src': 'embed', 'start': 418.815, 'weight': 3, 'content': [{'end': 422.778, 'text': 'fine. so this is the actual position of these elements in the sorted.', 'start': 418.815, 'duration': 3.963}, {'end': 426.421, 'text': 'when you are going to find out the sorted array now.', 'start': 422.778, 'duration': 3.643}, {'end': 429.264, 'text': 'now, what you will do now we are going to build the output array.', 'start': 426.421, 'duration': 2.843}, {'end': 435.703, 'text': 'fine, we are going to sort these elements according to one digit only, that is according to this digit only.', 'start': 430.097, 'duration': 5.606}, {'end': 436.884, 'text': 'first of all.', 'start': 435.703, 'duration': 1.181}, {'end': 439.687, 'text': 'now you are going to build a array.', 'start': 436.884, 'duration': 2.803}, {'end': 440.729, 'text': 'now take another array.', 'start': 439.687, 'duration': 1.042}, {'end': 449.991, 'text': 'suppose i am going to take an array b and that array would be same as size array A, the original array given.', 'start': 440.729, 'duration': 9.262}], 'summary': 'Sorting elements in array a based on one digit.', 'duration': 31.176, 'max_score': 418.815, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0418815.jpg'}], 'start': 181.847, 'title': 'Count sort applications', 'summary': 'Explains applying count sort in radix sort and sorting elements based on one digit, using counts array of size 10 to count frequency of distinct key values ranging from 0 to 9 on the least significant bit and emphasizes the update and build processes with specific examples and numerical calculations.', 'chapters': [{'end': 256.837, 'start': 181.847, 'title': 'Applying count sort in radix sort', 'summary': 'Explains the application of counting sort in radix sort, with a focus on applying count sort in three passes, using a count array of size 10 to count the frequency of distinct key values ranging from 0 to 9 on the least significant bit.', 'duration': 74.99, 'highlights': ['The chapter explains the application of counting sort in radix sort, with a focus on applying count sort in three passes.', 'Using a count array of size 10 to count the frequency of distinct key values ranging from 0 to 9 on the least significant bit.', 'The size of the count array is determined by the range of key values, which is from 0 to 9, resulting in a count array size of 10.']}, {'end': 467.669, 'start': 256.837, 'title': 'Counting sort application in sorting', 'summary': 'Explains the application of counting sort in sorting elements based on one digit, with an emphasis on the update and build processes using specific examples and numerical calculations.', 'duration': 210.832, 'highlights': ['Counting sort applied on the least significant digit to sort elements based on one digit only. Illustrates the application of counting sort to sort elements based on one digit, highlighting the process of incrementing the count array based on the least significant digit.', 'Demonstration of updating the count array to contain the actual position of elements in the sorted array. Explains the process of updating the count array to determine the actual position of elements in the sorted array using specific examples and numerical calculations.', 'Explanation of building the output array to sort elements based on one digit only, maintaining the stability property of counting sort. Describes the process of building the output array to sort elements based on one digit only, emphasizing the importance of maintaining the stability property of counting sort through scanning the array from right to left.']}], 'duration': 285.822, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0181847.jpg', 'highlights': ['The chapter explains the application of counting sort in radix sort, with a focus on applying count sort in three passes.', 'Using a count array of size 10 to count the frequency of distinct key values ranging from 0 to 9 on the least significant bit.', 'Demonstration of updating the count array to contain the actual position of elements in the sorted array.', 'Explanation of building the output array to sort elements based on one digit only, maintaining the stability property of counting sort.']}, {'end': 818.372, 'segs': [{'end': 538.206, 'src': 'heatmap', 'start': 467.669, 'weight': 0, 'content': [{'end': 471.73, 'text': 'so go to the index 9 in count array and the value is 10.', 'start': 467.669, 'duration': 4.061}, {'end': 474.351, 'text': 'see, this is the updated count array.', 'start': 471.73, 'duration': 2.621}, {'end': 475.371, 'text': 'we are going to check this one.', 'start': 474.351, 'duration': 1.02}, {'end': 481.032, 'text': 'we are not going to check this one value is 10, but this is count.', 'start': 475.371, 'duration': 5.661}, {'end': 482.912, 'text': 'fine, and we are going to apply.', 'start': 481.032, 'duration': 1.88}, {'end': 486.393, 'text': 'we are going to work with, work with the indexes.', 'start': 482.912, 'duration': 3.481}, {'end': 489.194, 'text': 'so first of all, we will decrease this 10 minus 1.', 'start': 486.393, 'duration': 2.801}, {'end': 497.111, 'text': 'that is 9, and at 9th index you will put this number 199.', 'start': 489.194, 'duration': 7.917}, {'end': 499.852, 'text': 'so here you will put 199.', 'start': 497.111, 'duration': 2.741}, {'end': 501.513, 'text': 'this is index 9.', 'start': 499.852, 'duration': 1.661}, {'end': 504.094, 'text': 'fine, now, decrement i value.', 'start': 501.513, 'duration': 2.581}, {'end': 505.414, 'text': 'check out this number.', 'start': 504.094, 'duration': 1.32}, {'end': 506.515, 'text': 'key value 7.', 'start': 505.414, 'duration': 1.101}, {'end': 507.535, 'text': 'go to the index 7.', 'start': 506.515, 'duration': 1.02}, {'end': 508.315, 'text': 'value is 7.', 'start': 507.535, 'duration': 0.78}, {'end': 509.576, 'text': 'first, decrement this value.', 'start': 508.315, 'duration': 1.261}, {'end': 510.896, 'text': 'that is 6.', 'start': 509.576, 'duration': 1.32}, {'end': 516.808, 'text': 'now go to the index 6 and place this value 677.', 'start': 510.896, 'duration': 5.912}, {'end': 518.57, 'text': 'decrement again i value.', 'start': 516.808, 'duration': 1.762}, {'end': 519.611, 'text': 'here we have 5.', 'start': 518.57, 'duration': 1.041}, {'end': 521.533, 'text': 'go to the index 5.', 'start': 519.611, 'duration': 1.922}, {'end': 522.894, 'text': 'here we have 6.', 'start': 521.533, 'duration': 1.361}, {'end': 524.034, 'text': 'decrement this first of all.', 'start': 522.894, 'duration': 1.14}, {'end': 524.795, 'text': 'that is 5.', 'start': 524.034, 'duration': 0.761}, {'end': 526.217, 'text': 'go to index this 5.', 'start': 524.795, 'duration': 1.422}, {'end': 527.738, 'text': 'this is index 5.', 'start': 526.217, 'duration': 1.521}, {'end': 529.139, 'text': 'next is 1.', 'start': 527.738, 'duration': 1.401}, {'end': 530.18, 'text': 'go to the index 1.', 'start': 529.139, 'duration': 1.041}, {'end': 531.821, 'text': 'here is, we have 4.', 'start': 530.18, 'duration': 1.641}, {'end': 535.204, 'text': 'decrement this value at index 3 in this output array.', 'start': 531.821, 'duration': 3.383}, {'end': 538.206, 'text': 'place this value 0, 1, 1.', 'start': 535.204, 'duration': 3.002}], 'summary': 'Updating count array by decrementing and placing new values at specific indexes.', 'duration': 60.069, 'max_score': 467.669, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0467669.jpg'}, {'end': 656.391, 'src': 'embed', 'start': 629.212, 'weight': 2, 'content': [{'end': 635.158, 'text': 'you can just copy these elements into this array with applying a one for loop.', 'start': 629.212, 'duration': 5.946}, {'end': 637.2, 'text': 'fine, now, this is our updated array.', 'start': 635.158, 'duration': 2.042}, {'end': 639.122, 'text': 'now we are going to apply the count.', 'start': 637.2, 'duration': 1.922}, {'end': 644.627, 'text': 'sort again on which digit the digit which is at tens.', 'start': 639.122, 'duration': 5.505}, {'end': 647.33, 'text': 'place here this one second.', 'start': 644.627, 'duration': 2.703}, {'end': 652.989, 'text': 'this one same procedure would be followed for this digit.', 'start': 647.33, 'duration': 5.659}, {'end': 656.391, 'text': 'same, you are going to build this count array.', 'start': 652.989, 'duration': 3.402}], 'summary': 'Apply one for loop to update array and apply count.', 'duration': 27.179, 'max_score': 629.212, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0629212.jpg'}], 'start': 467.669, 'title': 'Array indexes and counting sort', 'summary': 'Explains updating array indexes by decrementing values and placing new numbers at specific indexes, with examples such as decrementing 10 to 9 at index 9 and placing 199, decrementing 7 to 6 at index 7 and placing 677. it also discusses the implementation of the counting sort algorithm, covering the process of sorting an array, updating the count array, and building the output array through detailed steps and examples.', 'chapters': [{'end': 608.153, 'start': 467.669, 'title': 'Updating array indexes', 'summary': 'Explains the process of updating array indexes by decrementing values and placing new numbers at specific indexes, with examples such as decrementing 10 to 9 at index 9 and placing 199, decrementing 7 to 6 at index 7 and placing 677, and similar operations for other indexes.', 'duration': 140.484, 'highlights': ['Decrementing 10 to 9 at index 9 and placing 199', 'Decrementing 7 to 6 at index 7 and placing 677', 'Decrementing 5 to 4 at index 3 and placing 231', 'Decrementing 2 to 1 at index 1 and placing 90', 'Decrementing 8 to 7 at index 2 and placing 432']}, {'end': 818.372, 'start': 608.153, 'title': 'Counting sort algorithm', 'summary': 'Discusses the implementation of the counting sort algorithm, covering the process of sorting an array, updating the count array, and building the output array through detailed steps and examples.', 'duration': 210.219, 'highlights': ['The chapter explains how to sort an array using the counting sort algorithm and demonstrates the process of updating the count array and building the output array with detailed steps and examples.', 'The counting sort algorithm involves initializing the count array with values, updating the count array to reflect the actual position of elements in the sorted array, and building the output array based on the updated count array.', 'The process of counting sort algorithm includes applying count sort on each digit, incrementing the count values at respective indices, and updating the count array to reflect the actual position of elements in the sorted array.']}], 'duration': 350.703, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0467669.jpg', 'highlights': ['Decrementing 10 to 9 at index 9 and placing 199', 'Decrementing 7 to 6 at index 7 and placing 677', 'The chapter explains how to sort an array using the counting sort algorithm and demonstrates the process of updating the count array and building the output array with detailed steps and examples.', 'The counting sort algorithm involves initializing the count array with values, updating the count array to reflect the actual position of elements in the sorted array, and building the output array based on the updated count array.', 'The process of counting sort algorithm includes applying count sort on each digit, incrementing the count values at respective indices, and updating the count array to reflect the actual position of elements in the sorted array.']}, {'end': 1294.485, 'segs': [{'end': 848.062, 'src': 'embed', 'start': 818.372, 'weight': 0, 'content': [{'end': 821.634, 'text': 'we are going to scan this array from right to left, see the after pass one.', 'start': 818.372, 'duration': 3.262}, {'end': 822.855, 'text': 'this is the updated array.', 'start': 821.634, 'duration': 1.221}, {'end': 825.997, 'text': 'we are not going to check this array now we are going to check this array.', 'start': 822.855, 'duration': 3.142}, {'end': 827.857, 'text': 'fine, now, scan this one.', 'start': 825.997, 'duration': 1.86}, {'end': 832.178, 'text': 'first of all eyes, at this place now we are applying count sort on this digit only.', 'start': 827.857, 'duration': 4.321}, {'end': 834.959, 'text': 'you are going to check this array, this digit only.', 'start': 832.178, 'duration': 2.781}, {'end': 836.119, 'text': 'here we have 9.', 'start': 834.959, 'duration': 1.16}, {'end': 840.12, 'text': 'so go to the index 9 in count array and value is 10.', 'start': 836.119, 'duration': 4.001}, {'end': 841.581, 'text': 'but first of all we will decrease this.', 'start': 840.12, 'duration': 1.461}, {'end': 848.062, 'text': 'that is 9, and in this output array, at 9th index, we are going to store this 199.', 'start': 841.581, 'duration': 6.481}], 'summary': 'Scanning and applying count sort to update and store values in the array.', 'duration': 29.69, 'max_score': 818.372, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0818372.jpg'}, {'end': 1040.573, 'src': 'embed', 'start': 988.927, 'weight': 1, 'content': [{'end': 989.828, 'text': 'increment this value.', 'start': 988.927, 'duration': 0.901}, {'end': 992.895, 'text': 'right. so this is now the count array.', 'start': 991.414, 'duration': 1.481}, {'end': 997.519, 'text': 'now we are going to update this count array just to reflect the actual position.', 'start': 992.895, 'duration': 4.624}, {'end': 1002.663, 'text': 'so now the updated count array would be see why we have five at zeroth index.', 'start': 997.519, 'duration': 5.144}, {'end': 1005.185, 'text': 'i guess you got the concept.', 'start': 1002.663, 'duration': 2.522}, {'end': 1007.166, 'text': 'see, we are applying this count sort here only.', 'start': 1005.185, 'duration': 1.981}, {'end': 1009.468, 'text': 'so zero at this place.', 'start': 1007.166, 'duration': 2.302}, {'end': 1010.869, 'text': 'how many times zero is there?', 'start': 1009.468, 'duration': 1.401}, {'end': 1014.359, 'text': 'one, two, 3, 4 and 5 times.', 'start': 1010.869, 'duration': 3.49}, {'end': 1015.6, 'text': 'that is why the count today.', 'start': 1014.359, 'duration': 1.241}, {'end': 1017.381, 'text': 'the frequency is 5 here.', 'start': 1015.6, 'duration': 1.781}, {'end': 1020.842, 'text': 'fine. so now we are going to update this count array.', 'start': 1017.381, 'duration': 3.461}, {'end': 1022.323, 'text': 'how to update this?', 'start': 1020.842, 'duration': 1.481}, {'end': 1026.285, 'text': 'first value would be, as it is 5 now, 5 plus 1.', 'start': 1022.323, 'duration': 3.962}, {'end': 1029.182, 'text': 'that is 6, 6 plus 1.', 'start': 1026.285, 'duration': 2.897}, {'end': 1036.631, 'text': '7, 7, 7 plus 1, 8, 8 plus 1, 9, 9 plus 1, 10, and here we have 10, 10 and 10.', 'start': 1029.182, 'duration': 7.449}, {'end': 1038.311, 'text': 'now this is our updated count array.', 'start': 1036.631, 'duration': 1.68}, {'end': 1040.573, 'text': 'now we are going to build the output array.', 'start': 1038.311, 'duration': 2.262}], 'summary': 'Implementing count sort with updated count array and frequency of 5 at zeroth index.', 'duration': 51.646, 'max_score': 988.927, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0988927.jpg'}, {'end': 1127.884, 'src': 'embed', 'start': 1097.597, 'weight': 5, 'content': [{'end': 1098.457, 'text': 'now. decrement this.', 'start': 1097.597, 'duration': 0.86}, {'end': 1099.378, 'text': 'here we have 6.', 'start': 1098.457, 'duration': 0.921}, {'end': 1100.258, 'text': 'go to index 6.', 'start': 1099.378, 'duration': 0.88}, {'end': 1100.979, 'text': 'value is 10.', 'start': 1100.258, 'duration': 0.721}, {'end': 1101.599, 'text': 'decrement this.', 'start': 1100.979, 'duration': 0.62}, {'end': 1102.54, 'text': 'that is 9.', 'start': 1101.599, 'duration': 0.941}, {'end': 1103.301, 'text': 'at 9th index.', 'start': 1102.54, 'duration': 0.761}, {'end': 1106.631, 'text': 'we are going to store 677 like this.', 'start': 1103.301, 'duration': 3.33}, {'end': 1110.814, 'text': 'you are going to follow the steps and now, finally, you get the sorted array.', 'start': 1106.631, 'duration': 4.183}, {'end': 1113.736, 'text': 'so now this is our output array after pass 3.', 'start': 1110.814, 'duration': 2.922}, {'end': 1116.858, 'text': 'as you can see, this array is now sorted.', 'start': 1113.736, 'duration': 3.122}, {'end': 1123.722, 'text': 'you simply copy the element of this array, the b array, into array a, the original array, and you got the sorted array.', 'start': 1116.858, 'duration': 6.864}, {'end': 1125.563, 'text': 'this is how we are going to apply the radix sort.', 'start': 1123.722, 'duration': 1.841}, {'end': 1127.884, 'text': 'see how many times we have applied counting sort here 3 times.', 'start': 1125.563, 'duration': 2.321}], 'summary': 'Radix sort applied 3 times, resulting in a sorted array.', 'duration': 30.287, 'max_score': 1097.597, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01097597.jpg'}, {'end': 1188.005, 'src': 'embed', 'start': 1162.404, 'weight': 3, 'content': [{'end': 1167.688, 'text': 'so now, in this radix sort, we are going to call what counting sort and how many times for this example?', 'start': 1162.404, 'duration': 5.284}, {'end': 1172.972, 'text': 'three times, because maximum element is this one and the number of digits in this element is three only.', 'start': 1167.688, 'duration': 5.284}, {'end': 1176.735, 'text': 'maybe in another case you have maximum element is 1432.', 'start': 1172.972, 'duration': 3.763}, {'end': 1180.679, 'text': 'so here in maximum data the number of digits are four.', 'start': 1176.735, 'duration': 3.944}, {'end': 1183.821, 'text': 'so four times we are going to call the count sort.', 'start': 1180.679, 'duration': 3.142}, {'end': 1188.005, 'text': 'so first of all, you are going to find out the maximum element, right.', 'start': 1183.821, 'duration': 4.184}], 'summary': "In radix sort, counting sort is called 3-4 times based on the maximum element's digit count.", 'duration': 25.601, 'max_score': 1162.404, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01162404.jpg'}, {'end': 1273.082, 'src': 'heatmap', 'start': 1208.766, 'weight': 0.821, 'content': [{'end': 1212.991, 'text': 'suppose mix fine in max.', 'start': 1208.766, 'duration': 4.225}, {'end': 1214.592, 'text': 'now we have the maximum element.', 'start': 1212.991, 'duration': 1.601}, {'end': 1219.695, 'text': 'so in this case, max in max, we have the 677.', 'start': 1214.592, 'duration': 5.103}, {'end': 1224.978, 'text': 'so now we are going to apply a for loop.', 'start': 1219.695, 'duration': 5.283}, {'end': 1231.742, 'text': 'fine. see, we are going to call the counting sort on the position, first on this position, then this position, then this position.', 'start': 1224.978, 'duration': 6.764}, {'end': 1232.843, 'text': 'once tens and hundreds.', 'start': 1231.742, 'duration': 1.101}, {'end': 1239.627, 'text': "so we i'm going to take a variable position, or you can say pos, i'm going to initialize it with one.", 'start': 1232.843, 'duration': 6.784}, {'end': 1247.903, 'text': 'And now the condition is here we have the maximum data in variable max.', 'start': 1240.578, 'duration': 7.325}, {'end': 1254.067, 'text': 'Max divide by this this pose is greater than 0.', 'start': 1248.543, 'duration': 5.524}, {'end': 1264.694, 'text': 'And this pose would be incremented by into 10 not plus 10 into 10.', 'start': 1254.067, 'duration': 10.627}, {'end': 1268.477, 'text': 'And now we are going to call this count so.', 'start': 1264.694, 'duration': 3.783}, {'end': 1273.082, 'text': 'So we are going to pass some arguments here.', 'start': 1270.339, 'duration': 2.743}], 'summary': 'Using counting sort on max to sort data. max is 677.', 'duration': 64.316, 'max_score': 1208.766, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01208766.jpg'}], 'start': 818.372, 'title': 'Sorting algorithms', 'summary': 'Covers counting sort and radix sort algorithms, explaining their implementation and usage in sorting arrays, with a focus on count sort, updating count array, and providing examples and quantifiable data.', 'chapters': [{'end': 933.785, 'start': 818.372, 'title': 'Counting sort algorithm', 'summary': 'Explains the counting sort algorithm, where the array is scanned from right to left, applying count sort on each digit to fill the output array with sorted elements, using the counting frequency of each element as a key step in the process.', 'duration': 115.413, 'highlights': ['The array is scanned from right to left, applying count sort on each digit to fill the output array with sorted elements, using the counting frequency of each element as a key step in the process.', 'The count array is updated after each pass, with the frequency of each element being decremented and the output array being filled accordingly, demonstrating the step-by-step process of Counting Sort.', "The process is repeated for each digit's place, with the count array being updated and the output array being filled, showcasing the iterative nature of the Counting Sort algorithm."]}, {'end': 1294.485, 'start': 933.785, 'title': 'Radix sort algorithm', 'summary': 'Covers the implementation of radix sort, including the explanation of the count sort, updating the count array, and sorting the output array using examples and quantifiable data.', 'duration': 360.7, 'highlights': ['The count array is updated to reflect the actual position, with the frequency of 0 being 5 times, resulting in a count array with updated values from 5 to 10. The count array is updated to reflect the actual position, with the frequency of 0 being 5 times, resulting in a count array with updated values from 5 to 10.', 'The output array is built using the updated count array, and the sorting process is demonstrated, resulting in a sorted output array after pass 3. The output array is built using the updated count array, and the sorting process is demonstrated, resulting in a sorted output array after pass 3.', "The implementation involves applying the counting sort three times due to the maximum element in the array having only three digits, highlighting the need for multiple count sort applications based on the maximum element's digit count. The implementation involves applying the counting sort three times due to the maximum element in the array having only three digits, highlighting the need for multiple count sort applications based on the maximum element's digit count."]}], 'duration': 476.113, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp0818372.jpg', 'highlights': ['The array is scanned from right to left, applying count sort on each digit to fill the output array with sorted elements, using the counting frequency of each element as a key step in the process.', 'The count array is updated after each pass, with the frequency of each element being decremented and the output array being filled accordingly, demonstrating the step-by-step process of Counting Sort.', "The process is repeated for each digit's place, with the count array being updated and the output array being filled, showcasing the iterative nature of the Counting Sort algorithm.", "The implementation involves applying the counting sort three times due to the maximum element in the array having only three digits, highlighting the need for multiple count sort applications based on the maximum element's digit count.", 'The count array is updated to reflect the actual position, with the frequency of 0 being 5 times, resulting in a count array with updated values from 5 to 10.', 'The output array is built using the updated count array, and the sorting process is demonstrated, resulting in a sorted output array after pass 3.']}, {'end': 1512.459, 'segs': [{'end': 1360.166, 'src': 'embed', 'start': 1319.02, 'weight': 0, 'content': [{'end': 1321.401, 'text': 'now we are going to write down the code for this count sort.', 'start': 1319.02, 'duration': 2.381}, {'end': 1324.743, 'text': 'in main function you are going to call this red x sort.', 'start': 1321.401, 'duration': 3.342}, {'end': 1336.116, 'text': 'see, in this case, if you call this red x sort, then in this, out of this array, the maximum, the value of this maximum would be six, seven, seven.', 'start': 1324.743, 'duration': 11.373}, {'end': 1337.497, 'text': 'get max would be a function.', 'start': 1336.116, 'duration': 1.381}, {'end': 1343.761, 'text': 'you are going to write down the code for this function also to find out the maximum element out of this array.', 'start': 1337.497, 'duration': 6.264}, {'end': 1348.925, 'text': 'i guess you can write down the code, because here the main uh, you know, logic is about this red xor.', 'start': 1343.761, 'duration': 5.164}, {'end': 1350.786, 'text': "so i'm not going to write down the code for this.", 'start': 1348.925, 'duration': 1.861}, {'end': 1351.147, 'text': 'get mix.', 'start': 1350.786, 'duration': 0.361}, {'end': 1354.704, 'text': 'fine. so maximum is 677.', 'start': 1351.903, 'duration': 2.801}, {'end': 1356.044, 'text': 'now in for loop.', 'start': 1354.704, 'duration': 1.34}, {'end': 1360.166, 'text': 'see, we are going to take one variable and the value is 1.', 'start': 1356.044, 'duration': 4.122}], 'summary': 'Writing code for count sort with maximum value of 677.', 'duration': 41.146, 'max_score': 1319.02, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01319020.jpg'}, {'end': 1468.081, 'src': 'embed', 'start': 1437.834, 'weight': 1, 'content': [{'end': 1440.136, 'text': 'now, how many times this sorting would be called?', 'start': 1437.834, 'duration': 2.302}, {'end': 1442.438, 'text': 'one, two and three times.', 'start': 1440.136, 'duration': 2.302}, {'end': 1446.041, 'text': 'so i hope you got the working of this for loop.', 'start': 1442.438, 'duration': 3.603}, {'end': 1449.563, 'text': 'why we have written this mix divide by post greater than zero.', 'start': 1446.041, 'duration': 3.522}, {'end': 1453.486, 'text': 'now we are going to write down the code for this count sort.', 'start': 1449.563, 'duration': 3.923}, {'end': 1455.307, 'text': 'we have discussed the count sort.', 'start': 1453.486, 'duration': 1.821}, {'end': 1456.628, 'text': 'four for loops would be there.', 'start': 1455.307, 'duration': 1.321}, {'end': 1464.639, 'text': 'you have just do a little bit modification for this radix sort logic would be same.', 'start': 1457.915, 'duration': 6.724}, {'end': 1468.081, 'text': 'fine. now we are going to define this count sort.', 'start': 1464.639, 'duration': 3.442}], 'summary': 'The transcript discusses the count sort algorithm and mentions four for loops. the code for count sort and radix sort logic is being defined.', 'duration': 30.247, 'max_score': 1437.834, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01437834.jpg'}, {'end': 1512.459, 'src': 'embed', 'start': 1486.209, 'weight': 3, 'content': [{'end': 1493.232, 'text': 'you can say this count array and the size of count arrays here is fixed, that is 0 to 9 range.', 'start': 1486.209, 'duration': 7.023}, {'end': 1495.233, 'text': 'so count array would be 10.', 'start': 1493.232, 'duration': 2.001}, {'end': 1500.575, 'text': 'so just take 10 sizes 10 and initialize it with 0 first of all.', 'start': 1495.233, 'duration': 5.342}, {'end': 1503.997, 'text': 'that is the first step in this count sort function.', 'start': 1500.575, 'duration': 3.422}, {'end': 1507.578, 'text': 'next step is now you have to fill this count sort array.', 'start': 1503.997, 'duration': 3.581}, {'end': 1512.459, 'text': 'how we are going to fill are going to count the frequency of the elements.', 'start': 1507.578, 'duration': 4.881}], 'summary': 'The count array size is fixed at 10, initialized with 0. frequency of elements is counted.', 'duration': 26.25, 'max_score': 1486.209, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01486209.jpg'}], 'start': 1294.485, 'title': 'Count sort and red x sort', 'summary': "Covers the implementation of count sort and red x sort with a maximum array value of 677. it also explains the working of the count sort algorithm with an example of dividing a maximum value by a post value, calling the count sort, and its incrementation, highlighting the need for the condition 'max divide by post greater than zero' and the number of times sorting is called.", 'chapters': [{'end': 1360.166, 'start': 1294.485, 'title': 'Count sort and red x sort', 'summary': 'Covers the implementation of count sort and red x sort, where the maximum value in the array is 677, and the code for red x sort is explained.', 'duration': 65.681, 'highlights': ['The maximum value in the array for implementing count sort and red x sort is 677.', 'The chapter explains the code for red x sort and the process of finding the maximum element in the array.']}, {'end': 1512.459, 'start': 1360.166, 'title': 'Working of count sort algorithm', 'summary': "Explains the working of the count sort algorithm with an example of dividing a maximum value by a post value, calling the count sort, and its incrementation, highlighting the need for the condition 'max divide by post greater than zero' and the number of times sorting is called.", 'duration': 152.293, 'highlights': ["The count sort is called three times during the example, demonstrating the need for the condition 'max divide by post greater than zero' and the logic behind the for loop. (3 sorting calls)", 'The explanation of the count sort algorithm includes the initialization of the count array with a fixed size of 10 and filling the count array to calculate the frequency of elements. (count array size: 10)']}], 'duration': 217.974, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01294485.jpg', 'highlights': ['The maximum value in the array for implementing count sort and red x sort is 677.', "The count sort is called three times during the example, demonstrating the need for the condition 'max divide by post greater than zero' and the logic behind the for loop. (3 sorting calls)", 'The chapter explains the code for red x sort and the process of finding the maximum element in the array.', 'The explanation of the count sort algorithm includes the initialization of the count array with a fixed size of 10 and filling the count array to calculate the frequency of elements. (count array size: 10)']}, {'end': 1723.839, 'segs': [{'end': 1546.137, 'src': 'embed', 'start': 1512.459, 'weight': 0, 'content': [{'end': 1515.261, 'text': 'now one for loop would be applied.', 'start': 1512.459, 'duration': 2.802}, {'end': 1515.902, 'text': 'we have started.', 'start': 1515.261, 'duration': 0.641}, {'end': 1518.323, 'text': 'i is equal to from zero.', 'start': 1515.902, 'duration': 2.421}, {'end': 1521.766, 'text': 'i would be less than n and i plus plus.', 'start': 1518.323, 'duration': 3.443}, {'end': 1524.287, 'text': 'so now what we have done here.', 'start': 1521.766, 'duration': 2.521}, {'end': 1527.169, 'text': 'see in first pass.', 'start': 1524.287, 'duration': 2.882}, {'end': 1529.711, 'text': 'in first pass we have just taken this value.', 'start': 1527.169, 'duration': 2.542}, {'end': 1530.932, 'text': 'that is two.', 'start': 1529.711, 'duration': 1.221}, {'end': 1533.434, 'text': 'we went to the index two and increment this value.', 'start': 1530.932, 'duration': 2.502}, {'end': 1535.695, 'text': 'simply fine.', 'start': 1533.434, 'duration': 2.261}, {'end': 1537.577, 'text': 'so in count, sort what we have written.', 'start': 1535.695, 'duration': 1.882}, {'end': 1546.137, 'text': 'count a of i, and you can say plus, plus.', 'start': 1538.953, 'duration': 7.184}], 'summary': 'Applied one for loop, incremented value at index 2 in first pass.', 'duration': 33.678, 'max_score': 1512.459, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01512459.jpg'}, {'end': 1735.966, 'src': 'embed', 'start': 1700.572, 'weight': 1, 'content': [{'end': 1702.732, 'text': 'So in third pass we are going to deal with this 5 only.', 'start': 1700.572, 'duration': 2.16}, {'end': 1707.153, 'text': '530 divided by post value in third pass is 100.', 'start': 1702.752, 'duration': 4.401}, {'end': 1713.535, 'text': 'So now this divided by 100 is what 5 only 5 more 10 is 5 only.', 'start': 1707.153, 'duration': 6.382}, {'end': 1715.115, 'text': 'So we are going to deal this 5 only.', 'start': 1713.695, 'duration': 1.42}, {'end': 1717.096, 'text': 'So this is the exact logic.', 'start': 1715.295, 'duration': 1.801}, {'end': 1723.839, 'text': 'So, now next for loop would be for this array to update this count array to reflect the actual position.', 'start': 1717.976, 'duration': 5.863}, {'end': 1735.966, 'text': 'So, next for loop would be we are going to start this from 1 because first value would be as it is 1 till i less than equal to k and i plus plus.', 'start': 1724.52, 'duration': 11.446}], 'summary': 'In the third pass, 530 divided by post value is 100, aiming to update count array.', 'duration': 35.394, 'max_score': 1700.572, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01700572.jpg'}], 'start': 1512.459, 'title': 'Array logic modification', 'summary': 'Covers modifying for loop logic to count digit frequency, and updating count array logic based on position values, with an example of dividing 530, enhancing understanding of multi-digit numbers and positions', 'chapters': [{'end': 1671.094, 'start': 1512.459, 'title': 'Implementing digit count logic', 'summary': 'Explains a for loop logic to count the frequency of individual digits in a given array, illustrating the need to modify the logic to handle multi-digit numbers and different positions.', 'duration': 158.635, 'highlights': ["The chapter explains the initial logic of using a for loop to iterate through the array and count the frequency of individual digits, with a specific example of incrementing the count of digit '2' at index 2.", 'It highlights the limitation of the initial logic when dealing with multi-digit numbers, emphasizing the need to modify the logic to consider individual digits at different positions within the numbers.', 'The chapter introduces the need to modify the logic within the for loop to divide the number by its position value to accurately identify and count individual digits, providing an example of dividing 530 by its position value in the second pass.']}, {'end': 1723.839, 'start': 1671.094, 'title': 'Updating count array logic', 'summary': 'Explains the logic of updating a count array based on a given position value, demonstrating the process with an example of dividing 530 by incrementing position values in each pass, resulting in the final count array reflecting the actual position.', 'duration': 52.745, 'highlights': ['The process involves incrementing the position value and dividing 530 by it in each pass, resulting in a count array that reflects the actual position.', 'For example, in the third pass, the position value is 100, and 530 divided by 100 equals 5, which represents the actual position.']}], 'duration': 211.38, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01512459.jpg', 'highlights': ["The chapter explains the initial logic of using a for loop to iterate through the array and count the frequency of individual digits, with a specific example of incrementing the count of digit '2' at index 2.", 'The chapter introduces the need to modify the logic within the for loop to divide the number by its position value to accurately identify and count individual digits, providing an example of dividing 530 by its position value in the second pass.', 'The process involves incrementing the position value and dividing 530 by it in each pass, resulting in a count array that reflects the actual position.']}, {'end': 2052.053, 'segs': [{'end': 1805.973, 'src': 'embed', 'start': 1754.323, 'weight': 2, 'content': [{'end': 1756.365, 'text': 'This is the same we have discussed in the count sort.', 'start': 1754.323, 'duration': 2.042}, {'end': 1758.948, 'text': 'Now, third would be to build this array.', 'start': 1756.686, 'duration': 2.262}, {'end': 1760.75, 'text': 'Now, third for loop.', 'start': 1759.749, 'duration': 1.001}, {'end': 1764.015, 'text': 'we are going to start this for loop from here.', 'start': 1761.974, 'duration': 2.041}, {'end': 1766.117, 'text': 'we are going to scan this array from right to left.', 'start': 1764.015, 'duration': 2.102}, {'end': 1771.441, 'text': 'so i would be n minus 1, i would be greater than equal to 0 and i minus minus.', 'start': 1766.117, 'duration': 5.324}, {'end': 1773.322, 'text': 'so what we have done in this case?', 'start': 1771.441, 'duration': 1.881}, {'end': 1774.823, 'text': 'we have just taken 9.', 'start': 1773.322, 'duration': 1.501}, {'end': 1775.624, 'text': 'go to the index.', 'start': 1774.823, 'duration': 0.801}, {'end': 1776.664, 'text': '9 is count.', 'start': 1775.624, 'duration': 1.04}, {'end': 1785.169, 'text': 'sort, decrement this counter value and in the output array b at this index, 9, we stored this value.', 'start': 1776.664, 'duration': 8.505}, {'end': 1788.029, 'text': 'fine, so this value would be stored where.', 'start': 1785.169, 'duration': 2.86}, {'end': 1792.15, 'text': 'so this value, that is a of i, would be stored where.', 'start': 1788.029, 'duration': 4.121}, {'end': 1801.852, 'text': 'you are going to write down that thing here, obviously in the b array, but index would be what.', 'start': 1792.15, 'duration': 9.702}, {'end': 1805.973, 'text': 'so now see what you will write here, how to calculate this index.', 'start': 1801.852, 'duration': 4.121}], 'summary': 'Discussion on count sort method and array manipulation.', 'duration': 51.65, 'max_score': 1754.323, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01754323.jpg'}, {'end': 2016.531, 'src': 'embed', 'start': 1988.022, 'weight': 0, 'content': [{'end': 1994.444, 'text': 'so it would be called the number of digits in the max data here three times it would be called.', 'start': 1988.022, 'duration': 6.422}, {'end': 1999.586, 'text': 'so you can write time complexity would be order of d into n plus k.', 'start': 1994.444, 'duration': 5.142}, {'end': 2003.044, 'text': 'Here d is number of digits.', 'start': 2001.343, 'duration': 1.701}, {'end': 2004.905, 'text': 'So, 3 into n plus k.', 'start': 2003.344, 'duration': 1.561}, {'end': 2006.806, 'text': 'This is the time complexity for red X sort.', 'start': 2004.905, 'duration': 1.901}, {'end': 2016.531, 'text': 'See and one more thing for the counting sort time complexity is this one and as well as space complexity is also n plus k.', 'start': 2007.266, 'duration': 9.265}], 'summary': "Time complexity for red x sort is 3n + k, for counting sort it's n + k.", 'duration': 28.509, 'max_score': 1988.022, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01988022.jpg'}], 'start': 1724.52, 'title': 'Count and radix sort', 'summary': 'Covers the count sort algorithm for array sorting with three for-loops and explains the logic behind calculating the index using count array. it also discusses the radix sort, highlighting its time complexity of o(d*n+k) and space complexity of o(n+k) based on the number of loops and calculations within the loops.', 'chapters': [{'end': 1906.757, 'start': 1724.52, 'title': 'Count sort algorithm', 'summary': 'Explains the count sort algorithm for array sorting, with a detailed explanation of the three for-loops, the logic for calculating the index using count array, and a step-by-step example of sorting the array using count sort.', 'duration': 182.237, 'highlights': ['The chapter explains the count sort algorithm with a detailed explanation of the three for-loops, including starting the loops from 1 and n-1, and scanning the array from right to left.', 'It provides a detailed logic for calculating the index using the count array, demonstrating how to calculate the index of count and decrementing the count value to store the values in the output array.', 'The transcript includes a step-by-step example of sorting the array using count sort, illustrating the process of dividing the array elements by position value and using the modulo operation to calculate the index and store the values in the output array.']}, {'end': 2052.053, 'start': 1906.757, 'title': 'Radix sort time complexity', 'summary': 'Explains the logic of radix sort, its time complexity is o(d*n+k), and space complexity is o(n+k), with the explanation based on the number of loops and calculations within the loops.', 'duration': 145.296, 'highlights': ['The time complexity for Radix Sort is O(d*n+k), where d is the number of digits, n is the number of elements, and k is the range of input.', 'The space complexity for Radix Sort is O(n+k), due to the extra arrays created, one of size k and another of size n.', 'The video explains the logic of Radix Sort, its time complexity, and space complexity based on the number of loops and calculations within the loops.']}], 'duration': 327.533, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/Il45xNUHGp0/pics/Il45xNUHGp01724520.jpg', 'highlights': ['The time complexity for Radix Sort is O(d*n+k), where d is the number of digits, n is the number of elements, and k is the range of input.', 'The space complexity for Radix Sort is O(n+k), due to the extra arrays created, one of size k and another of size n.', 'The chapter explains the count sort algorithm with a detailed explanation of the three for-loops, including starting the loops from 1 and n-1, and scanning the array from right to left.', 'It provides a detailed logic for calculating the index using the count array, demonstrating how to calculate the index of count and decrementing the count value to store the values in the output array.']}], 'highlights': ['The time complexity for Radix Sort is O(d*n+k), where d is the number of digits, n is the number of elements, and k is the range of input.', 'The space complexity for Radix Sort is O(n+k), due to the extra arrays created, one of size k and another of size n.', 'The process involves making all numbers three-digit by adding leading zeros, ensuring uniformity for applying counting sort.', 'The maximum data in the array is 677 and has three digits, indicating the need to apply counting sort three times.', "The implementation involves applying the counting sort three times due to the maximum element in the array having only three digits, highlighting the need for multiple count sort applications based on the maximum element's digit count.", 'The example array of 10 elements is used to illustrate the application of radix sort, emphasizing the practical implementation of the sorting algorithm.', 'The chapter explains the application of counting sort in radix sort, with a focus on applying count sort in three passes.', 'The explanation of the count sort algorithm includes the initialization of the count array with a fixed size of 10 and filling the count array to calculate the frequency of elements. (count array size: 10)', 'The process involves incrementing the position value and dividing 530 by it in each pass, resulting in a count array that reflects the actual position.', 'The process of counting sort algorithm includes applying count sort on each digit, incrementing the count values at respective indices, and updating the count array to reflect the actual position of elements in the sorted array.']}