Git Product home page Git Product logo

simple_ds's Introduction

simple_ds

My implementation of basement data structures in C#

Hello, my name is Artem. I decided to create my implementation of data structures which I use every day in my programming projects. List of data structures in this project:

  1. Stack
  2. Queue
  3. Linked list
  4. Double linked list (double-ended queue)
  5. Graphs (TODO)
  6. Trees (TODO)
  7. Prefix trees (TODO)
  8. Hash tables (TODO)

Wiki

Stack

For stack, I used List type from System.Collections.Generic. What Stack class can do?

  1. int Size() - return size of a stack
  2. bool isEmpty() - check if stack is empty
  3. T Peek() - return top element of a stack without removing it
  4. void Push(T new_item) - add a new item on top of a stack (NOTE: top of a stack it is list element of a list)
  5. T Pop() - return top element of a stack and remove it
  6. Stack Reverse() - return stack with reversed elements order in a stack (turn a stack into a queue)
  7. Stack Copy() - return a deep copy of a stack
  8. void Sort() - sort values in this stack (bubble sort) TODO(another algorithm of sorting)!

Queue

For queue, I used List type from System.Collections.Generic. What Queue class can do?

  1. int Size() - return size of a queue
  2. bool isEmpty() - check if queue is empty
  3. T Top() - return top element of a queue without remowing it
  4. void Enqueue(T new_item) - add new item on the end of a queue
  5. T Dequeue() - return top element of a queue and remowe it
  6. void Reverse() - reverse elements order in a queue
  7. void Reverse(int n) - reverse first n-elements in a queue
  8. Queue Copy() - return a deep copy of a queue
  9. void Sort() - sort values in this queue (bubble sort) TODO(another alghorithm of sorting)!
  10. void Clear() - clear a queue

LinkedList

For a linked list I used List type from System.Collections.Generic. What LinkedList class can do?

  1. int Size() - return size of a linked list
  2. bool isEmpty() - check if linked list is empty
  3. T PeekHead() - return head element of a linked list without removing it
  4. T GetElement(int n) - return n-element of a linked list without removing it
  5. void PushBack(T item) - add a new item on the end of a linked list
  6. void PushStart(T item) - add a new item on the end of a linked list (but move the head pointer on it)
  7. T RemoveHead() - return value of a head element of a linked list and remove it
  8. T RemoveElement(int n) - return value of an n-element of a linked list and remove it
  9. void Reverse() - reverse elements order in a linked list
  10. LinkedList Copy() - return a deep copy of a linked list
  11. void Sort() - sort values in this linked (bubble sort) TODO(another algorithm of sorting)!
  12. void Clear() - clear a linked list

DoubleLinkedList

For a double linked list, I used List type from System.Collections.Generic. What DoubleLinkedList class can do?

  1. int Size() - return size of a linked list
  2. bool isEmpty() - check if linked list is empty
  3. T PeekHead() - return head element of a linked list without removing it
  4. T PeekTail() - return tail element of a linked list without removing it
  5. T GetElementFromStart(int id) - return n-element from start of a linked list without removing it
  6. T GetElementFromBack(int id) - return n-element from the back of a linked list without removing it
  7. void PushBack(T item) - add a new item on the end of a linked list
  8. void PushStart(T item) - add a new item on the end of a linked list (but move the head pointer on it)
  9. T RemoveHead() - return value of a head element of a linked list and remove it
  10. T RemoveTail() - return value of a tail element of a linked list and remove it
  11. T RemoveElementFromStart(int id) - return n-element from start of a linked list and remove it
  12. T RemoveElementFromBack(int id) - return n-element from back of a linked list and remove it
  13. void Reverse() - reverse elements order in a linked list
  14. DoubleLinkedList Copy() - return a deep copy of a linked list
  15. void Sort() - sort values in this linked (bubble sort) TODO(another algorithm of sorting)!
  16. void Clear() - clear a linked list

simple_ds's People

Contributors

artemkakun avatar

Stargazers

 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.