Skip to content

nsnikhil/go-datastructures

Repository files navigation

DataStructures in GO

Motivation

This Project aims to port/build well known and commonly used data structures to GO.


This library uses reflection for every method call to verify if the type the element to add is same as other elements in the list.


DataStructures this project wish to cover, this list might grow with time:

List

  • ArrayList
  • Doubly LinkedList
  • Skip List

Map

  • Hash Map
  • Linked Hash Map
  • Tree Map

Set

  • HashSet

Stack

  • Stack

Queue

  • Linked Queue
  • DeQue
  • Blocking Queue
  • Priority Queue

Tree

  • Binary Tree
  • Binary Search Tree
  • AVL Tree
  • Red Black Tree
  • N-Ary Tree
  • Segment Tree
  • Trie

B-trees

  • B-Tree

Heaps

  • Heap

Graph

  • Graphs
  • Adjacency List
  • Adjacency Matrix

Hash Based

  • Hash List
  • Hash Table
  • Hash Tree
  • Bloom Filters
  • Compressed Trie
  • Hash Trie

Streams

  • Stream

Usage

  1. go get -u github.com/nsnikhil/go-datastructures

Contributing

  1. Fork it (https://github.com/nsnikhil/go-datastructures)
  2. make setup
  3. Create your feature branch (git checkout -b feature/fooBar)
  4. Commit your changes (git commit -am 'Add some fooBar')
  5. Push to the branch (git push origin feature/fooBar)
  6. Create a new Pull Request

Known Issues

1Concurrent search dose not provide enough performance benefits and also the benchmark test for the same sometimes gets into infinite loop. 2In heap one can add two elements even though the comparator type and element type is not same.


License

Copyright 2022 Nikhil Soni

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

This Project aims to port/build well known and commonly used data structures to GO.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published