Тёмный

Sorting In One Shot C++ | Bubble, Insertion, Selection Sort | Complete DSA Course 2023 | Placements 

College Wallah
Подписаться 759 тыс.
Просмотров 35 тыс.
50% 1

Опубликовано:

 

31 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@Factroller69
@Factroller69 Год назад
3:05 bubble sort 39:17 question 1 42:38 question 2 53:12 selection sort 1:18:42 question 3 1:19:20 insertion sort
@ishagopinath
@ishagopinath Год назад
Please make one shot on OOPS, Linked List, Stack, Queue, Trees as well..
@MDAyas-zu4lj
@MDAyas-zu4lj Год назад
I am agree with you
@MDAyas-zu4lj
@MDAyas-zu4lj Год назад
I am also want this topic
@GoogleSoftwareEnginear
@GoogleSoftwareEnginear Год назад
Yes please make the video in this topic this will be very helpful for us 😊
@CollegeSemesters
@CollegeSemesters Год назад
😊😊😊
@memewalah01
@memewalah01 Год назад
😊😊😊😊
@bilalarshad2092
@bilalarshad2092 Год назад
Thanku Sir, Sir plzz make video on Structures, File Handling and OOPs. Plzz Sir.
@serenasinha5431
@serenasinha5431 10 месяцев назад
🎯 Key Takeaways for quick navigation: 00:56 ⏱️ *Time complexity analysis and optimization strategies for sorting algorithms will be discussed.* 02:05 🤔 *Sorting challenges may involve choosing between ascending, descending, or non-decreasing order.* 03:55 🧩 *Introduction to advanced sorting algorithms like Merge Sort, Quick Sort, and others.* 05:16 🤔 *Explanation of a manual sorting algorithm using the "pass" method and swapping elements.* 08:10 🔄 *Sorting involves comparing and swapping adjacent elements to arrange them in ascending order.* 09:55 🔄 *Verification step: Ensure each element is in the correct position after the sorting process.* 11:30 🔄 *Swapping in sorting algorithms involves comparing adjacent elements and swapping them if they are in the wrong order.* 20:07 🔄 *The speaker explains a loop structure using the variable "i" and mentions the need to iterate from "i" to "n-1" in a sorting algorithm.* 22:07 🔄 *The speaker suggests that the time complexity of Bubble Sort is approximately n*(n+1)/2, explaining the reasoning behind this calculation.* 24:18 🔄 *Summing up the total number of operations in Bubble Sort, the speaker arrives at a formula: n*(n-1)/2, providing a mathematical understanding of the time complexity.* 28:19 ✅ *Checking for swaps in each pass and stopping when no swaps occur is a practical optimization for bubble sort.* 32:27 📐 *To check if an array is already sorted, a boolean flag and element-wise comparisons are employed.* 33:14 ⏩ *Average and worst cases in sorting have complexities of O(n^2), making them less efficient.* 33:42 💡 *Understanding worst case: Number of operations in the worst case is approximately n * (n-1)/2.* 34:13 🔄 *Differentiating stable and unstable sorting: Stable sorting preserves the relative order of equal elements.* 36:53 🔄 *Bubble sort optimization discussed.* 37:30 🌐 *Comparison of two elements in bubble sort.* 37:47 ⭐️ *Example of swapping in bubble sort.* 38:00 💡 *Explanation of bubble sort stability.* 39:16 ❓ *Addressing questions about maximum swaps needed to sort an array.* 41:14 🔄 *In sorting, understanding the worst-case scenario helps optimize algorithms.* 41:41 🔄 *Analyzing the number of swaps in sorting algorithms helps determine efficiency.* 45:22 📊 *To solve a question related to arranging positive elements in a relative order (e.g., 5 2 3 4 1), create a new array or vector, and insert non-zero elements as they appear.* 46:17 ⚖️ *Maintaining stability in Bubble Sort: Swap elements only if the element at index i is greater than the element at index i + 1.* 47:26 🧹 *Optimize Bubble Sort by pushing the maximum element to the last position, reducing unnecessary comparisons.* 48:10 🔄 *Implement swapping in Bubble Sort by checking if the current element is zero and swapping it with the adjacent non-zero element.* 51:17 🔄 *Modify Bubble Sort code to handle zero elements more efficiently.* 57:57 🔄 *Explaining the logic of the selection sort process, iteratively moving the lowest unsorted element to the front.* 59:16 🔄 *Discussing the looping mechanism for iterating through the array and implementing simple indexing for the selection sort algorithm.* 59:56 🔄 *To find the minimum element in an array, iterate through the array, keeping track of the minimum element and its index.* 01:00:39 🔄 *Utilize the concept of the minimum index to efficiently swap elements without unnecessary steps.* 01:00:54 🛠️ *Implementing the logic for finding the minimum index in the sorting algorithm is straightforward and crucial.* 01:01:34 🔍 *Demonstrating how to find the minimum element and its index in an array using C++.* 01:02:17 🤔 *Explaining the rationale behind initializing the minimum index variable to -1 in the sorting algorithm.* 01:02:30 🔄 *Utilizing the minimum index variable to store the index of the minimum element during the array traversal.* 01:03:35 🔄 *Selection Sort algorithm explanation begins, focusing on minimum element and swapping.* 01:04:15 🔄 *Attention to the inner loop, using an integer j from i to n-1 in the Selection Sort.* 01:05:09 🔄 *Demonstrates the swapping process in Selection Sort, ensuring the first element in the red box is the minimum.* 01:05:36 🔄 *Explains the logic behind the loop for the red box in Selection Sort, focusing on the 'j' loop.* 01:06:23 🔄 *Introduces conditions for swapping in Selection Sort based on the minimum element.* 01:06:36 🔄 *Explains the need for 'j' inside the loop, managing the number of passes in Selection Sort.* 01:06:50 🔄 *Discusses the logic behind the loop and tasks performed outside the loop in Selection Sort.* 01:07:43 🐛 *Be cautious with variable names; a coding bug occurred due to a typo (j = ज instead of j = i).* 01:08:26 🤔 *Emphasis on coding independently; spoon-feeding can hinder understanding and career growth.* 01:08:55 🔴 *Creating a red box visually illustrates the shifting elements in the sorting process.* 01:09:08 ⚙️ *Overview of the selection sort algorithm, including swapping elements and its time and space complexity.* 01:09:23 🔄 *Calculating the number of operations in the selection sort algorithm based on loop iterations and array size.* 01:09:49 🤓 *Understanding the number of operations in selection sort: approximately n * (n - 1) / 2 comparisons and swaps.* 01:10:19 🔄 *A simplified explanation of the number of operations, breaking down the outer and inner loop iterations.* 01:11:14 🔄 *In the worst case, the total number of operations in sorting can be calculated as n * (n-1) / 2.* 01:11:26 🔄 *The total time complexity of sorting algorithms is related to the number of operations performed, and it can be expressed as O(n^2).* 01:12:06 🤔 *The speaker suggests watching further lectures for a detailed explanation of why the time complexity is O(n^2) and not explained here.* 01:12:26 🔄 *Optimizing bubble sort involves using a boolean flag to check if any swaps are made in a pass, reducing the best-case time complexity to O(n).* 01:13:21 🔄 *The number of swaps in selection sort is determined by the maximum possible swaps, which is n-1 swaps in the worst case.* 01:14:17 🔄 *Selection sort is considered better than bubble sort because of fewer swaps in the best case and no additional space complexity.* 01:15:10 🔄 *Selection Sort has a disadvantage related to the number of swaps, impacting associated costs.* 01:15:39 🔄 *Bubble Sort is stable, unlike Selection Sort, ensuring the order remains the same for equal elements after sorting.* 01:15:54 🧹 *After sorting, the order of equal elements should be maintained for stability.* 01:16:07 🔄 *Selection Sort swaps the first element with the minimum element in each iteration.* 01:16:22 🔄 *The algorithm for Selection Sort involves swapping elements to place the minimum element at the beginning.* 01:16:50 🔄 *Demonstrates the swapping of elements in Selection Sort using a specific example.* 01:17:40 🔄 *Addresses the challenge of ensuring stability in Selection Sort and the need for careful consideration.* 01:18:23 🔄 *Stresses the significance of stability for dependable sorting results, using the example of Selection Sort.* 01:19:30 ⏱️ *Insertion Sort is better than Bubble Sort, with similar time complexity but better in practice.* 01:20:11 🃏 *Understanding Insertion Sort through playing cards: sorted and unsorted parts.* 01:26:06 🔄 *Passes in Sorting Algorithms: Mention of the number of passes required for sorting, specifically in Bubble and Insertion Sort.* 01:27:59 🔄 *Comparing and Swapping Elements: Clarifies the comparison strategy in Insertion Sort, emphasizing comparing with the left index and swapping until the correct position is found.* 01:28:51 🚦 *Loop Termination Conditions: Highlights the loop termination conditions in Insertion Sort, ensuring that the algorithm executes correctly and avoids errors.* 01:32:43 🔄 *Explains the condition for swapping elements based on the comparison of array values at indices j and j-1.* 01:33:13 🔄 *Describes the loop termination condition, ensuring the algorithm proceeds until the entire array is sorted.* 01:34:30 🔄 *The lecture discusses loop conditions and array manipulation in the context of sorting algorithms in C++.* 01:34:45 🧐 *The instructor swaps elements until finding one greater than 20 in insertion sort, highlighting a key feature of this algorithm.* 01:35:12 🔍 *The lecture emphasizes that the insertion sort algorithm efficiently handles already sorted arrays.* 01:36:05 🔄 *The algorithm's efficiency is demonstrated, emphasizing the minimal number of operations required.* 01:37:03 🔀 *A pre-sorted array efficiently skips the inner loop, saving unnecessary iterations in insertion sort.* 01:39:10 🔄 *Demonstrating the stability of insertion sort by maintaining the order of equal elements during sorting.* 01:39:49 🤔 *A question is posed about which sorting technique should be used in a player's deck of cards.* Made with HARPA AIg
@CollegeSemesters
@CollegeSemesters Год назад
Thank You Sir For Sharing This Video
@carnivalking8824
@carnivalking8824 Год назад
Make one shot on all type of sorting so that we do revision including merg sort ,heap sort and all of these and same on searching as well
@drone231
@drone231 11 месяцев назад
26:00
@Abhishek-qx9zg
@Abhishek-qx9zg Год назад
Thanks sir ji 😊😊😊😊😊😊
@shravanbharti2336
@shravanbharti2336 11 месяцев назад
Sir Please upload other Sorting algos merge ,quick and other ...sir plaese , sir your explaination technique is too good and unique . So please sir Upload as soon as possible 🙏🙏🙏
@Abhishek-qx9zg
@Abhishek-qx9zg Год назад
1:40:49 maja aa gaya 😊😊😊😊😊😊❤❤❤❤❤❤
@bhavikbansiwal5304
@bhavikbansiwal5304 10 месяцев назад
Full DSA course with implementation 🙏🙏🙏
@UnnatiSharma-tf7te
@UnnatiSharma-tf7te Месяц назад
Best explanation sir thanku lots ❤
@alienkid
@alienkid Год назад
Teaching in two languages at the same time is impressive
@torretogaming5167
@torretogaming5167 Год назад
Raghav sir pls ek video classes and reference pr bana do❣️❣️❣️❣️❣️❣️
@Gurpreet11g
@Gurpreet11g 11 месяцев назад
Sir please upload your video on binary search
@Abhishek-qx9zg
@Abhishek-qx9zg Год назад
Sir please Linked list pura detail me dalna please 🥺❤️❤️🥺
@supercellagent7724
@supercellagent7724 2 месяца назад
Mazza ahh gaya
@ajay.....07
@ajay.....07 4 месяца назад
Sir, Mujhe Ab pta chlaa ki Mujhe Spoon Feeding H 😭😭
@itspriyambhattacharya
@itspriyambhattacharya 2 месяца назад
1:19:30
@itspriyambhattacharya
@itspriyambhattacharya 2 месяца назад
26:11
@VijaykumarNishad-lm9sc
@VijaykumarNishad-lm9sc 7 месяцев назад
Sir quick sort aur merge sort ki video bhi chahiye
@Mkhan-jf6ri
@Mkhan-jf6ri 11 месяцев назад
Provide Linked list lectures
@itsrohan1001
@itsrohan1001 10 месяцев назад
Notes
@msrishti2684
@msrishti2684 Год назад
*please keep your thumbnails* *PLAIN AND PRECISE* 💯
@anujjadhav5398
@anujjadhav5398 Год назад
Please suggest me best gaming laptop under 1 lakh excluding Acer,MSI & Lenovo
@RAHULYADAV-em3wq
@RAHULYADAV-em3wq Год назад
❤❤❤❤❤❤❤❤
@Robert_austia
@Robert_austia Год назад
Please help me to buy laptop 😢😢 Under 40k 😢😢 please help me
Далее
The Best Way to Learn to Code in 2024!? - CS50 Review
8:15
МЖ. Может, папа - ты? 16.02.2023
40:03
Просмотров 340 тыс.
7.3 Bubble Sort Algorithm| Data Structures Tutorials
35:36