{"id":19028394,"url":"https://github.com/zinovyev/ruborithms","last_synced_at":"2025-02-21T19:43:37.972Z","repository":{"id":56893196,"uuid":"88549214","full_name":"zinovyev/ruborithms","owner":"zinovyev","description":"Algorithms and data structures implemented in Ruby","archived":false,"fork":false,"pushed_at":"2017-04-17T20:48:42.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T19:49:09.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zinovyev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-17T20:45:39.000Z","updated_at":"2017-04-17T20:47:29.000Z","dependencies_parsed_at":"2022-08-21T01:21:00.724Z","dependency_job_id":null,"html_url":"https://github.com/zinovyev/ruborithms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinovyev%2Fruborithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinovyev%2Fruborithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinovyev%2Fruborithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zinovyev%2Fruborithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zinovyev","download_url":"https://codeload.github.com/zinovyev/ruborithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240079610,"owners_count":19744720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T21:10:58.934Z","updated_at":"2025-02-21T19:43:37.953Z","avatar_url":"https://github.com/zinovyev.png","language":"Ruby","readme":"# Ruborithms\n\nAlgorithms and data structures implemented on pure Ruby.\n\n[![Gem Version](https://badge.fury.io/rb/ruborithms.svg)](https://badge.fury.io/rb/ruborithms)\n\n\n## Install\n\n```bash\ngem install ruborithms\n```\n\nRequire library:\n\n```ruby\nrequire 'ruborithms'\n```\n\n\n## Algorithms\n\n\n### Linear Search\n\nInclude:\n\n```ruby\nclass Array; include Ruborithms::Algorithms::LinearSearch; end\n```\n\nLinear search can now be used as a class singleton method:\n\n```ruby\nirb(main):006:0\u003e Array.linear_search([1, 55, 22, 44], 55)\n=\u003e 1\n```\n\nOr in the instance context:\n\n```ruby\nirb(main):007:0\u003e [1, 55, 22, 44].linear_search(55)\n=\u003e 1\n```\n\n\n### Binary Search\n\nInclude:\n\n```ruby\nclass Array; include Ruborithms::Algorithms::BinarySearch; end  \n```\n\nBinary search can now be used as a class singleton method:\n\n```ruby\nirb(main):008:0\u003e Array.binary_search([1, 55, 22, 44], 55)\n=\u003e 1\n```\n\nOr in the instance context:\n\n```ruby\nirb(main):009:0\u003e [1, 55, 22, 44].binary_search(55)\n=\u003e 1\n```\n\n### Selection Sort\n\nInclude:\n\n```ruby\nclass Array; include Ruborithms::Algorithms::SelectionSort; end  \n```\n\nBinary search can now be used as a class singleton method:\n\n```ruby\nirb(main):017:0\u003e Array.selection_sort([1, 55, 22, 44])\n=\u003e [1, 22, 44, 55]\n```\n\nOr in the instance context:\n\n```ruby\nirb(main):019:0\u003e [1, 55, 22, 44].selection_sort\n=\u003e [1, 22, 44, 55]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzinovyev%2Fruborithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzinovyev%2Fruborithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzinovyev%2Fruborithms/lists"}