Skip to content

Commit

Permalink
removed unnecessary statements
Browse files Browse the repository at this point in the history
  • Loading branch information
MartyMiniac authored Mar 17, 2020
1 parent 5b0c8c4 commit 1938a03
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions Semester 2 (DSA)/assignment 3/a3q18.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void pop()
}
catch(StackUnderflowException e)
{
//e.printStackTrace();
e.printStackTrace();
}
}
else
Expand All @@ -80,7 +80,7 @@ int peek()
}
else
{
//System.out.print("Queue is Empty, Nothing to show");
System.out.print("Queue is Empty, Nothing to show");
return -1;
}
}
Expand All @@ -94,7 +94,7 @@ void push(int i)
}
catch(StackOverflowException e)
{
//e.printStackTrace();
e.printStackTrace();
}
}
else
Expand All @@ -106,16 +106,8 @@ void push(int i)
int[] show()
{
if(top==-1)
{
try
{
throw new QueueEmptyException("Queue is empty Nothing to Show");
}
catch(QueueEmptyException e)
{
//e.printStackTrace();
{
return null;
}
}
else
{
Expand Down Expand Up @@ -158,10 +150,3 @@ class StackOverflowException extends Exception
super(s);
}
}
class QueueEmptyException extends Exception
{
QueueEmptyException(String s)
{
super(s);
}
}

0 comments on commit 1938a03

Please sign in to comment.