aboutsummaryrefslogtreecommitdiffstats
path: root/C++/Recursion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'C++/Recursion.cpp')
-rw-r--r--C++/Recursion.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/C++/Recursion.cpp b/C++/Recursion.cpp
new file mode 100644
index 0000000..21742ca
--- /dev/null
+++ b/C++/Recursion.cpp
@@ -0,0 +1,41 @@
+#include <iostream>
+
+using namespace std;
+
+typedef int list_t;
+
+struct linkNode {
+ list_t element;
+ linkNode* next;
+};
+
+void addElement(linkNode*&, list_t&);
+void addElementReverse(linkNode*&, list_t&);
+
+int main() {
+ linkNode* firstList = NULL;
+ linkNode* secondList = NULL;
+
+ int n;
+ list_t el;
+ cout << "Number of elements in list: ";
+ cin >> n;
+ for(int i = 0; i < n; ++i) {
+
+ }
+}
+
+void addElement(linkNode* &hdList, list_t &el) {
+ linkNode* newNode = new linkNode;
+ newNode->element = el;
+ newNode->next = hdList;
+ hdList = newNode;
+}
+
+void addElementReverse(linkNode* &hdList, list_t &el) {
+ if(hdList == NULL) {
+
+ } else {
+
+ }
+}