Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vhyran/dsa

DSA in zig
https://github.com/vhyran/dsa

dsa learn-to-code learning learning-by-doing practice zig zig-learn ziglang

Last synced: 15 days ago
JSON representation

DSA in zig

Awesome Lists containing this project

README

        

# Data Structures and Algorithms in Zig

Welcome to the **Data Structures and Algorithms (DSA)** repository implemented in the Zig programming language! This repository serves as a resource for anyone interested in learning about fundamental DSA concepts and their implementations in Zig.

## Introduction

This repository contains implementations of common data structures and algorithms in Zig. The goal is to provide clean, efficient, and well-documented code that serves as both a learning resource and a utility for developers.

## Why Zig?

Zig is a modern programming language designed for simplicity, performance, and reliability. Its features include:
- Manual memory management with safety checks
- No hidden control flow or memory allocations
- Compile-time code execution
- Interoperability with C

These features make Zig a great choice for implementing efficient and predictable data structures and algorithms.

## Implemented Data Structures

### Linear Data Structures
- [ ] Arrays
- [ ] Linked Lists (Singly and Doubly)
- [ ] Stacks
- [ ] Queues (Simple and Circular)

### Non-Linear Data Structures
- [ ] Trees (Binary Tree, Binary Search Tree, AVL Tree)
- [ ] Heaps (Min-Heap, Max-Heap)
- [ ] Graphs (Adjacency List, Adjacency Matrix)

### Hashing
- [ ] Hash Tables

## Implemented Algorithms

### Sorting Algorithms
- [ ] Bubble Sort
- [ ] Insertion Sort
- [ ] Merge Sort
- [ ] Quick Sort
- [ ] Heap Sort

### Searching Algorithms
- [ ] Linear Search
- [ ] Binary Search

### Graph Algorithms
- [ ] Breadth-First Search (BFS)
- [ ] Depth-First Search (DFS)
- [ ] Dijkstra’s Algorithm
- [ ] Kruskal’s Algorithm
- [ ] Prim’s Algorithm

### Other Algorithms
- [ ] Dynamic Programming (Examples: Fibonacci, Knapsack Problem)
- [ ] Divide and Conquer (Examples: Merge Sort, Binary Search)
- [ ] Backtracking (Examples: N-Queens, Sudoku Solver)

## Getting Started

### Prerequisites
- Install [Zig](https://ziglang.org/download/) on your system.

### Compiling and Running Code
To compile and run an implementation:

```bash
zig build .zig
./
```

## Contributing

Contributions are welcome! If you’d like to add a new data structure, algorithm, or improve existing implementations, please follow these steps:

1. Fork this repository.
2. Create a new branch: `git checkout -b feature/`.
3. Commit your changes: `git commit -m 'Add new feature'`.
4. Push to the branch: `git push origin feature/`.
5. Submit a pull request.

Ensure your code follows the Zig coding standards and includes appropriate comments and test cases.

## License

This repository is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

---

Feel free to explore, learn, and contribute!