From 76042f4713e560765ebfc9cc9b43b3bf43ff7c04 Mon Sep 17 00:00:00 2001 From: Ribhav Pahuja Date: Thu, 5 Oct 2017 00:55:27 +0530 Subject: [PATCH] Added Ternary Search --- Searches/TernarySearch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Searches/TernarySearch.java b/Searches/TernarySearch.java index 6b2d2b147..06b0be564 100644 --- a/Searches/TernarySearch.java +++ b/Searches/TernarySearch.java @@ -57,7 +57,7 @@ public class TernarySearch{ System.out.println("Enter number of elements in the array"); int n = s.nextInt(); int arr[] = new int[n]; - System.out.println("Enter the elements of the array"); + System.out.println("Enter the elements of the Sorted array"); for (int i= 0; i < n; i++){ arr[i] = s.nextInt(); } @@ -68,7 +68,7 @@ public class TernarySearch{ System.out.println(" The element is not present in the array."); } else { - System.out.println("The element is present at the position" + ans); + System.out.println("The element is present at the position " + (ans+1)); } } } \ No newline at end of file