This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Simple generic insertion sort implementation. It accepts a list of object that implements Comparable and override compareTo method. | |
| * Usage: | |
| * InsertionSort ms = new InsertionSort(); | |
| * List<String> unsortedStrings = ... | |
| * List<String> sortedStrings = ms.insertionSort(unsortedStrings); | |
| * | |
| * class SampleObject implements Comparable<SampleObject>{ | |
| * private String value; | |
| * . . . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Simple generic merge sort implementation. It accepts a list of object that implements Comparable and override compareTo method. | |
| * Usage: | |
| * MergeSort ms = new MergeSort(); | |
| * List<String> unsortedStrings = ... | |
| * List<String> sortedStrings = ms.mergeSort(unsortedStrings); | |
| * | |
| * class SampleObject implements Comparable<SampleObject>{ | |
| * private String value; | |
| * . . . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * A simple chemical equations parser that I made for my dad. | |
| */ | |
| import java.util.HashMap; | |
| import java.util.concurrent.atomic.AtomicBoolean; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class ChemicalEquationParser { |