{"id":19760984,"url":"https://github.com/imhta/ds_algo","last_synced_at":"2026-06-09T06:31:50.707Z","repository":{"id":59153075,"uuid":"198976499","full_name":"imhta/ds_algo","owner":"imhta","description":"ruby gem for data structures and algorithms","archived":false,"fork":false,"pushed_at":"2019-08-27T17:28:10.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-01T03:50:51.155Z","etag":null,"topics":["algorithms","ds-algo","gem","learning","library","ruby","ruby-gem"],"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/imhta.png","metadata":{"files":{"readme":"README.md","changelog":"History.rdoc","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":"2019-07-26T08:17:18.000Z","updated_at":"2023-03-04T11:23:27.000Z","dependencies_parsed_at":"2022-09-13T11:01:22.973Z","dependency_job_id":null,"html_url":"https://github.com/imhta/ds_algo","commit_stats":null,"previous_names":["imhtapm/ds_algo"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/imhta/ds_algo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imhta%2Fds_algo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imhta%2Fds_algo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imhta%2Fds_algo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imhta%2Fds_algo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imhta","download_url":"https://codeload.github.com/imhta/ds_algo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imhta%2Fds_algo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34095243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algorithms","ds-algo","gem","learning","library","ruby","ruby-gem"],"created_at":"2024-11-12T03:39:14.018Z","updated_at":"2026-06-09T06:31:50.690Z","avatar_url":"https://github.com/imhta.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ds_algo\n[![Build Status](https://travis-ci.com/imhta/ds_algo.svg?branch=master)](https://travis-ci.com/imhta/ds_algo) [![Gem Version](https://badge.fury.io/rb/ds_algo.svg)](https://badge.fury.io/rb/ds_algo) [![Maintainability](https://api.codeclimate.com/v1/badges/cdcfb8afb5cf985a58e0/maintainability)](https://codeclimate.com/github/imhtapm/ds_algo/maintainability)\n\nThis ruby gem is aimed to build a library for data structures and algorithms. with learning methods, facts.\n\n## Install\n\n```\ngem install ds_algo\n```\n\n## Data Structures\n\nEverything in computer is data. When you are dealing with computer, you have to understand the structure of the data. So, Data structures are funtamental part of software engineering and development.\n\n### Linked List\nLinked list is like chain of data. They are made of nodes, each node has a data, next_val or pre_val and next_val.\nThere are two type of linked list \n- Singly\n- Doubly\n\n#### Singly\n\n```\nrequire 'data_struct/linked_list'\n\nsingly = LinkedList::Singly.new\n```\n##### Methods =\u003e #push, #shift, #pop, #each, #index, #index_of, #to_s, #to_a, :length\n\n#### Doubly\n\n```\nrequire 'data_struct/linked_list'\n\ndoubly = LinkedList::Doubly.new\n```\n##### Methods =\u003e #push, #shift, #pop, #each, #index, #index_of, #to_s, #to_a, :length\n\n### Stacks\nFirst In Last Out(FILO) type data structure. One of widely used data structure. \n\n```\nrequire 'data_struct/stack'\n\nstack = Stack.new\n```\n##### Methods =\u003e #push, #pop, #top, #empty?, #to_a, :length\n\n### Queue\nFirst In First Out(FIFO) type data structure. One of widely used data structure. \n\n```\nrequire 'data_struct/queue'\n\nqueue = Queue.new\n```\n### Tree\nBinary search tree (BST) is a data structure that quickly allows us to maintain a sorted list of numbers.\n\n- It is called a binary tree because each tree node has maximum of two children.\n- It is called a search tree because it can be used to search for the presence of a number in O(log(n)) time.\n\n```\nrequire 'data_struct/queue'\n\nbst = Tree.BST\n```\n##### Methods =\u003e #insert, #find, #heigth?, #to_a, #empty?, :length\n\n## Contribution\nFeel free to make pull request. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimhta%2Fds_algo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimhta%2Fds_algo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimhta%2Fds_algo/lists"}