Code Monkey home page Code Monkey logo

data-structures's Introduction

Data Structures

A data structures library implemented in C++ that features commonly found structures such as queues, stacks, singly linked lists and dynamic arrays. The library has been designed so that the data structures are independent of any C++ standard or third-party library. Data structures have been designed to build upon previous structures, for example the priority queue is implemented using the library's own dynamic array class.

The time complexities of each structure's operations are included alongside the method’s declaration in the structures header class. Within each data structures folder is a Main.cpp file which is not a dependency to create the data structure but provides a console system to easily create and modify the relevant data structure for testing.

Included Data Structures

Some data structures are built ontop of existing data structures in the library. This relationship is highlighed by including the underlying data structure used in parenthesis.

  • Singly Linked List
  • Dynamic Array (static arrays)
  • Stack (singly linked list)
  • Queue (singly linked list)
  • Priority Queue (dynamic array - represents binary heaps)

Example Makefile for Debugging

This is an example makefile for debugging the Priority Queue. Place the following makefile, alongside all .cpp and .h dependencies.

CC = g++

PriorityQueue: DynamicArray.o PriorityQueue.o Main.o
	$(CC) -o PriorityQueue DynamicArray.o PriorityQueue.o Main.o
	$(RM) *.o

DynamicArray.o: DynamicArray.cpp DynamicArray.h
	$(CC) -c DynamicArray.cpp

PriorityQueue.o: PriorityQueue.cpp PriorityQueue.h
	$(CC) -c PriorityQueue.cpp

Main.o: Main.cpp PriorityQueue.h
	$(CC) -c Main.cpp

clean:
	$(RM) PriorityQueue *.o *-

data-structures's People

Contributors

fraserlove avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bhak-tu

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.