Question: JAVA PROGRAMMING I need to bubbleSort to throw NullPointerException when it is pass an empty array public static void bubbleSort (Item) vec) if (vec :
JAVA PROGRAMMING
I need to bubbleSort to throw NullPointerException when it is pass an empty array

public static void bubbleSort (Item) vec) if (vec : nullowshruluneinterExcepterException(); int nvec.length-1; Item temp; int bottom for (bottom 1; bottom n; bottom++) / bottom for each pass for (int i n-1; i - bottom; i--) if (vec[i-1].key> vec[i].key) temp = vec [1-1]; vecli-1] vec[i] vec[i] temp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
