Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Write a R program to implement linear search #5305

Closed
harshraj8843 opened this issue Jan 15, 2024 · 2 comments · Fixed by #5605
Closed

Write a R program to implement linear search #5305

harshraj8843 opened this issue Jan 15, 2024 · 2 comments · Fixed by #5605
Assignees
Labels
closed closed issues/PRs good first issue Good for newcomers program R r related

Comments

@harshraj8843
Copy link
Contributor

Description

Write a R program to implement linear search

Linear search is a very simple search algorithm. In this type of search, a sequential search is made over all items one by one. Every item is checked and if a match is found then that particular item is returned, otherwise the search continues till the end of the data collection.

Linear search is the simplest search algorithm. For this reason, it is often called sequential search.

Pseudocode

procedure linear_search (list, value)

   for each item in the list
      if match item == value
         return the item's location
      end if
   end for

end procedure

Example

list = [1,2,3,4,5]
value = 4

Output : 3
How to contribute
  • Comment !assign to assign this issue to yourself
  • Fork this repository
  • Create a new branch
  • Save the solution in program/program/implement-linear-search/implement_linear_search.r
  • Commit the changes
  • Create a pull request
@harshraj8843 harshraj8843 added good first issue Good for newcomers program R r related labels Jan 15, 2024
@codinasion-bot
Copy link

👋🏻 Hey @harshraj8843

💖 Thanks for opening this issue 💖

A team member should be by to give feedback soon.

@codinasion-bot codinasion-bot bot added the triage Waiting for review label Jan 15, 2024
@Parvezkhan0
Copy link
Contributor

!assign

@codinasion-bot codinasion-bot bot added closed closed issues/PRs and removed triage Waiting for review labels Apr 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed closed issues/PRs good first issue Good for newcomers program R r related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants