Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit06b704fc9ba24adc8aefb6ad450f16abb25c4bf6 (patch)
Author
 Stoycho Kyosev <68247567+stoychoX@users.noreply.github.com>
2023-08-16 23:05:48 +0300
Committer
 GitHub <noreply@github.com>
2023-08-16 23:05:48 +0300
Files89660a278c4e0e4c452ecd5f651b4a66c9e7f18b
Data-structures-and-algorithms-06b704fc9ba24adc8aefb6ad450f16abb25c4bf6.tar
Data-structures-and-algorithms-06b704fc9ba24adc8aefb6ad450f16abb25c4bf6.tar.gz
Data-structures-and-algorithms-06b704fc9ba24adc8aefb6ad450f16abb25c4bf6.zip
Parent59fed4451128e87883982f82bafeac93616b9f72 (diff)
Update Linked-List-Palindrome.cpp
1 files changed, 4 insertions, 3 deletions
-rw-r--r--Seminar06/Linked-List-Palindrome.cpp7
diff --git a/Seminar06/Linked-List-Palindrome.cpp b/Seminar06/Linked-List-Palindrome.cpp
index 8a627a9..256246a 100644
--- a/Seminar06/Linked-List-Palindrome.cpp
+++ b/Seminar06/Linked-List-Palindrome.cpp
@@ -1,6 +1,7 @@
#include"../Seminar04/linked-list-utils.h"
-bool isLinkedListPalRec(const LinkedListNode<int>*& begin, const LinkedListNode<int>* end) {
+template<class T>
+bool isLinkedListPalRec(const LinkedListNode<T>*& begin, const LinkedListNode<T>* end) {
if(end == nullptr)
return true;
@@ -15,8 +16,8 @@ bool isLinkedListPal(const LinkedListNode<T>* ll) {
if(ll == nullptr)
return true;
- const LinkedListNode<int>* begin = ll;
- const LinkedListNode<int>* end = ll;
+ const LinkedListNode<T>* begin = ll;
+ const LinkedListNode<T>* end = ll;
return isLinkedListPalRec(begin, end);
}