# sagark-05/dsa architecture

> Architecture diagram of the GitHub repository sagark-05/dsa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sagark-05/dsa
- Repository: https://github.com/sagark-05/dsa

## Overview

This repository is a collection of independent LeetCode and interview-algorithm C++ submissions, not a shared application. The principal workflow is to provide a problem’s input to its corresponding solution method and receive that method’s result; the repository shows no common dispatcher or runtime connecting the submissions. The graph groups the implementations by problem domain. The README identifies the collection and topics, while sampled source confirms several implementations; isolated nodes reflect the absence of evidenced cross-module calls.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_brackets["Bracket Algorithms"]
  node_valid_parentheses["Valid Parentheses"]
  node_generate_parentheses["Generate Parentheses"]
  node_longest_valid_parentheses["Longest Valid Parentheses"]
  node_valid_parenthesis_string["Valid Parenthesis String"]
end

subgraph group_trees["Tree Algorithms"]
  node_right_view["Right Side View"]
  node_count_nodes["Count Complete Nodes"]
  node_tree_width["Maximum Tree Width"]
  node_distance_k["Nodes At Distance K"]
end

subgraph group_bst["BST Algorithms"]
  node_unique_bsts["Count Unique BSTs"]
  node_unique_bsts_dp["Unique BST DP"]
  node_validate_bst["Validate BST"]
  node_kth_bst["Kth Smallest BST"]
  node_delete_bst["Delete BST Node"]
  node_search_bst["Search BST"]
  node_insert_bst["Insert BST Node"]
end

subgraph group_strings["String And Hashing"]
  node_valid_anagram["Valid Anagram"]
  node_capitalize_title["Capitalize Title"]
  node_anagram_groups["Group Anagrams<br/>[submission-0.cpp]"]
  node_is_anagram["Anagram Check<br/>[submission-0.cpp]"]
  node_longest_repeating["Longest Repeating Substring<br/>[submission-0.cpp]"]
end

subgraph group_misc["Other Interview Problems"]
  node_right_side["Duplicate Integer<br/>[submission-1.cpp]"]
  node_two_sum["Two Integer Sum<br/>[submission-3.cpp]"]
end

