{"id":29195851,"url":"https://github.com/failpt/avl-csharp","last_synced_at":"2025-08-30T07:03:05.900Z","repository":{"id":301409091,"uuid":"1009169311","full_name":"failpt/avl-csharp","owner":"failpt","description":"Generic AVL tree implementation and testing in C#","archived":false,"fork":false,"pushed_at":"2025-06-26T21:23:51.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T22:53:43.846Z","etag":null,"topics":["avl","avl-tree","bst","csharp","data-structures","generic","generic-library","self-balancing-trees"],"latest_commit_sha":null,"homepage":"","language":"C#","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/failpt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-26T17:29:48.000Z","updated_at":"2025-06-26T21:23:54.000Z","dependencies_parsed_at":"2025-06-26T22:53:48.110Z","dependency_job_id":"86e13b38-a0da-48df-95b7-8407f7f622d4","html_url":"https://github.com/failpt/avl-csharp","commit_stats":null,"previous_names":["failpt/avl-tree-cs","failpt/avl-csharp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/failpt/avl-csharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/failpt%2Favl-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/failpt%2Favl-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/failpt%2Favl-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/failpt%2Favl-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/failpt","download_url":"https://codeload.github.com/failpt/avl-csharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/failpt%2Favl-csharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272815845,"owners_count":24997662,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"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":["avl","avl-tree","bst","csharp","data-structures","generic","generic-library","self-balancing-trees"],"created_at":"2025-07-02T05:06:30.366Z","updated_at":"2025-08-30T07:03:05.661Z","avatar_url":"https://github.com/failpt.png","language":"C#","readme":"# Generic AVL-Based BST implementation with allowed duplicates\r\n\r\n## Implementation\r\n### Methods\r\n- `public int KeyCount(T key)` – returns the number of elements with a fixed `key`.\r\n- `public T Min()`, `public T Max()` – return the minimum, maximum keys according to the `IComparable\u003cT\u003e` implementation.\r\n- `public void Insert(T key, int number=1)` – adds a `number` of identical `key`'s (stored in one node) to the tree, singular `key` if not specified *(there is an option to pass `0` into the `number`, in that case the function will run in **O(1)** and will not modify the tree in any way)*.\r\n- `public void Delete(T key, bool all=false)` – deletes one `key` from a tree by default, if `all=true` fully deletes the node with all duplicates.\r\n\r\n– All run in **O(log(n))**\r\n\r\n- `public static bool IsAVL(Node\u003cT\u003e? root)` – Checks if a tree implemented with `Node\u003cT\u003e` at `root` is an AVL tree.\r\n- `public bool IsAVL()` – Checks if the current instance of the class is a valid AVL tree.\r\n\r\n– Both run in **O(n)**\r\n\r\n### Properties\r\n- `Count` – total number of elements (counting duplicates) in the tree.\r\n\r\n## Testing\r\n- **A 100 randomized, property based tests with the help of a dictionary:** each test consists of a random sequence of deletions \u0026 insertions and a check. \r\nOnly string and integer lists are generated for randomized testing, but the `static bool RandomizedTest\u003cT\u003e(List\u003cT\u003e input) where T : IComparable\u003cT\u003e` itself allows other types.\r\n- **An `AllCasesTest` test:** tests individual insertion, deletion and rotation cases with predefined integer values.\r\n\r\n### Running the tests\r\nMake sure you have the .NET SDK installed, then from the project folder:\r\n```\r\ndotnet run\r\n```\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffailpt%2Favl-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffailpt%2Favl-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffailpt%2Favl-csharp/lists"}