Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 14 insertions, 0 deletions
-rw-r--r--Sem. 12/isPalindrome.cpp14
diff --git a/Sem. 12/isPalindrome.cpp b/Sem. 12/isPalindrome.cpp
new file mode 100644
index 0000000..3c41307
--- /dev/null
+++ b/Sem. 12/isPalindrome.cpp
@@ -0,0 +1,14 @@
+#include <iostream>
+
+bool isPalindrome(const int* arr, unsigned size)
+{
+ if (size <= 1)
+ return true;
+
+ return arr[0] == arr[size - 1] && isPalindrome(arr + 1, size - 2);
+}
+
+int main()
+{
+
+}