---
## 📘 README.md
```markdown
# LeetCodeUtils
LeetCodeUtils is a reusable **.NET 8 class library** that provides helper utilities for solving LeetCode problems.
It includes canonical data structures (`ListNode`, `TreeNode`) and utility methods (`ListNodeUtils`, `TreeNodeUtils`) for **creation, printing, and debugging** linked lists and binary trees.
---
LeetCodeUtils.sln
│
├── src/
│ ├── LeetCodeUtils/ # Class Library (NuGet-ready)
│ │ ├── ListNode.cs
│ │ ├── TreeNode.cs
│ │ ├── ListNodeUtils.cs
│ │ └── TreeNodeUtils.cs
│ │
│ └── LeetCodeUtils.Console/ # Console demo project
│ └── Program.cs
│
└── tests/
└── LeetCodeUtils.Tests/ # xUnit test project
├── ListNodeUtilsTests.cs
└── TreeNodeUtilsTests.cs
git clone https://github.com/wayneblackmon/LeetCodeUtils.git
cd LeetCodeUtils
dotnet builddotnet run --project src/LeetCodeUtils.Consoledotnet testusing LeetCodeUtils;
var list = ListNodeUtils.Create(new int[] { 1, 2, 3, 4 });
Console.WriteLine(list.Print());
// Output: 1 -> 2 -> 3 -> 4using LeetCodeUtils;
var tree = TreeNodeUtils.Create(new int[] { 1, 2, 3, 4, 5 });
Console.WriteLine(tree.Print());
// Output: [1, 2, 3, 4, 5]Unit tests are included in the LeetCodeUtils.Tests project using xUnit:
[Fact]
public void Print_ShouldReturnCorrectString()
{
var head = ListNodeUtils.Create(new int[] { 1, 2, 3 });
Assert.Equal("1 -> 2 -> 3", head.Print());
}Run tests:
dotnet testTo build and pack the library:
dotnet pack src/LeetCodeUtils/LeetCodeUtils.csproj -c Release -o ./artifactsTo publish to NuGet.org:
dotnet nuget push ./artifacts/LeetCodeUtils.*.nupkg --api-key YOUR_KEY --source https://api.nuget.org/v3/index.json- Add PrettyPrint ASCII renderer for binary trees
- Add random generators for linked lists and trees
- Add conversion utilities (array ↔ list/tree)
- Expand test coverage
LeetCodeUtils uses a fully automated release pipeline powered by:
- Semantic version tags (
v1.2.3) - GitHub Actions CI/CD
- NuGet Trusted Publishing (no API keys required)
- A local versioning script (
tag-release.ps1)
Publishing a new version requires one command.
Use the tag-release.ps1 script to create and push version tags.
./tag-release.ps1 -Patch
## 📜 License
MIT License © Wayne Eliot Blackmon⚡ This is now a single, self‑contained README file you can drop into the root of your repo. It covers solution structure, usage, tests, NuGet packaging, and roadmap all in one place.
👉 Do you want me to also add badges (build status, NuGet version, test coverage) so your README looks polished when hosted on GitHub?