{"id":22619097,"url":"https://github.com/caneroj1/median-stream","last_synced_at":"2025-08-01T10:40:15.210Z","repository":{"id":52814525,"uuid":"71516818","full_name":"caneroj1/median-stream","owner":"caneroj1","description":"Haskell data structure for constant-time queries for the median of a stream of numeric data","archived":false,"fork":false,"pushed_at":"2021-04-18T13:08:05.000Z","size":16,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T16:02:52.282Z","etag":null,"topics":["data-structures","heap","max-heap","numeric-data","stream"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caneroj1.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":"2016-10-21T00:59:45.000Z","updated_at":"2023-03-29T11:34:48.000Z","dependencies_parsed_at":"2022-08-22T20:51:02.681Z","dependency_job_id":null,"html_url":"https://github.com/caneroj1/median-stream","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/caneroj1%2Fmedian-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneroj1%2Fmedian-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneroj1%2Fmedian-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caneroj1%2Fmedian-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caneroj1","download_url":"https://codeload.github.com/caneroj1/median-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248419648,"owners_count":21100213,"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":["data-structures","heap","max-heap","numeric-data","stream"],"created_at":"2024-12-08T21:13:45.206Z","updated_at":"2025-04-11T14:32:41.586Z","avatar_url":"https://github.com/caneroj1.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# median-stream\n\u003ca href=\"https://hackage.haskell.org/package/median-stream\"\u003eHackage\u003c/a\u003e\n[![Build Status](https://travis-ci.org/caneroj1/median-stream.svg?branch=master)](https://travis-ci.org/caneroj1/median-stream)\n\u003cbr\u003e\nHaskell data structure for constant-time queries for the median of a stream of numeric data, where insertion into the stream occurs in O(nlgn). ```median-stream``` uses two heaps (a max-heap and a min-heap) to enable constant time access to the median. If there is an even number of elements in the stream, then the median is the average of the head of the two heaps. If there is an odd number, the median is the head of the max heap.\n\n## Usage\n\n```haskell\nData.MedianStream\u003e let medianStream = empty +\u003e 1 +\u003e 3 +\u003e 4 +\u003e 2\nData.MedianStream\u003e median medianStream\nJust 2.5\nData.MedianStream\u003e let medianStream2 = medianStream +\u003e 0 +\u003e (-1) +\u003e 10\nData.MedianStream\u003e median medianStream2\nJust 2.0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaneroj1%2Fmedian-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaneroj1%2Fmedian-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaneroj1%2Fmedian-stream/lists"}