No, both binary and ternary search require the input array to be sorted. Using either on an unsorted array will not yield correct results.
-
Binary Search divides the search interval into two parts, making it more efficient with fewer comparisons.
-
Ternary Search divides the search interval into three parts, requiring more comparisons and increased implementation complexity.
-
Binary Search is widely used for sorted data and is simpler to implement than Ternary Search.
-
Ternary Search is typically used in optimization problems for unimodal functions, not in standard sorted array searches.
