I have the following Subset.java
file:
package week2;
import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.StdIn;
public class Subset {
public static void main(String[] args) {
int k = Integer.parseInt(args[0]);
RandomizedQueue<String> randQueue = new RandomizedQueue<String>();
while (!StdIn.isEmpty()) {
randQueue.enqueue(StdIn.readString());
}
for (int i = 0; i < k; i++) {
StdOut.println(randQueue.dequeue());
}
}
}
There is also a RandomizedQueue.java
in the same folder. However, when I run javac-algs4 Subset.java
in the terminal, I get the following error:
Subset.java:10: error: cannot find symbol
RandomizedQueue<String> randQueue = new RandomizedQueue<String>();
^
symbol: class RandomizedQueue
location: class Subset
Subset.java:10: error: cannot find symbol
RandomizedQueue<String> randQueue = new RandomizedQueue<String>();
^
symbol: class RandomizedQueue
location: class Subset
2 errors
(Please excuse me, I am brand new to Java.)