diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/algorithms.vcxproj
--- a/cpp/algorithms/algorithms.vcxproj Sat Feb 16 12:05:15 2013 -0600
+++ b/cpp/algorithms/algorithms.vcxproj Sat Feb 16 17:51:39 2013 -0600
@@ -10,6 +10,16 @@
Win32
+
+
+
+
+
+
+
+
+
+
{38F1CE1E-AAA8-47A6-9C6E-3540FD29CA70}
Win32Proj
@@ -73,12 +83,6 @@
true
-
-
-
-
-
-
diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/algorithms.vcxproj.filters
--- a/cpp/algorithms/algorithms.vcxproj.filters Sat Feb 16 12:05:15 2013 -0600
+++ b/cpp/algorithms/algorithms.vcxproj.filters Sat Feb 16 17:51:39 2013 -0600
@@ -15,12 +15,24 @@
-
+
Source Files
-
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
Header Files
diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/src/Algorithm.h
--- a/cpp/algorithms/src/Algorithm.h Sat Feb 16 12:05:15 2013 -0600
+++ b/cpp/algorithms/src/Algorithm.h Sat Feb 16 17:51:39 2013 -0600
@@ -3,15 +3,30 @@
#include
#include
+#include
template
-class DataAlgorithm
+class Algorithm
{
-private:
+protected:
std::vector _container;
public:
- std::string toString();
+ void initContainer(std::vector arr)
+ {
+ this->_container = arr;
+ }
-}
+ std::string ToString()
+ {
+ std::stringstream ss;
+ ss << "[ ";
+ for(size_t i = 0; i < this->_container.size(); i++)
+ {
+ ss << this->_container.at(i) << " ";
+ }
+ ss << "] ";
+ return ss.str();
+ }
+};
#endif
\ No newline at end of file
diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/src/InsertSort.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/algorithms/src/InsertSort.h Sat Feb 16 17:51:39 2013 -0600
@@ -0,0 +1,15 @@
+#ifndef INSERTSORT_H
+#define INSERTSORT_H
+
+#include "SortAlgorithm.h"
+
+template
+class InsertSort : public SortAlgorithm
+{
+ virtual void Sort()
+ {
+
+ }
+};
+
+#endif
\ No newline at end of file
diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/src/SearchAlgorithm.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/algorithms/src/SearchAlgorithm.h Sat Feb 16 17:51:39 2013 -0600
@@ -0,0 +1,13 @@
+#ifndef SEARCHALGORITHM_H
+#define SEARCHALGORITHM_H
+
+#include "Algorithm.h"
+
+template
+class SearchAlgorithm : public Algorithm
+{
+public:
+ virtual void Search() = 0;
+};
+
+#endif
\ No newline at end of file
diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/src/SortAlgorithm.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/algorithms/src/SortAlgorithm.h Sat Feb 16 17:51:39 2013 -0600
@@ -0,0 +1,13 @@
+#ifndef SORTALGORITHM_H
+#define SORTALGORITHM_H
+
+#include "Algorithm.h"
+
+template
+class SortAlgorithm : public Algorithm
+{
+public:
+ virtual void Sort() = 0;
+};
+
+#endif
\ No newline at end of file
diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/src/main.cpp
--- a/cpp/algorithms/src/main.cpp Sat Feb 16 12:05:15 2013 -0600
+++ b/cpp/algorithms/src/main.cpp Sat Feb 16 17:51:39 2013 -0600
@@ -1,8 +1,15 @@
#include
+#include "InsertSort.h"
+#include "vector_helper.h"
+#include
using namespace std;
int main()
{
-
+ InsertSort sort1;
+ //cout << sort1.ToString();
+ //vector arr1 = create_vector(
+ sort1.initContainer(create_vector(1)(2)(3));
+ cout << sort1.ToString() << endl;
}
\ No newline at end of file
diff -r 6c891dee9ea8aa45c3f80d237efe83c36a1e2778 -r 019f5c4964fc6470887519acf735664925626baf cpp/algorithms/src/vector_helper.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cpp/algorithms/src/vector_helper.h Sat Feb 16 17:51:39 2013 -0600
@@ -0,0 +1,30 @@
+#ifndef VECTOR_HELPER_H
+#define VECTOR_HELPER_H
+
+#include
+#include
+
+template
+class create_vector
+{
+ private:
+ std::vector vect;
+ public:
+ create_vector(const T& val)
+ {
+ vect.push_back(val);
+ }
+
+ create_vector& operator()(const T& val)
+ {
+ vect.push_back(val);
+ return *this;
+ }
+
+ operator std::vector()
+ {
+ return vect;
+ }
+};
+
+#endif
\ No newline at end of file