Website Summary Files Commits Branches @commit @diff @stats
path: root / Seminar06 / Linked-List-Perm.cpp
diff options
context:
space:
mode:
1 files changed, 0 insertions, 28 deletions
-rw-r--r--Seminar06/Linked-List-Perm.cpp28
diff --git a/Seminar06/Linked-List-Perm.cpp b/Seminar06/Linked-List-Perm.cpp
deleted file mode 100644
index ee2b1e4..0000000
--- a/Seminar06/Linked-List-Perm.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#include"../Seminar04/linked-list-utils.h"
-
-bool isLinkedListPermRec(const LinkedListNode<int>*& begin, const LinkedListNode<int>* end) {
- if(end == nullptr)
- return true;
-
- bool res = isLinkedListPermRec(begin, end->next) && (begin->data == end->data);
-
- begin = begin->next;
- return res;
-}
-
-template<class T>
-bool isLinkedListPerm(const LinkedListNode<T>* ll) {
- if(ll == nullptr)
- return true;
-
- const LinkedListNode<int>* begin = ll;
- const LinkedListNode<int>* end = ll;
-
- return isLinkedListPermRec(begin, end);
-}
-
-int main() {
- LinkedListNode<int>* ll = new LinkedListNode(0, new LinkedListNode(1, new LinkedListNode(1)));
-
- std::cout << isLinkedListPerm(ll);
-} \ No newline at end of file