{"id":26711651,"url":"https://github.com/rfieve/data-structures-converters","last_synced_at":"2025-03-27T10:30:00.093Z","repository":{"id":196189383,"uuid":"695024139","full_name":"rfieve/data-structures-converters","owner":"rfieve","description":"A TypeScript library to convert binary-search-trees, doubly linked lists of any types to one another.","archived":false,"fork":false,"pushed_at":"2024-07-24T10:13:39.000Z","size":309,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T00:48:32.241Z","etag":null,"topics":["binary-search-tree","data-structures","doubly-linked-list","typescript","utility-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/rfieve.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-22T07:32:36.000Z","updated_at":"2024-07-24T10:13:42.000Z","dependencies_parsed_at":"2023-09-22T18:45:15.376Z","dependency_job_id":"604c7cd5-f3ab-43b1-a13e-2f48d840ae64","html_url":"https://github.com/rfieve/data-structures-converters","commit_stats":null,"previous_names":["rfieve/data-structures-converters"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfieve%2Fdata-structures-converters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfieve%2Fdata-structures-converters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfieve%2Fdata-structures-converters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfieve%2Fdata-structures-converters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rfieve","download_url":"https://codeload.github.com/rfieve/data-structures-converters/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245826523,"owners_count":20678806,"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":["binary-search-tree","data-structures","doubly-linked-list","typescript","utility-library"],"created_at":"2025-03-27T10:29:59.686Z","updated_at":"2025-03-27T10:30:00.088Z","avatar_url":"https://github.com/rfieve.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💾🏰♻️ data-structures-converters\n\nA TypeScript library to convert binary-search-trees, doubly linked lists of any types to one another.\n\n## Table of Content\n\n-   [💾🏰♻️ data-structures-converters](#️-data-structures-converters)\n    -   [Table of Content](#table-of-content)\n    -   [Installation](#installation)\n    -   [Documentation](#documentation)\n        -   [`convertDLLtoBST`, `convertBSTtoDLLInstance`](#convertdlltobst-convertbsttodllinstance)\n        -   [`convertBSTtoDLL`, `convertDLLtoBSTInstance`](#convertbsttodll-convertdlltobstinstance)\n\n## Installation\n\n```sh\nyarn add @romainfieve/data-structures-converters\n```\n\nor\n\n```sh\nnpm install @romainfieve/data-structures-converters\n```\n\n## Documentation\n\n### `convertDLLtoBST`, `convertBSTtoDLLInstance`\n\nConverts a doubly linked list to a binary search tree, depending on a given compare function if provided.\n\n```typescript\nconst compare = (a: number, b: number) =\u003e a - b;\nconst arr = [10, 32, 13, 2, 89, 5, 50];\n\nconst list = toDLL(arr, compare);\n// Schema of \"list\"\n//\n// 2 \u003c-\u003e 5 \u003c-\u003e 10 \u003c-\u003e 13 \u003c-\u003e 32 \u003c-\u003e 50 \u003c-\u003e 89\n//\n\nconst tree = convertDLLtoBST(list, compare);\n// Schema of \"tree\"\n//\n//           13\n//        /     \\\n//       5      50\n//     /  \\    /  \\\n//    2   10  32   89\n//\n```\n\n---\n\n### `convertBSTtoDLL`, `convertDLLtoBSTInstance`\n\nConverts a binary search tree to a doubly linked list, depending on a given compare function if provided.\n\n```typescript\nconst compare = (a: number, b: number) =\u003e a - b;\nconst arr = [10, 32, 13, 2, 89, 5, 50];\n\nconst tree = toBST(list, compare);\n// Schema of \"tree\"\n//\n//           13\n//        /     \\\n//       5      50\n//     /  \\    /  \\\n//    2   10  32   89\n//\n\nconst list = convertBSTtoDLL(tree, compare);\n// Schema of \"list\"\n//\n// 2 \u003c-\u003e 5 \u003c-\u003e 10 \u003c-\u003e 13 \u003c-\u003e 32 \u003c-\u003e 50 \u003c-\u003e 89\n//\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfieve%2Fdata-structures-converters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frfieve%2Fdata-structures-converters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfieve%2Fdata-structures-converters/lists"}