Git Product home page Git Product logo

nickolasnolte1 / data-structures Goto Github PK

View Code? Open in Web Editor NEW

This project forked from armi3/data-structures

0.0 0.0 0.0 84.06 MB

๐Ÿ“ This is a collection of implementations I did for my university data structures course. Each exercise has testing, profiling, a demo recording and some useful resources. Java, C and Python were used.

C 0.21% Dockerfile 0.01% Java 9.16% Python 90.61% HTML 0.01%

data-structures's Introduction

Data structures

This is a collection of implementations I did for my university data structures course. Each exercise has testing, profiling, a demo recording and some useful resources. Java, C and Python were used.

Table of contents

  1. Exercise 1 ๐Ÿงฎ
  2. Exercise 2 (Stacks)
  3. Exercise 3 (Arrays) ๐Ÿ’ณ
  4. Exercise 4 (Matrices) ๐Ÿ›’
  5. Exercise 5 (Strings) ๐Ÿ“Š
  6. Exercise 6 (Structs)
  7. Exercise 7 (Circular Linked List) ๐ŸŽง
  8. Exercise 8 (Queue and Simply Linked List) ๐Ÿ“†
  9. Exercise 9 (B-tree) ๐ŸŒณ
  10. Laboratory (Dijkstra's SPF algorithm)
  11. Final project (Boxit) ๐Ÿ“ฆ

Exercise 1 ๐Ÿงฎ

  • Algorithm to find the sum of the first N natural numbers.
  • Code in C
  • Demo: https://youtu.be/8mKBWEocZ48
  • Unit testing with dockerized CUnit
  • Profiling with dockerized Valgrind:
    • Memory profiling with Memcheck tool
    • Heap, allocation tree and stack profiling with Massif tool
    • Call profiling with Callgrind tool

Walkthrough

Get the program compiled and running:

git clone https://github.com/armi3/data-structures.git; \
cd exercise\ 1/src && cc -std=c99 -o app app.c functions.c && ./app

Build Ubuntu 16 based container with CUnit and Valgrind:

cd .. && docker build -t memory-test:0.1 .

Test the program's methods with dockerized CUnit:

docker run -ti -v $PWD:/test memory-test:0.1 bash -c \
"cd /test/; gcc -std=c99 -o tests/functions_test tests/functions_test.c -lcunit -v; \
tests/functions_test"

Profile program with dockerized Valgrind

Heap, allocation tree and stack profiling:

docker run -ti -v $PWD:/test memory-test:0.1 bash -c \
"cd /test/; gcc -std=c99 -o src/app src/app.c src/functions.c -g; \
valgrind --tool=massif --stacks=yes --massif-out-file=profiling/massif_app src/app; \
ms_print profiling/massif_app"

Memory profiling:

docker run -ti -v $PWD:/test memory-test:0.1 bash -c \
"cd /test/; gcc -std=c99 -o src/app src/app.c src/functions.c -g; \
valgrind --leak-check=full -v src/app"

Call profiling:

docker run -ti -v $PWD:/test memory-test:0.1 bash -c \
"cd /test/; gcc -std=c99 -o src/app src/app.c src/functions.c -g; \
valgrind --tool=callgrind --callgrind-out-file=profiling/callgrind_app -v src/app; \
valgrind callgrind_annotate --tree=both --auto=yes profiling/callgrind_app"

Profile test with dockerized Valgrind

Heap, allocation tree and stack profiling:

docker run -ti -v $PWD:/test memory-test:0.1 bash -c \
"cd /test/; gcc -std=c99 -o tests/functions_test tests/functions_test.c -g -lcunit -v; \
valgrind --tool=massif --stacks=yes --massif-out-file=profiling/massif_functions_test tests/functions_test; \
ms_print profiling/massif_functions_test"

Memory profiling:

docker run -ti -v $PWD:/test memory-test:0.1 bash -c \
"cd /test/; gcc -std=c99 -o tests/functions_test tests/functions_test.c -g -lcunit -v; \
valgrind --leak-check=full -v tests/functions_test"

Call profiling:

docker run -ti -v $PWD:/test memory-test:0.1 bash -c \
"cd /test/; gcc -std=c99 -o tests/functions_test tests/functions_test.c -g -lcunit -v; \
valgrind --tool=callgrind --callgrind-out-file=profiling/callgrind_functions_test -v tests/functions_test; \
valgrind callgrind_annotate --tree=both --auto=yes profiling/callgrind_functions_test"

Resources

Exercise 2 (Stacks)

  • Algorithm to implement a stack data structure.
  • Code in Java
  • Demo: https://youtu.be/9xWy4dNyj6g
  • Unit testing with JUnit 5
  • Profiling with JProfiler

Resources

Exercise 3 (Arrays) ๐Ÿ’ณ

resources

Exercise 4 (Matrices) ๐Ÿ›’

  • Shopping cart and payment methods manager.
  • Code in Java
  • Demo: https://youtu.be/ERi7V_H97Us
  • Unit testing with JUnit 5
  • Profiling with JProfiler

Exercise 5 (Strings) ๐Ÿ“Š

  • Returns a histogram with the top 10 most repeated chars.
  • Code in Java
  • Demo: https://youtu.be/uZgNDzgXhUM
  • Unit testing with JUnit 5
  • Profiling with JProfiler

Resources

Exercise 6 (Structs)

  • Returns point's quadrant implementing a struct (class without methods).
  • Code in Java
  • Demo: https://youtu.be/J9PImk7_7ho
  • Unit testing with JUnit 5
  • Profiling with JProfiler

Resources

Exercise 7 (Circular Linked List) ๐ŸŽง

  • Music player simulation implementing a circular linked list.
  • Code in Java
  • Demo: https://youtu.be/dOMIVKmkuMM
  • Unit testing with JUnit 5
  • Profiling with JProfiler

Exercise 8 (Queue and Simply Linked List) ๐Ÿ“†

  • Stores scheduled jobs in queue and updates linked list of employees.
  • Code in Java
  • Unit testing with TestNG
  • Profiling with JProfiler
  • Demo: https://youtu.be/9Br9xS27suI

Exercise 9 (B-tree) ๐ŸŒณ

  • Compares linked list performance versus b-tree.
  • Code in Java
  • Demo: https://youtu.be/1zJ_lNlY4vg
  • Unit testing with TestNG
  • Profiling with JProfiler

Resources

Laboratory (Dijkstra's SPF algorithm) ๐Ÿ’ท

  • Uses the shortest path first algorithm to find exchange rates.
  • Code in Python

Final project (Boxit) ๐Ÿ“ฆ

  • Boxit is a desktop prototype app for creating suscription boxes.
  • Implements the data structures learned throughout this course.
  • Code in Java
  • Demo: https://youtu.be/8nPCmNAcdlc
  • Unit testing with TestNG
  • Profiling with JProfiler
  • Front end with JavaFX

Screenshots

Spotlight Lab

data-structures's People

Contributors

armi3 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.