milexm / needles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

needles

Search for the specified words (needles) contained in a string (haystack) and display the results accordingly. The needles class contains 3 methods: a "standard" one which uses the suggested approach; a first improved method which moves the split operation outside the loop to improve execution speed; a second improved performance method which uses a hash map to improve execution speed.

Runnig the Example

Create a runnable JAR. In the directory where you stored the file, from the command console, run the following command:

java -jar needles.jar

About


Languages

Language:Java 100.0%