Hi all,
I have code that find the solution to a N-queens problem by starting at the upper left hand corner of the board and works its way through the rows and columns. However, I would like to...
Type: Posts; User: dubois.ford
Hi all,
I have code that find the solution to a N-queens problem by starting at the upper left hand corner of the board and works its way through the rows and columns. However, I would like to...
Hello,
I am having a real hard to trying to figure out how to use generics
I have the following insertion sort method defined
public static <T extends Comparable<? super T>> void...
I am trying to print out the object in a tree. I have a toString method defined for the object. However, I get this error:
I get a classCastException
Exception in thread "main"...
Thank you for the replies.
myCharFreqNode is the type of an object I created. It is declared like this in main
charFreqNode mycharFreqNode[] = new charFreqNode[2];
The class definition...
Hello all,
I declare an array of objects with a default capacity of 2 and I am trying to expand capacity once the limit is meet. I am calling the "expandCapacity" method which creates a new array of...
Hello all,
I am attempting to write a program that will read the characters of a text file one by one and keep the count of the number of times each character appears. I would like to use the table...
Thanks that solved it.
Hello,
I have the following generic function declared.
public static <T extends Comparable<? super T>> void selectionSort (T[] data)
However eclipse will not compile saying:
The method...
Thanks that solved it. So the BufferedWriter wrtie(int c) method tries to look up the corresponding ASCII value of the int?
Hello,
I am simply trying to print a random integer to a text file. However when I open up the text it just shows= square shapes and not the numbers. I attached the .txt file
public void...
Hello,
I am trying to read a simple .txt file of ints into a 2D array. However, the scanner object seems to skip the first few ints. The "scanner.hasNext()" seems to advance the scanner. Please let...