From 82f3450cd10e94bf11f1646362f9db8c48a84931 Mon Sep 17 00:00:00 2001 From: Rohit Panwar <107709247+RawHit02@users.noreply.github.com> Date: Sun, 8 Oct 2023 07:55:49 +0000 Subject: [PATCH 1/2] Updated_Camel_Case --- add-timer-decorator.py => Add-Timer-Decorator.py | 0 binarySearch.py => BinarySearch.py | 0 breadth_first_search.py => Breadth_First_Search.py | 0 cheat sheet.py => Cheat_Sheet.py | 0 checkLeapYear.py => CheckLeapYear.py | 0 chess.py => Chess.py | 0 Dijkstra's algorithm.py => Dijkstra's_Algorithm.py | 0 euclideanAlgorithm.py => EuclideanAlgorithm.py | 0 even.py => Even.py | 0 Face-Attendance-System/{main.py => Main.py} | 0 .../Resources/{background.png => Background.png} | Bin factorial recurssion.py => Factorial_Recurssion.py | 0 kadanesAlgorithm.py => KadanesAlgorithm.py | 0 Kotlin/{binarySearch.kt => BinarySearch.kt} | 0 Kotlin/{fibonacciSeries.kt => FibonacciSeries.kt} | 0 Kotlin/{insertionSort.kt => InsertionSort.kt} | 0 Kotlin/{linearSearch.kt => LinearSearch.kt} | 0 Kotlin/{selectionSort.kt => SelectionSort.kt} | 0 ...de-groupAnagrams.py => Leetcode_GroupAnagrams.py | 0 linkedlist.py => LinkedlLst.py | 0 ...ndAndUpperBound.py => LowerBoundAndUpperBound.py | 0 merge_sort.py => Merge_Sort.py | 0 prt.py => Prt.py | 0 Python/Graphs/{bfs.py => Bfs.py} | 0 Python/Graphs/{dfs.py => Dfs.py} | 0 pythonlearn.py => Pythonlearn.py | 0 selection_sort.py => Selection_Sort.py | 0 sets => Sets | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename add-timer-decorator.py => Add-Timer-Decorator.py (100%) rename binarySearch.py => BinarySearch.py (100%) rename breadth_first_search.py => Breadth_First_Search.py (100%) rename cheat sheet.py => Cheat_Sheet.py (100%) rename checkLeapYear.py => CheckLeapYear.py (100%) rename chess.py => Chess.py (100%) rename Dijkstra's algorithm.py => Dijkstra's_Algorithm.py (100%) rename euclideanAlgorithm.py => EuclideanAlgorithm.py (100%) rename even.py => Even.py (100%) rename Face-Attendance-System/{main.py => Main.py} (100%) rename Face-Attendance-System/Resources/{background.png => Background.png} (100%) rename factorial recurssion.py => Factorial_Recurssion.py (100%) rename kadanesAlgorithm.py => KadanesAlgorithm.py (100%) rename Kotlin/{binarySearch.kt => BinarySearch.kt} (100%) rename Kotlin/{fibonacciSeries.kt => FibonacciSeries.kt} (100%) rename Kotlin/{insertionSort.kt => InsertionSort.kt} (100%) rename Kotlin/{linearSearch.kt => LinearSearch.kt} (100%) rename Kotlin/{selectionSort.kt => SelectionSort.kt} (100%) rename leetcode-groupAnagrams.py => Leetcode_GroupAnagrams.py (100%) rename linkedlist.py => LinkedlLst.py (100%) rename lowerBoundAndUpperBound.py => LowerBoundAndUpperBound.py (100%) rename merge_sort.py => Merge_Sort.py (100%) rename prt.py => Prt.py (100%) rename Python/Graphs/{bfs.py => Bfs.py} (100%) rename Python/Graphs/{dfs.py => Dfs.py} (100%) rename pythonlearn.py => Pythonlearn.py (100%) rename selection_sort.py => Selection_Sort.py (100%) rename sets => Sets (100%) diff --git a/add-timer-decorator.py b/Add-Timer-Decorator.py similarity index 100% rename from add-timer-decorator.py rename to Add-Timer-Decorator.py diff --git a/binarySearch.py b/BinarySearch.py similarity index 100% rename from binarySearch.py rename to BinarySearch.py diff --git a/breadth_first_search.py b/Breadth_First_Search.py similarity index 100% rename from breadth_first_search.py rename to Breadth_First_Search.py diff --git a/cheat sheet.py b/Cheat_Sheet.py similarity index 100% rename from cheat sheet.py rename to Cheat_Sheet.py diff --git a/checkLeapYear.py b/CheckLeapYear.py similarity index 100% rename from checkLeapYear.py rename to CheckLeapYear.py diff --git a/chess.py b/Chess.py similarity index 100% rename from chess.py rename to Chess.py diff --git a/Dijkstra's algorithm.py b/Dijkstra's_Algorithm.py similarity index 100% rename from Dijkstra's algorithm.py rename to Dijkstra's_Algorithm.py diff --git a/euclideanAlgorithm.py b/EuclideanAlgorithm.py similarity index 100% rename from euclideanAlgorithm.py rename to EuclideanAlgorithm.py diff --git a/even.py b/Even.py similarity index 100% rename from even.py rename to Even.py diff --git a/Face-Attendance-System/main.py b/Face-Attendance-System/Main.py similarity index 100% rename from Face-Attendance-System/main.py rename to Face-Attendance-System/Main.py diff --git a/Face-Attendance-System/Resources/background.png b/Face-Attendance-System/Resources/Background.png similarity index 100% rename from Face-Attendance-System/Resources/background.png rename to Face-Attendance-System/Resources/Background.png diff --git a/factorial recurssion.py b/Factorial_Recurssion.py similarity index 100% rename from factorial recurssion.py rename to Factorial_Recurssion.py diff --git a/kadanesAlgorithm.py b/KadanesAlgorithm.py similarity index 100% rename from kadanesAlgorithm.py rename to KadanesAlgorithm.py diff --git a/Kotlin/binarySearch.kt b/Kotlin/BinarySearch.kt similarity index 100% rename from Kotlin/binarySearch.kt rename to Kotlin/BinarySearch.kt diff --git a/Kotlin/fibonacciSeries.kt b/Kotlin/FibonacciSeries.kt similarity index 100% rename from Kotlin/fibonacciSeries.kt rename to Kotlin/FibonacciSeries.kt diff --git a/Kotlin/insertionSort.kt b/Kotlin/InsertionSort.kt similarity index 100% rename from Kotlin/insertionSort.kt rename to Kotlin/InsertionSort.kt diff --git a/Kotlin/linearSearch.kt b/Kotlin/LinearSearch.kt similarity index 100% rename from Kotlin/linearSearch.kt rename to Kotlin/LinearSearch.kt diff --git a/Kotlin/selectionSort.kt b/Kotlin/SelectionSort.kt similarity index 100% rename from Kotlin/selectionSort.kt rename to Kotlin/SelectionSort.kt diff --git a/leetcode-groupAnagrams.py b/Leetcode_GroupAnagrams.py similarity index 100% rename from leetcode-groupAnagrams.py rename to Leetcode_GroupAnagrams.py diff --git a/linkedlist.py b/LinkedlLst.py similarity index 100% rename from linkedlist.py rename to LinkedlLst.py diff --git a/lowerBoundAndUpperBound.py b/LowerBoundAndUpperBound.py similarity index 100% rename from lowerBoundAndUpperBound.py rename to LowerBoundAndUpperBound.py diff --git a/merge_sort.py b/Merge_Sort.py similarity index 100% rename from merge_sort.py rename to Merge_Sort.py diff --git a/prt.py b/Prt.py similarity index 100% rename from prt.py rename to Prt.py diff --git a/Python/Graphs/bfs.py b/Python/Graphs/Bfs.py similarity index 100% rename from Python/Graphs/bfs.py rename to Python/Graphs/Bfs.py diff --git a/Python/Graphs/dfs.py b/Python/Graphs/Dfs.py similarity index 100% rename from Python/Graphs/dfs.py rename to Python/Graphs/Dfs.py diff --git a/pythonlearn.py b/Pythonlearn.py similarity index 100% rename from pythonlearn.py rename to Pythonlearn.py diff --git a/selection_sort.py b/Selection_Sort.py similarity index 100% rename from selection_sort.py rename to Selection_Sort.py diff --git a/sets b/Sets similarity index 100% rename from sets rename to Sets From d3b4800a2b97ac7a22c0d5eec0d20db38da59666 Mon Sep 17 00:00:00 2001 From: Rohit Panwar <107709247+RawHit02@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:44:58 +0530 Subject: [PATCH 2/2] Create Radix_Sorting_Method --- Radix_Sorting_Method | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Radix_Sorting_Method diff --git a/Radix_Sorting_Method b/Radix_Sorting_Method new file mode 100644 index 0000000..16f926c --- /dev/null +++ b/Radix_Sorting_Method @@ -0,0 +1,37 @@ +# Radix sort is a non-comparative sorting algorithm that works by distributing elements into buckets based on their individual digits. It's particularly useful for sorting integers. Here's a Python implementation of radix sort: + + +def counting_sort(arr, exp): + n = len(arr) + output = [0] * n + count = [0] * 10 + + for i in range(n): + index = arr[i] // exp + count[index % 10] += 1 + + for i in range(1, 10): + count[i] += count[i - 1] + + i = n - 1 + while i >= 0: + index = arr[i] // exp + output[count[index % 10] - 1] = arr[i] + count[index % 10] -= 1 + i -= 1 + + for i in range(n): + arr[i] = output[i] + +def radix_sort(arr): + max_element = max(arr) + exp = 1 + + while max_element // exp > 0: + counting_sort(arr, exp) + exp *= 10 + +# Example usage +arr = [170, 45, 75, 90, 802, 24, 2, 66] +radix_sort(arr) +print("Sorted array:", arr)