Skip to content

Commit eb9ce43

Browse files
Merge branch 'master' into add/number_of_paths
2 parents 935fd8d + 93a700c commit eb9ce43

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

backtracking/graph_coloring.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <array> /// for std::array
2222
#include <iostream> /// for IO operations
23-
#include <vector> /// for std::vector
2423

2524
/**
2625
* @namespace backtracking

data_structures/trie_tree.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <iostream>
1313
#include <memory>
1414
#include <string>
15-
#include <vector>
1615

1716
/** \namespace data_structures
1817
* \brief Data-structure algorithms

divide_and_conquer/karatsuba_algorithm_for_fast_multiplication.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <cassert> /// for assert
1616
#include <cstring> /// for string
1717
#include <iostream> /// for IO operations
18-
#include <vector> /// for std::vector
1918

2019
/**
2120
* @namespace divide_and_conquer

graph/breadth_first_search.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include <map>
5353
#include <queue>
5454
#include <string>
55-
#include <vector>
5655

5756
/**
5857
* \namespace graph

sorting/quick_sort.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@ namespace quick_sort {
5454
* @param low first point of the array (starting index)
5555
* @param high last point of the array (ending index)
5656
* @returns index of the smaller element
57-
*/
57+
*
58+
* ### Time Complexity
59+
* best case, average Case: O(nlog(n))
60+
* Worst Case: O(n^2) (Worst case occur when the partition
61+
* is consistently unbalanced.)
62+
63+
* ### Space Complexity
64+
* average Case: O(log(n))
65+
* Worst Case: O(n)
66+
* It's space complexity is due to the recursive function calls and partitioning process.
67+
*/
68+
5869
template <typename T>
5970
int partition(std::vector<T> *arr, const int &low, const int &high) {
6071
T pivot = (*arr)[high]; // taking the last element as pivot

0 commit comments

Comments
 (0)