Skip to content

Commit

Permalink
Obrisana je tmp datoteka iz tema 06
Browse files Browse the repository at this point in the history
  • Loading branch information
Robotmurlock committed Nov 24, 2021
1 parent 631f2ee commit 83d9071
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 102 deletions.
4 changes: 2 additions & 2 deletions tema06_clangtools/02_cmake/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void vprint(const std::vector<int>& vec)
std::cout << std::endl;
}

auto main() -> int
int main()
{
std::vector<int> vec{5, 3, 1, 4, 2};
auto vec_copy = vec;
Expand All @@ -29,4 +29,4 @@ auto main() -> int
vprint(vec_copy);

return 0;
}
}
6 changes: 3 additions & 3 deletions tema06_clangtools/02_cmake/sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

void SelectionSort::sort(std::vector<int>& vec)
{
for(auto i = std::begin(vec); i!=vec.end()-1; i++)
for(auto j = i+1; j!=vec.end(); j++)
for(std::vector<int>::iterator i = std::begin(vec); i!=vec.end()-1; i++)
for(std::vector<int>::iterator j = i+1; j!=vec.end(); j++)
if(!m_cmp(*i, *j))
std::swap(*i, *j);
}

void QuickSort::sort(std::vector<int>& vec)
{
std::sort(std::begin(vec), std::end(vec), m_cmp);
}
}
3 changes: 2 additions & 1 deletion tema06_clangtools/02_cmake/sort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#define __SORTY__

#include <functional>
#include <utility>
#include <vector>

class AbstractSort{
public:
AbstractSort(std::function<bool(int, int)> cmp)
: m_cmp(cmp)
: m_cmp(std::move(cmp))
{}
virtual ~AbstractSort() = default;
virtual void sort(std::vector<int>& vec) = 0;
Expand Down
14 changes: 0 additions & 14 deletions tema06_clangtools/tmp/CMakeLists.txt

This file was deleted.

32 changes: 0 additions & 32 deletions tema06_clangtools/tmp/main.cpp

This file was deleted.

16 changes: 0 additions & 16 deletions tema06_clangtools/tmp/sort.cpp

This file was deleted.

34 changes: 0 additions & 34 deletions tema06_clangtools/tmp/sort.hpp

This file was deleted.

0 comments on commit 83d9071

Please sign in to comment.