Algorithm 4th edition of Eclipse Environment building

Source: Internet
Author: User

The home page has the relevant environment configuration

http://algs4.cs.princeton.edu/windows/

Download the Algs4.exe and install it, but it will take a lot of useless steps.

Since you are using eclipse, it is good to configure it directly under Eclipse.

The work is very simple, is to add Stdlib.jar and Algs4.jar two packs into your project just fine.

Under Project Build path, select Add External Archives and then find Stdlib.jar and Algs4.jar.

In addition, many of the programs in the book are input redirection to get input:

Java BinarySearch TinyW.txt < tinyT.txt

It's not easy to use redirects in Eclipse, so what do you do?

Methods are:

First, directly with the scanner class:

Direct Read input:

New Scanner (system.in);

Use Crtl+z to terminate input

Read in from text:

1 New Scanner (new file ("filename")); 2  while (Stdin.hasnext ()) {3     int key = stdin.nextint (); 4 }

Second, the implementation of the console, the Stdlib.jar added into the classpath.

Algorithm 4th edition of Eclipse Environment building

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.