/dsa-go

Data structures and algorithms practice in Go

Primary LanguageGo

DSA Practice in Go

Data Structures

  • Linked List
  • Doubly Linked List
  • Queue (FIFO)
  • Stack (LIFO)
  • Hash Table + Collision Handling
  • BST
  • Heap
  • AVL
  • Graph
    • Matrix
    • Adjacency List

Algorithms

Searching

  • Binary Search
  • Linear Search

Sorting

  • Bubble Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Counting Sort
  • Shell Sort
  • Heap Sort

String Matching

Tree Traversals

  • Pre-order
  • In-order
  • Post-order
  • Level-Order

Graph Traversals

  • Tree Height
  • Detecting Cycles
  • Breadth First
  • Depth First
  • Dijkstra's algorithm (shortest path)

Usage

Create a new Go module (if you don't already have existing module):

go mod init <your-module>

Install the dsa-go module:

go get -u github.com/bcdxn/dsa-go

Tests

go test -v -coverprofile cover.out ./...
go tool cover -html cover.out -o cover.html
open cover.html