{"id":22513519,"url":"https://github.com/emahtab/unique-binary-search-trees","last_synced_at":"2026-02-17T20:31:35.034Z","repository":{"id":79525849,"uuid":"239095649","full_name":"eMahtab/unique-binary-search-trees","owner":"eMahtab","description":"Count the total number of BST possible with n numbers","archived":false,"fork":false,"pushed_at":"2020-02-08T08:49:27.000Z","size":1,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T01:26:47.212Z","etag":null,"topics":["binary-search-tree","dynamic-programming","leetcode","problem-solving"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eMahtab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-08T08:47:09.000Z","updated_at":"2020-02-08T08:50:25.000Z","dependencies_parsed_at":"2023-05-10T17:31:01.560Z","dependency_job_id":null,"html_url":"https://github.com/eMahtab/unique-binary-search-trees","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eMahtab/unique-binary-search-trees","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Funique-binary-search-trees","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Funique-binary-search-trees/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Funique-binary-search-trees/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Funique-binary-search-trees/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eMahtab","download_url":"https://codeload.github.com/eMahtab/unique-binary-search-trees/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Funique-binary-search-trees/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29557223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T20:14:27.083Z","status":"ssl_error","status_checked_at":"2026-02-17T20:14:26.018Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binary-search-tree","dynamic-programming","leetcode","problem-solving"],"created_at":"2024-12-07T03:12:49.436Z","updated_at":"2026-02-17T20:31:30.012Z","avatar_url":"https://github.com/eMahtab.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unique Binary Search Trees\n## https://leetcode.com/problems/unique-binary-search-trees\n\nGiven n, how many structurally unique BST's (binary search trees) that store values 1 ... n?\n```\nExample:\n\nInput: 3\nOutput: 5\nExplanation:\nGiven n = 3, there are a total of 5 unique BST's:\n\n   1         3     3      2      1\n    \\       /     /      / \\      \\\n     3     2     1      1   3      2\n    /     /       \\                 \\\n   2     1         2                 3\n```   \n\n## Implementation :\n\n```java\nclass Solution {\n    public int numTrees(int n) {\n        int[] G = new int[n + 1];\n        G[0] = 1;\n        G[1] = 1;\n\n        for (int i = 2; i \u003c= n; ++i) {\n          for (int j = 1; j \u003c= i; ++j) {\n            G[i] += G[j - 1] * G[i - j];\n          }\n        }\n    return G[n];\n  }\n}\n```\n\n# References :\n1. https://www.youtube.com/watch?v=GgP75HAvrlY\n2. https://leetcode.com/articles/unique-binary-search-trees\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Funique-binary-search-trees","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femahtab%2Funique-binary-search-trees","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Funique-binary-search-trees/lists"}