Giter Club home page Giter Club logo

datastructures-algorithms's Introduction

Datastructures And Algorithms

Most popular data structures and algorithms

Build Status Coverage MIT GitHub release Maven

Data Structures

Data Structure Methods
Linked List pushFront() - O(1), popFront() - O(1), pushBack() - O(1), popBack() - O(1), getHead() - O(1), getSize() - O(1), contains() - O(n)
Stack push() - O(1), pop() - O(1), isEmpty() - O(1), getSize() - O(1), peek() - O(1)
Queue enqueue() - O(1), dequeue() - O(1), isEmpty() - O(1), getSize() - O(1) isFull() - O(1)
Deque enqueueFront() - O(1), enqueueRear() - O(1), dequeueFront() - O(1), dequeueRear() - O(1), isEmpty() - O(1), getSize() - O(1) peekFront() - O(1), peekRear - O(1)
Map put() - O(n), remove() - O(n), get() - O(n), getSize() - O(1), containsValue() - O(n), containsKey() - O(n)
MinHeap insert() - O(logn), remove() - O(logn), heapify() - O(logn)
Binary Search Tree insert() - O(n), find() - O(n), delete() - O(n), size() - ฮ˜(1), findMin() - O(n), getTreeHeight() - O(n), preOrderVisit() - O(n), inOrderVisit() - O(n), postOrderVisit() - O(n)
Trie insert() - O(|s|), search() - O(|s|)
Graph

Algorithms

Sorting

Algorithm Worst-case time complexity Average-case time complexity Best-case time complexity
BubbleSort O(n^2) O(n^2) O(n)
InsertionSort O(n^2) O(n^2) O(n)
QuickSort O(n^2) O(nlogn) O(nlogn)
SelectionSort O(n^2) O(n^2) O(n^2)
MergeSort O(nlogn) O(nlogn) O(nlogn)
HeapSort O(nlogn) O(nlogn) O(nlogn)

Strings

Arrays

Stacks

Lists

Trees

Dependency

To add a dependency using Maven:

<dependency>
  <groupId>io.github.mihaijulien</groupId>
  <artifactId>ds-and-algo</artifactId>
  <version>2.0.0</version>
</dependency>

To add a dependency using Gradle:

implementation 'io.github.mihaijulien:ds-and-algo:2.0.0'

Build

mvn clean install

Generate Changelog

git-chglog

License

Licensed under MIT.

datastructures-algorithms's People

Contributors

mihaijulien avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.