Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commite4eb23592f7dae3ebaa8217d0df52e1e02575c83 (patch)
Author
 Stoycho Kyosev <68247567+stoychoX@users.noreply.github.com>
2024-10-11 12:07:54 +0300
Committer
 GitHub <noreply@github.com>
2024-10-11 12:07:54 +0300
Files6cffa7cc8432548f2286689ee2b3210195abc986
Data-structures-and-algorithms-e4eb23592f7dae3ebaa8217d0df52e1e02575c83.tar
Data-structures-and-algorithms-e4eb23592f7dae3ebaa8217d0df52e1e02575c83.tar.gz
Data-structures-and-algorithms-e4eb23592f7dae3ebaa8217d0df52e1e02575c83.zip
Parentc753f8ac9ddd9d17d1b41d351abedbec74c8234c (diff)
Parent280fd038a96e0c3a75dda95f8c0c4eae07c93ce4 (diff)
Merge pull request #12 from ico12319/patch-1
Update insertion-sort.cpp
1 files changed, 2 insertions, 2 deletions
-rw-r--r--Seminar01/src/sorting-algorithms/insertion-sort.cpp4
diff --git a/Seminar01/src/sorting-algorithms/insertion-sort.cpp b/Seminar01/src/sorting-algorithms/insertion-sort.cpp
index 00e823e..61ca3e8 100644
--- a/Seminar01/src/sorting-algorithms/insertion-sort.cpp
+++ b/Seminar01/src/sorting-algorithms/insertion-sort.cpp
@@ -5,7 +5,7 @@ void insertionSort(T* arr, unsigned length)
{
for (size_t i = 1; i < length; i++)
{
- int elementToInsert = arr[i];
+ T elementToInsert = arr[i];
int j = i - 1;
while (j >= 0 && arr[j] > elementToInsert)
{
@@ -25,4 +25,4 @@ int main()
{
std::cout << element << " ";
}
-} \ No newline at end of file
+}