I am to remove all duplicates form an array.
For example:
4 7 11 4 9 5 11 7 3 5
should be changed to
4 7 11 9 4 3
I am not supposed to use hashtables. Is there a simple way to do this. I...
Type: Posts; User: nicsa
I am to remove all duplicates form an array.
For example:
4 7 11 4 9 5 11 7 3 5
should be changed to
4 7 11 9 4 3
I am not supposed to use hashtables. Is there a simple way to do this. I...
I don't get what you mean
public int sortedSearch(int value)
{
int x=0;
while(x<a.length)
{
if(a[x]==value)
{
return x;
}
else
public int sortedSearch(int value)
{
for(int x=0;x<a.length; x++)
{
if(a[x]==value)
return x;
}
return -1;
}
I am trying to create a method to search a sorted array for a value in the most efficient way possible. My teacher doesn't want us to use binary search yet. This is the code I have so far, is there...
Hi, I seem to be having a consistent error when I try to add the values of an array I created to a String. I keep getting a NullPointerException Error. I went through and checked to make sure that...
It was my toString, that was dumb of me.
I am adding the values in the salespersonTotal method.
This is what I get when I print out the values:
System.out.println(productTotal[0]);
System.out.println(productTotal[1]);
System.out.println(productTotal[2]);...
Hi, I am new to programming. I have an assignment where I am to create a class that processes a sales slip that contains a salesperson number, product number, and the total dollar value of that...