algorithms

algorithms Commit Details


Date:2013-02-16 18:44:00 (11 years 10 months ago)
Author:Natalie Adams
Branch:default
Commit:17a967c7a5e4
Parents: e1a05c29b2c4
Message:Adding mediasort header

Updating inheirentance
Changes:
Acpp/algorithms/src/MedianSort.h (full)
Mcpp/algorithms/algorithms.vcxproj (1 diff)
Mcpp/algorithms/algorithms.vcxproj.filters (1 diff)
Mcpp/algorithms/src/InsertSort.h (1 diff)
Mcpp/algorithms/src/SortAlgorithm.h (1 diff)
Mcpp/algorithms/src/main.cpp (1 diff)

File differences

cpp/algorithms/algorithms.vcxproj
1616
1717
1818
19
1920
2021
2122
<ItemGroup>
<ClInclude Include="src\Algorithm.h" />
<ClInclude Include="src\InsertSort.h" />
<ClInclude Include="src\MedianSort.h" />
<ClInclude Include="src\SearchAlgorithm.h" />
<ClInclude Include="src\SortAlgorithm.h" />
<ClInclude Include="src\vector_helper.h" />
cpp/algorithms/algorithms.vcxproj.filters
3535
3636
3737
38
39
40
3841
3942
<ClInclude Include="src\vector_helper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\MedianSort.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
cpp/algorithms/src/InsertSort.h
22
33
44
5
56
67
7
8
89
910
1011
#define INSERTSORT_H
#include "SortAlgorithm.h"
#include "Algorithm.h"
template <class T>
class InsertSort : public SortAlgorithm, public Algorithm<T>
class InsertSort : public SortAlgorithm<T>
{
public:
virtual void Sort()
cpp/algorithms/src/MedianSort.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef MEDIAN_SORT_H
#define MEDIAN_SORT_H
#include "SortAlgorithm.h"
#include <vector>
template <class T>
class InsertSort : public SortAlgorithm<T>
{
public:
virtual void Sort()
{
this->mediansort(this->_container);
}
void mediansort(std::vector<T> arr)
{
if (arr.size() == 0)
return;
}
}
#endif
cpp/algorithms/src/SortAlgorithm.h
33
44
55
6
7
6
7
88
99
1010
#include "Algorithm.h"
class SortAlgorithm
template <class T>
class SortAlgorithm : public Algorithm<T>
{
public:
virtual void Sort() = 0;
cpp/algorithms/src/main.cpp
1313
1414
1515
16
16
1717
1818
1919
//sort1.initContainer(create_vector<string>("test")("test2"));
//cout << sort1.ToString();
//vector<int> arr1 = create_vector<int>(
sort1.initContainer(create_vector<int>(3)(2)(3));
sort1.initContainer(create_vector<int>(3)(2)(3)(1));
sort1.Sort();
cout << sort1.ToString() << endl;
}

Archive Download the corresponding diff file

Branches

Tags

Page rendered in 0.42543s using 14 queries.