# xurui1995/sword-pointing-to-offer architecture

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

- Interactive diagram: https://gitdiagram.com/xurui1995/sword-pointing-to-offer
- Repository: https://github.com/xurui1995/sword-pointing-to-offer

## Overview

This repository is a collection of standalone solutions to the 2012 edition of 《剑指 Offer》, with Java and Kotlin examples rather than one integrated application. The typical user workflow is to run an individual exercise’s entry point and inspect its printed result; there is no shared runtime orchestrator. The visible examples cover linked-list operations and binary-tree algorithms, with additional exercises present in the tree. Unread solutions are grouped by language because their specific topics and relationships are not established by the available excerpts.

Main entry points: [`剑指offer-2012年书籍版/Java/BinaryTreeNode.java`](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/BinaryTreeNode.java) (Binary tree node), [`剑指offer-2012年书籍版/Kotlin/Node.kt`](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/Node.kt) (List node), [`剑指offer-2012年书籍版/Java/No18.java`](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No18.java) (Match subtree), [`剑指offer-2012年书籍版/Java/No19.java`](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No19.java) (Mirror tree)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_java["Java solutions"]
  node_java_other["Other exercises"]
  node_tree_match["Match subtree<br/>[No18.java]"]
  node_tree_mirror["Mirror tree<br/>[No19.java]"]
  node_tree_breadth["Level traversal<br/>[No23.java]"]
  node_tree_paths["Find tree paths<br/>[No25.java]"]
  node_tree_list["Tree to list<br/>[No27.java]"]
  node_tree_node["Binary tree node"]
  node_java_list["Reverse list<br/>[No05.java]"]
  node_complex_clone["Clone complex list<br/>[No26.java]"]
end

subgraph group_kotlin["Kotlin solutions"]
  node_list_reverse["Reverse list<br/>[No05.kt]"]
  node_list_delete["Delete list node<br/>[No13.kt]"]
  node_list_tail["Find from tail<br/>[No15.kt]"]
  node_kotlin_node["List node<br/>[Node.kt]"]
  node_kotlin_other["Other exercises"]
end

node_user(("Engineer"))

node_user -->|"runs example"| node_list_reverse
node_user -->|"runs example"| node_list_delete
node_user -->|"runs example"| node_list_tail
node_user -->|"runs example"| node_tree_match
node_user -->|"runs example"| node_tree_mirror
node_user -->|"runs example"| node_tree_breadth
node_user -->|"runs example"| node_tree_paths
node_user -->|"runs example"| node_tree_list
node_user -->|"runs example"| node_java_list
node_user -->|"runs example"| node_complex_clone
node_list_reverse -->|"uses nodes"| node_kotlin_node
node_list_delete -->|"uses nodes"| node_kotlin_node
node_list_tail -->|"uses nodes"| node_kotlin_node
node_tree_match -->|"uses nodes"| node_tree_node
node_tree_mirror -->|"uses nodes"| node_tree_node
node_tree_breadth -->|"uses nodes"| node_tree_node
node_tree_paths -->|"uses nodes"| node_tree_node
node_tree_list -->|"uses nodes"| node_tree_node