click node_valid_parentheses "https://github.com/sagark-05/dsa/blob/main/0020-valid-parentheses/0020-valid-parentheses.cpp"
click node_generate_parentheses "https://github.com/sagark-05/dsa/blob/main/0022-generate-parentheses/0022-generate-parentheses.cpp"
click node_longest_valid_parentheses "https://github.com/sagark-05/dsa/blob/main/0032-longest-valid-parentheses/0032-longest-valid-parentheses.cpp"
click node_valid_parenthesis_string "https://github.com/sagark-05/dsa/blob/main/0678-valid-parenthesis-string/0678-valid-parenthesis-string.cpp"
click node_unique_bsts "https://github.com/sagark-05/dsa/blob/main/0096-unique-binary-search-trees/0096-unique-binary-search-trees.cpp"
click node_unique_bsts_dp "https://github.com/sagark-05/dsa/blob/main/0096-unique-binary-search-trees/0096-unique-binary-search-trees_sol2.cpp"
click node_validate_bst "https://github.com/sagark-05/dsa/blob/main/0098-validate-binary-search-tree/0098-validate-binary-search-tree.cpp"
click node_kth_bst "https://github.com/sagark-05/dsa/blob/main/0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.cpp"
click node_delete_bst "https://github.com/sagark-05/dsa/blob/main/0450-delete-node-in-a-bst/0450-delete-node-in-a-bst.cpp"
click node_search_bst "https://github.com/sagark-05/dsa/blob/main/0700-search-in-a-binary-search-tree/0700-search-in-a-binary-search-tree.cpp"
click node_insert_bst "https://github.com/sagark-05/dsa/blob/main/0701-insert-into-a-binary-search-tree/0701-insert-into-a-binary-search-tree.cpp"
click node_right_view "https://github.com/sagark-05/dsa/blob/main/0199-binary-tree-right-side-view/0199-binary-tree-right-side-view.cpp"
click node_count_nodes "https://github.com/sagark-05/dsa/blob/main/0222-count-complete-tree-nodes/0222-count-complete-tree-nodes.cpp"
click node_tree_width "https://github.com/sagark-05/dsa/blob/main/0662-maximum-width-of-binary-tree/0662-maximum-width-of-binary-tree.cpp"
click node_distance_k "https://github.com/sagark-05/dsa/blob/main/0863-all-nodes-distance-k-in-binary-tree/0863-all-nodes-distance-k-in-binary-tree.cpp"
click node_valid_anagram "https://github.com/sagark-05/dsa/blob/main/0242-valid-anagram/0242-valid-anagram.cpp"
click node_capitalize_title "https://github.com/sagark-05/dsa/blob/main/2129-capitalize-the-title/2129-capitalize-the-title.cpp"
click node_anagram_groups "https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/anagram-groups/submission-0.cpp"
click node_is_anagram "https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/is-anagram/submission-0.cpp"
click node_longest_repeating "https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/longest-repeating-substring-with-replacement/submission-0.cpp"
click node_right_side "https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/duplicate-integer/submission-1.cpp"
click node_two_sum "https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/two-integer-sum/submission-3.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_valid_parentheses,node_generate_parentheses,node_longest_valid_parentheses,node_valid_parenthesis_string toneBlue
class node_right_view,node_count_nodes,node_tree_width,node_distance_k toneAmber
class node_unique_bsts,node_unique_bsts_dp,node_validate_bst,node_kth_bst,node_delete_bst,node_search_bst,node_insert_bst toneMint
class node_valid_anagram,node_capitalize_title,node_anagram_groups,node_is_anagram,node_longest_repeating toneRose
class node_right_side,node_two_sum toneIndigo
```

## Components

### Bracket Algorithms

- [Valid Parentheses](https://github.com/sagark-05/dsa/blob/main/0020-valid-parentheses/0020-valid-parentheses.cpp): `0020-valid-parentheses/0020-valid-parentheses.cpp`
- [Generate Parentheses](https://github.com/sagark-05/dsa/blob/main/0022-generate-parentheses/0022-generate-parentheses.cpp): `0022-generate-parentheses/0022-generate-parentheses.cpp`
- [Longest Valid Parentheses](https://github.com/sagark-05/dsa/blob/main/0032-longest-valid-parentheses/0032-longest-valid-parentheses.cpp): `0032-longest-valid-parentheses/0032-longest-valid-parentheses.cpp`
- [Valid Parenthesis String](https://github.com/sagark-05/dsa/blob/main/0678-valid-parenthesis-string/0678-valid-parenthesis-string.cpp): `0678-valid-parenthesis-string/0678-valid-parenthesis-string.cpp`

### Tree Algorithms

- [Right Side View](https://github.com/sagark-05/dsa/blob/main/0199-binary-tree-right-side-view/0199-binary-tree-right-side-view.cpp): `0199-binary-tree-right-side-view/0199-binary-tree-right-side-view.cpp`
- [Count Complete Nodes](https://github.com/sagark-05/dsa/blob/main/0222-count-complete-tree-nodes/0222-count-complete-tree-nodes.cpp): `0222-count-complete-tree-nodes/0222-count-complete-tree-nodes.cpp`
- [Maximum Tree Width](https://github.com/sagark-05/dsa/blob/main/0662-maximum-width-of-binary-tree/0662-maximum-width-of-binary-tree.cpp): `0662-maximum-width-of-binary-tree/0662-maximum-width-of-binary-tree.cpp`
- [Nodes At Distance K](https://github.com/sagark-05/dsa/blob/main/0863-all-nodes-distance-k-in-binary-tree/0863-all-nodes-distance-k-in-binary-tree.cpp): `0863-all-nodes-distance-k-in-binary-tree/0863-all-nodes-distance-k-in-binary-tree.cpp`

### BST Algorithms

- [Count Unique BSTs](https://github.com/sagark-05/dsa/blob/main/0096-unique-binary-search-trees/0096-unique-binary-search-trees.cpp): `0096-unique-binary-search-trees/0096-unique-binary-search-trees.cpp`
- [Unique BST DP](https://github.com/sagark-05/dsa/blob/main/0096-unique-binary-search-trees/0096-unique-binary-search-trees_sol2.cpp): `0096-unique-binary-search-trees/0096-unique-binary-search-trees_sol2.cpp`
- [Validate BST](https://github.com/sagark-05/dsa/blob/main/0098-validate-binary-search-tree/0098-validate-binary-search-tree.cpp): `0098-validate-binary-search-tree/0098-validate-binary-search-tree.cpp`
- [Kth Smallest BST](https://github.com/sagark-05/dsa/blob/main/0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.cpp): `0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.cpp`
- [Delete BST Node](https://github.com/sagark-05/dsa/blob/main/0450-delete-node-in-a-bst/0450-delete-node-in-a-bst.cpp): `0450-delete-node-in-a-bst/0450-delete-node-in-a-bst.cpp`
- [Search BST](https://github.com/sagark-05/dsa/blob/main/0700-search-in-a-binary-search-tree/0700-search-in-a-binary-search-tree.cpp): `0700-search-in-a-binary-search-tree/0700-search-in-a-binary-search-tree.cpp`
- [Insert BST Node](https://github.com/sagark-05/dsa/blob/main/0701-insert-into-a-binary-search-tree/0701-insert-into-a-binary-search-tree.cpp): `0701-insert-into-a-binary-search-tree/0701-insert-into-a-binary-search-tree.cpp`

### String And Hashing

- [Valid Anagram](https://github.com/sagark-05/dsa/blob/main/0242-valid-anagram/0242-valid-anagram.cpp): `0242-valid-anagram/0242-valid-anagram.cpp`
- [Capitalize Title](https://github.com/sagark-05/dsa/blob/main/2129-capitalize-the-title/2129-capitalize-the-title.cpp): `2129-capitalize-the-title/2129-capitalize-the-title.cpp`
- [Group Anagrams](https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/anagram-groups/submission-0.cpp): `Data Structures & Algorithms/anagram-groups/submission-0.cpp`
- [Anagram Check](https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/is-anagram/submission-0.cpp): `Data Structures & Algorithms/is-anagram/submission-0.cpp`
- [Longest Repeating Substring](https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/longest-repeating-substring-with-replacement/submission-0.cpp): `Data Structures & Algorithms/longest-repeating-substring-with-replacement/submission-0.cpp`

### Other Interview Problems

- [Duplicate Integer](https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/duplicate-integer/submission-1.cpp): `Data Structures & Algorithms/duplicate-integer/submission-1.cpp`
- [Two Integer Sum](https://github.com/sagark-05/dsa/blob/main/Data%20Structures%20%26%20Algorithms/two-integer-sum/submission-3.cpp): `Data Structures & Algorithms/two-integer-sum/submission-3.cpp`
