Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayon-SSP authored Mar 8, 2023
1 parent 6aed8c8 commit 5272c9b
Showing 1 changed file with 115 additions and 114 deletions.
229 changes: 115 additions & 114 deletions 2]_Algorithms/2]_Sorting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,121 @@
#### 🧮 Radix Sort [code](#rs)
<br>

<a id="t"></a>

## <p aline="center">All Time⌚ & Space🗑️ Complexity</p>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <title>Table</title> -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@500&display=swap" rel="stylesheet">
<!-- <style>
table {
border-collapse: collapse;
width: 100%;
font-family: 'Ubuntu', sans-serif;
}
th, td {
text-align: left;
padding: 8px;
text-align: center;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: rgb(185, 119, 255);
color: white;
}
.redcolors {
color: red;
}
</style> -->
</head>
<body>
<table border="2" width="100%">
<tr>
<th rowspan="2">Algorithem</th>
<th colspan="3">Time Complexity</th>
<th rowspan="2">Worst Case space Complexity</th>
</tr>
<tr>
<th>Best</th>
<th>Average</th>
<th>Worst</th>
</tr>
<tr>
<td>Bubble Sort</td>
<td>O(n)</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Selection Sort</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Insertion Sort</td>
<td>O(n)</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Merge Sort</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n)</td>
</tr>
<tr>
<td>Quick Sort</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n^2)</td>
<td>O(n)</td>
</tr>
<tr>
<td>Heap Sort</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Count Sort</td>
<td>O(n+k)</td>
<td>O(n+k)</td>
<td>O(n+k)</td>
<td>O(k)</td>
</tr>
<tr>
<td>Bucket Sort</td>
<td>O(n+k)</td>
<td>O(n+k)</td>
<td>O(n^2)</td>
<td>O(n)</td>
</tr>
<tr>
<td>Radix Sort</td>
<td>O(n*k)</td>
<td>O(n*k)</td>
<td>O(n*k)</td>
<td>O(n+k)</td>
</tr>
</table>
</body>
</html>


### If want to take list input
```python
lst = list(map(int,input().split()))
Expand Down Expand Up @@ -416,117 +531,3 @@ Cocktail Sort
Strand Sort -->
<br>
<br>
<a id="t"></a>

## <p aline="center">All Time⌚ & Space🗑️ Complexity</p>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <title>Table</title> -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@500&display=swap" rel="stylesheet">
<!-- <style>
table {
border-collapse: collapse;
width: 100%;
font-family: 'Ubuntu', sans-serif;
}
th, td {
text-align: left;
padding: 8px;
text-align: center;
}
tr:nth-child(even){background-color: #f2f2f2}
th {
background-color: rgb(185, 119, 255);
color: white;
}
.redcolors {
color: red;
}
</style> -->
</head>
<body>
<table border="2" width="100%">
<tr>
<th rowspan="2">Algorithem</th>
<th colspan="3">Time Complexity</th>
<th rowspan="2">Worst Case space Complexity</th>
</tr>
<tr>
<th>Best</th>
<th>Average</th>
<th>Worst</th>
</tr>
<tr>
<td>Bubble Sort</td>
<td>O(n)</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Selection Sort</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Insertion Sort</td>
<td>O(n)</td>
<td>O(n^2)</td>
<td>O(n^2)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Merge Sort</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n)</td>
</tr>
<tr>
<td>Quick Sort</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n^2)</td>
<td>O(n)</td>
</tr>
<tr>
<td>Heap Sort</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(n log n)</td>
<td>O(1)</td>
</tr>
<tr>
<td>Count Sort</td>
<td>O(n+k)</td>
<td>O(n+k)</td>
<td>O(n+k)</td>
<td>O(k)</td>
</tr>
<tr>
<td>Bucket Sort</td>
<td>O(n+k)</td>
<td>O(n+k)</td>
<td>O(n^2)</td>
<td>O(n)</td>
</tr>
<tr>
<td>Radix Sort</td>
<td>O(n*k)</td>
<td>O(n*k)</td>
<td>O(n*k)</td>
<td>O(n+k)</td>
</tr>
</table>
</body>
</html>

0 comments on commit 5272c9b

Please sign in to comment.