click node_java_other "https://github.com/xurui1995/sword-pointing-to-offer/tree/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java"
click node_list_reverse "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/No05.kt"
click node_list_delete "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/No13.kt"
click node_list_tail "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/No15.kt"
click node_kotlin_node "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/Node.kt"
click node_tree_match "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No18.java"
click node_tree_mirror "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No19.java"
click node_tree_breadth "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No23.java"
click node_tree_paths "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No25.java"
click node_tree_list "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No27.java"
click node_tree_node "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/BinaryTreeNode.java"
click node_java_list "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No05.java"
click node_complex_clone "https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No26.java"
click node_kotlin_other "https://github.com/xurui1995/sword-pointing-to-offer/tree/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin"

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_java_other,node_tree_match,node_tree_mirror,node_tree_breadth,node_tree_paths,node_tree_list,node_tree_node,node_java_list,node_complex_clone toneBlue
class node_list_reverse,node_list_delete,node_list_tail,node_kotlin_node,node_kotlin_other toneAmber
class node_user toneIndigo
```

## Components

### Java solutions

- [Other exercises](https://github.com/xurui1995/sword-pointing-to-offer/tree/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java): `剑指offer-2012年书籍版/Java`
- [Match subtree](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No18.java): `剑指offer-2012年书籍版/Java/No18.java`
- [Mirror tree](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No19.java): `剑指offer-2012年书籍版/Java/No19.java`
- [Level traversal](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No23.java): `剑指offer-2012年书籍版/Java/No23.java`
- [Find tree paths](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No25.java): `剑指offer-2012年书籍版/Java/No25.java`
- [Tree to list](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No27.java): `剑指offer-2012年书籍版/Java/No27.java`
- [Binary tree node](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/BinaryTreeNode.java): `剑指offer-2012年书籍版/Java/BinaryTreeNode.java`
- [Reverse list](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No05.java): `剑指offer-2012年书籍版/Java/No05.java`
- [Clone complex list](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Java/No26.java): `剑指offer-2012年书籍版/Java/No26.java`

### Kotlin solutions

- [Reverse list](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/No05.kt): `剑指offer-2012年书籍版/Kotlin/No05.kt`
- [Delete list node](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/No13.kt): `剑指offer-2012年书籍版/Kotlin/No13.kt`
- [Find from tail](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/No15.kt): `剑指offer-2012年书籍版/Kotlin/No15.kt`
- [List node](https://github.com/xurui1995/sword-pointing-to-offer/blob/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin/Node.kt): `剑指offer-2012年书籍版/Kotlin/Node.kt`
- [Other exercises](https://github.com/xurui1995/sword-pointing-to-offer/tree/master/%E5%89%91%E6%8C%87offer-2012%E5%B9%B4%E4%B9%A6%E7%B1%8D%E7%89%88/Kotlin): `剑指offer-2012年书籍版/Kotlin`

### Other components

- **Engineer**

## Connections

- Engineer → Reverse list: runs example (evidence: `剑指offer-2012年书籍版/Kotlin/No05.kt`)
- Engineer → Delete list node: runs example (evidence: `剑指offer-2012年书籍版/Kotlin/No13.kt`)
- Engineer → Find from tail: runs example (evidence: `剑指offer-2012年书籍版/Kotlin/No15.kt`)
- Engineer → Match subtree: runs example (evidence: `剑指offer-2012年书籍版/Java/No18.java`)
- Engineer → Mirror tree: runs example (evidence: `剑指offer-2012年书籍版/Java/No19.java`)
- Engineer → Level traversal: runs example (evidence: `剑指offer-2012年书籍版/Java/No23.java`)
- Engineer → Find tree paths: runs example (evidence: `剑指offer-2012年书籍版/Java/No25.java`)
- Engineer → Tree to list: runs example (evidence: `剑指offer-2012年书籍版/Java/No27.java`)
- Engineer → Reverse list: runs example (evidence: `剑指offer-2012年书籍版/Java/No05.java`)
- Engineer → Clone complex list: runs example (evidence: `剑指offer-2012年书籍版/Java/No26.java`)
- Reverse list → List node: uses nodes (evidence: `剑指offer-2012年书籍版/Kotlin/No05.kt`)
- Delete list node → List node: uses nodes (evidence: `剑指offer-2012年书籍版/Kotlin/No13.kt`)
- Find from tail → List node: uses nodes (evidence: `剑指offer-2012年书籍版/Kotlin/No15.kt`)
- Match subtree → Binary tree node: uses nodes (evidence: `剑指offer-2012年书籍版/Java/No18.java`)
- Mirror tree → Binary tree node: uses nodes (evidence: `剑指offer-2012年书籍版/Java/No19.java`)
- Level traversal → Binary tree node: uses nodes (evidence: `剑指offer-2012年书籍版/Java/No23.java`)
- Find tree paths → Binary tree node: uses nodes (evidence: `剑指offer-2012年书籍版/Java/No25.java`)
- Tree to list → Binary tree node: uses nodes (evidence: `剑指offer-2012年书籍版/Java/No27.java`)
