java.lang.NullPointerException
at test.LinkedList.add(LinkedList.java:23)
at test.LinkedListDictionary.put(LinkedListDictionary.java:18)
at...
Type: Posts; User: 3sbwya
java.lang.NullPointerException
at test.LinkedList.add(LinkedList.java:23)
at test.LinkedListDictionary.put(LinkedListDictionary.java:18)
at...
So I'm brushing up on my data structures and have been working on Linked Lists and Hashtables. The following method is from my Linked List class:
public void add(String key, Model pair){
...
Oh wow, I was assuming the array was getting initialized in the constructor but it wasn't. Stupid mistake. Fixed it and it works fine. Thanks
Ok so I'm working on this program which passes the elements on an array into an array object. It compiles but I keep getting an ArrayIndexOutOfBoundsException: 0 error.
Its happening at...
Ok thanks! I think I got it.
Yeah the error message is:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 13
at qselect.QSelect.quickSelect(QSelect.java:91)
at qselect.QSelect.main(QSelect.java:33)
I'm work on the quickSelect algorithm to find the kth smallest integer however I keep getting the java.lang.ArrayIndexOutOfBoundsException error.
import java.io.*;
import...
The problem is that it takes roughly 25-30 min for the program to finish running. That's what I meant by bogging it down. I'm confused on whats going on within the quickSort method that's causing...
I'm working on this program which uses the quickSort algorithm to sort arrays of N sizes using the median of 3 to determine the pivot. The output is to print the list the number of comparisons for...
Thanks. That helped a ton
I'm working on this program where I create an array of random integers and use bubble sort to get them in order:
package bubblesort;
import java.util.Random;
public class BubbleSort {
...