I am trying to write a method to find the smallest value in a queue, but I keep on getting an error and I can not figure out what’s wrong!
public void findmin(){
Node current = front;E min = current.Data;while ( current != null){if (min > current.Data)min= current.Data ;current= current.next;}System.out.println("the smallest value in the queue is: "+ min);}
E min = current.Data;
while ( current != null)
{
if (min > current.Data)
min= current.Data ;
current= current.next;
}
System.out.println("the smallest value in the queue is: "+ min);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here