Giter VIP home page Giter VIP logo

algorithm451's Introduction

204451: Algorithm Analysis

This mini-project uses Cmake to compile the source code. In case you haven't installed Cmake, I recommend that you search for the instruction to install it on Google.

To run

I assume you are using a Unix-compliance OS, like Linux or macOS. If not, for example, you are running on Windows instead, then I don't know.

Execute

make all

then you will see a new file algorithm451.out, an executable file.

Next, run

./algorithm451.out

You will see a prompt that asks you to input a specific choice (in other words, a character) to choose what to run.

==========
[1] HW01 - Stern Brocot Path
[2] HW02 - Sport Day
[3] HW03 - Tiling
[4] HW04 - Bambina
[5] TEST - Hack Test
[6] TEST2 - Pascal Triangle DP
[7] TEST3 - LCS
==========

Homework number:

For example, if you want to run HW01, then input 1 (it is between [ and ]) and enter. It will then bring you to HW01.

To run with input sample text file

echo "hw_no "$(cat input_sample/filename.txt) | ./algorithm451.out

For example,

echo "2 "$(cat input_sample/hw02_in02.txt) | ./algorithm451.out

In this case, hw_no is 2.

To run with input sample and compare

Run a command in a form of

( cmd | ( cmd | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )

This command compares outputs from two commands. In our case, for example

( (echo "2 "$(cat input_sample/hw02_in02.txt) | ./algorithm451.out --no-prompt)
| ( cat output_sample/hw02_out02.txt | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )

The output

To submit to the grader

If you take a look carefully in the homework files, you will notice that there are no main funcions (those declared using int main()). This is because of the compilation convenience. However, I already made a solution for such a problem.

Go to the root directory of this project, and run

python make_submission_file.py src/*.cpp

algorithm451's People

Contributors

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