Skip to content

Conversation

Arpita23r
Copy link
Contributor

  • Implemented Ternary Search algorithm in R for searching elements in sorted arrays.
  • Divides the search interval into three parts instead of two (like Binary Search).
  • Recursively or iteratively narrows down the range based on value comparisons.
  • Added clear variable names and inline comments for readability.
  • Handles both found and not found cases gracefully with proper output messages.
  • Optimized for numerical arrays and works efficiently on sorted data.
  • Stored file under searches/ternary.search.R following project structure conventions.

@siriak siriak requested a review from Copilot October 11, 2025 09:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a ternary search algorithm in R for searching elements in sorted arrays. The algorithm divides the search space into three parts instead of two, similar to binary search but with an additional comparison point.

Key changes:

  • Added complete ternary search implementation with iterative approach
  • Included interactive user input functionality for testing the algorithm
  • Provided proper handling of found/not found cases with descriptive output

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@siriak
Copy link
Member

siriak commented Oct 11, 2025

Please check comments

@Arpita23r
Copy link
Contributor Author

Arpita23r commented Oct 11, 2025

@siriak Issue resolved. Many thanks

@siriak siriak requested a review from Copilot October 11, 2025 10:51
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

@siriak siriak merged commit e33a9c6 into TheAlgorithms:master Oct 11, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants