Skip to content

ipototsky/Princeton-Algorithms

 
 

Repository files navigation

Princeton-Algorithms

Java

Environment Setup

  • Read instructions on installation of java and its dependencies: java-algs4
  • Set Java compiler langauge level to 7.

CLI

To run programm in the command line interface (CLI): Normal

javac <name>.java
java <name>

To include the classpath in algo4 standard libraries:

javac-algs4 <name>.java
java-algs4 <name>

javac-algs4 will do the following:

#!/bin/bash
INSTALL=~/algs4
jars=(.:${INSTALL}/stdlib.jar:${INSTALL}/algs4.jar)
javac -cp "$jars" -g -encoding UTF-8 "$@"

IntelliJ

To run programm in IntelliJ:

  1. Open the root director as the project root in IntelliJ
  2. Set language level to 7
  3. Add ~/algs4/algs4.jar and ~/algs4/stdlib.jar to project's external libraries
  4. In each assignment folder, mark src as Sources Root
  5. Create target folder tagert/classes, target/test-classes, and add them to project target folders
  6. To compile and run, add maven framework support and ignore the generated src folder

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.7%
  • Shell 0.3%