Giter Site home page Giter Site logo

tymotex / tactile-ds Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 1.0 10.52 MB

A suite of interactive data structures and algorithms implemented in C/C++. Interactive web terminal: https://data-structures.xyz/

Home Page: https://tactile-ds.timz.dev

C 95.98% Makefile 1.83% Shell 0.58% Perl 0.49% SCSS 0.03% Ruby 0.72% Python 0.10% HTML 0.26%
graph tree linked-list sorting-algorithms-implemented visualization

tactile-ds's Introduction

Data Structures and Algorithms ๐Ÿ’ป

This is a collection of implementations and interactive visualisers of classic data structures and algorithms in C.

This repository contains the backend code for the web terminal interface here. Use incognito mode to prevent any chrome extensions from interfering with the formatting and avoid resizing the window.

View my notes here!

Table of Contents

Demo

Watch a video demo here.

TactileDS demo video

Setup Instructions


Simple Setup for COMP2521:

When connected to CSE servers, just copy and paste these commands onto the terminal and hit enter after pasting each one:

  1. git clone https://github.com/Tymotex/DataStructures.git && cd DataStructures
  2. ./util/scripts/make_recurse.sh
  3. You now have access to all the interactive data structures. The commands to run each of them are:
    • Linked Lists:
      1. cd linked-list/iterative-version or cd linked-list/recursive-version
      2. ./testLinkedList <space separated integers> - initially constructs a linked list from the supplied sequence of integers. Eg. ./testLinkedList 42 10 4 20
    • Binary Search Tree:
      1. cd binary-tree
      2. ./testTree <space separated integers> - initially constructs a tree from the supplied sequence of integers. Eg. ./testTree 6 3 10 1 4 8 12 7 9
    • AVL Tree:
      1. cd avl-tree
      2. ./testTree <space separated integers> - initially constructs an AVLtree from the supplied sequence of integers. Eg. ./testTree 1 2 3 4 5 6 7
    • Splay Tree:
      1. cd splay-tree
      2. ./testTree <space separated integers> - initially constructs a splay tree from the supplied sequence of integers. Eg. ./testTree 5 3 8 7 4
    • Graphs:
      • Unweighted
        • Undirected
          1. cd unweighted-graph
          2. ./testGraph <num vertices>|<input file> - creates an empty graph with the specified number of vertices OR constructs a graph with edges specified in an input file. Eg. ./testGraph 10 or ./testGraph tests/1.in
        • Directed
          1. cd unweighted-digraph
          2. ./testGraph <num vertices>|<input file> - creates an empty graph with the specified number of vertices OR constructs a graph with edges specified in an input file. Eg. ./testGraph 10 or ./testGraph tests/1.in
      • Weighted
        • Undirected
          1. cd weighted-graph
          2. ./testGraph <num vertices>|<input file> - creates an empty graph with the specified number of vertices OR constructs a graph with edges specified in an input file. Eg. ./testGraph 10 or ./testGraph tests/1.in
        • Directed
          1. cd weighted-digraph
          2. ./testGraph <num vertices>|<input file> - creates an empty graph with the specified number of vertices OR constructs a graph with edges specified in an input file. Eg. ./testGraph 10 or ./testGraph tests/1.in
    • Hash Table:
      1. cd hash-table
      2. ./testHash <size> - creates an empty hash table with the specified size (otherwise defaults to 10 slots). Eg. ./testHash 12
    • Heap:
      1. cd heap
      2. ./testHeap <size> - creates an empty hash table with the specified size (otherwise defaults to 10 slots). Eg. ./testHeap 12
    • Sorting Algorithms:
      1. cd sorting-algos
      2. Optional: generate sequences using: ./generate-tests -n <num random files> <list of sizes>. Eg. ./generate-tests -n 5 10 100 1000
      3. ./testSort <filename> - takes in a file containing a sequence of numbers. Eg. ./testSort tests/random100_1 or ./testSort --silent tests/random_100_1

Setup for Development:

  1. git clone https://github.com/Tymotex/DataStructures.git && cd DataStructures - downloads this repository and changes directory to the project root directory
  2. Install GoTTy
  3. Run bundle install in the root directory to install Ruby dependencies. See the ruby bundler. This project uses Ruby v2.7.0
  4. ./util/scripts/make_recurse.sh - recursively runs make on all subdirectories. This automatically compiles all the data structures
  5. ruby terminal-menu.rb - starts the selection menu where all the interactive visualisers can be accessed

Web Deployment:

Instructions for testing/deploying the web-based version:

  1. sh server.sh --start - runs the terminal sharing web service. Access at localhost:8080. Use nohup sh server.sh --start & to start the server as a background process
  2. sh server.sh --stop - kills the web terminal server process

An interactive linked list builder written in C. Supports standard operations (iteratively and recursively) such as insertion, deletion, searching, sorting and reversing.

Implementation for each command is viewable in linked-list.c and linked-list.h in the linked-list/iterative-version and linked-list/recursive-version directories. View the source code here.

Example Usage:

An interactive binary search tree builder written in C. Supports standard operations such as insertion, deletion, rotation, and in-order, pre-order, post-order and level-order printing.

Implementation for each command is viewable in tree.c and tree.h in the binary-tree directory. View the source code here.

Example Usage:

An interactive AVL tree builder written in C. Supports AVL insertion, AVL deletion and commands to print the height of each node and the height balance of each node.

Implementation for each command is viewable in tree.c and tree.h in the avl-tree directory. View the source code here.

Example Usage:

An interactive splay tree builder written in C. Splay trees differ from regular BSTs in that searching and inserting a value involves bringing the target/inserted node to the root.

Implementation for each command is viewable in tree.c and tree.h in the splay-tree directory. View the source code here.

Example Usage:

Interactive unweighted directed/undirected graph builder written in C.

Implementation for each command is viewable in graph.c, graph.h, graph-algos.c and graph-algos.h in the unweighted-graph and unweighted-digraph directories.

Example Usage:

Digraph:

Undirected Graph:

Interactive weighted directed/undirected graph builder written in C. Implements Dijkstra's algorithm for determining a single source spanning tree.

Implementation for each command is viewable in graph.c, graph.h, graph-algos.c, graph-algos.h, dijkstra.c and dijkstra.h in the weighted-graph and weighted-digraph directories.

Example Usage:

Digraph:

Undirected Graph:

Interactive hash table written in C for storing key-value pairs.

Implementation for each command is viewable in hash-table.c and hash-table.h in the hash-table directory. View source code here.

Example Usage:

Interactive max heap table written in C.

Implementation for each command is viewable in heap.c and heap.h in the heap directory. View source code here.

Example Usage:

A collection of classic sort algorithms written in C. Timing data is shown for each sort algorithm used.

Implementation for each command is viewable in sort.c and sort.h in the sorting-algos directory. View source code here.

Example Usage:

tactile-ds's People

Contributors

tymotex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hacjkerman

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.