Website Summary Files Commits Branches @commit @diff @stats
path: root / Seminar06 / Linked-List-Palindrome.cpp
diff options
context:
space:
mode:
Commit7eee5a78005a9a569186d2c8b4b645a818ab9bf1 (patch)
Author
 Stoycho Kyosev <skyosev@192.168.100.17>
2024-10-06 07:04:44 -0400
Committer
 Stoycho Kyosev <skyosev@192.168.100.17>
2024-10-06 07:04:44 -0400
Files84594e0af29cefa5aae76ace5f8eb81484400e31 /Seminar06/Linked-List-Palindrome.cpp
Data-structures-and-algorithms-7eee5a78005a9a569186d2c8b4b645a818ab9bf1.tar
Data-structures-and-algorithms-7eee5a78005a9a569186d2c8b4b645a818ab9bf1.tar.gz
Data-structures-and-algorithms-7eee5a78005a9a569186d2c8b4b645a818ab9bf1.zip
Parent0841635826cb03c0e74cd75ec3c97c4c3b594d8b (diff)
Cleanup
1 files changed, 0 insertions, 29 deletions
-rw-r--r--Seminar06/Linked-List-Palindrome.cpp29
diff --git a/Seminar06/Linked-List-Palindrome.cpp b/Seminar06/Linked-List-Palindrome.cpp
deleted file mode 100644
index 256246a..0000000
--- a/Seminar06/Linked-List-Palindrome.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include"../Seminar04/linked-list-utils.h"
-
-template<class T>
-bool isLinkedListPalRec(const LinkedListNode<T>*& begin, const LinkedListNode<T>* end) {
- if(end == nullptr)
- return true;
-
- bool res = isLinkedListPalRec(begin, end->next) && (begin->data == end->data);
-
- begin = begin->next;
- return res;
-}
-
-template<class T>
-bool isLinkedListPal(const LinkedListNode<T>* ll) {
- if(ll == nullptr)
- return true;
-
- const LinkedListNode<T>* begin = ll;
- const LinkedListNode<T>* end = ll;
-
- return isLinkedListPalRec(begin, end);
-}
-
-int main() {
- LinkedListNode<int>* ll = new LinkedListNode(0, new LinkedListNode(1, new LinkedListNode(1)));
-
- std::cout << isLinkedListPal(ll);
-}