Giter Club home page Giter Club logo

stanford_cs106b_assignments's Introduction

Stanford_CS106B_Assignments

My solutions to the assignments I have undertaken for the CS106B (Programming Abstractions in C++) course, in Stanford University. I provided the source codes and input files only, no project files.

The assignment topics are as follows:

Assignment 1: Pixel manipulation using Grid and Vector data structures.

Assignment 2: Breadth first search, file reading, and random text generation through Markov chains.

Assignment 3: Fractal graphics using recursion (fractals such as Sierpinski, Tree and Mandelbrot Set), grammar structure solver using recursive exploration.

Assignment 4: Code for the game Boggle(human vs computer), uses recursive backtracking to explore words in a boggle game grid.

Assignment 5: Implementation of priority queues using dynamically allocated arrays, binary heaps, and linked lists.

Assignment 6: Implementation of the huffman algorithm using binary trees to build a compression program.

Assignment 7: A* algorithm, Dijkstra, BFS, Alternative path algorithms for path finding in a geographic map that is represented as a graph.

stanford_cs106b_assignments's People

Contributors

efeacer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

stanford_cs106b_assignments's Issues

assignment 5

void LinkedListPatientQueue::upgradePatient(string name, int newPriority) {
    if (front == nullptr) { //error case
        throw("Invalid Operation: The queue of patients is empty.");
    } else {
        PatientNode* current = front;
        while (current->next != nullptr && current->next->name != name) {
            current = current->next;
        }
        if (current->next == nullptr) { //error case
            throw("Invalid Operation: There is no patient with the given name.");
        } else {
            PatientNode* toModify = current->next;
            if (toModify->priority < newPriority) { //error case
                throw("Invalid Operation: The priority of the patient is already greater than the"
                " new priority.");
            } else {
                current->next = toModify->next;
                newPatient(toModify->name, newPriority);
                delete toModify; //preventing memory leak.
            }
        }
    }
}

in linked list implementation cpp file, function upgradepatient, this code doesn't consider when you want to change the priority of frontname, an error would generate.

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.