Skip to content

Commit da1b376

Browse files
authored
Update Queue.java
1 parent 8c60384 commit da1b376

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

Queue.java

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
2-
/**
3-
* Class Queue.java
4-
* A class that represents an implementation of a Queue in java
5-
*/
1+
//*******************************************************
2+
// Queue.java
3+
// A class that represents an implementation of a Queue in java
4+
// Author: liron mizrahi
5+
//*******************************************************
66
public class Queue
77
{
88
int[] _queue;
@@ -22,7 +22,7 @@ public Queue(int sizeOfArray)
2222
_size = 0;
2323
}//end of method Queue
2424
/**
25-
* getSize get the size of the queue
25+
* method return the size of the queue
2626
* @param None
2727
* @return int
2828
*/
@@ -31,7 +31,7 @@ public int getSize()
3131
return _size;
3232
}// end of method getSize
3333
/**
34-
* checking if the queue is empty
34+
* return true if the queue is empty
3535
* @param None
3636
* @return boolean
3737
*/
@@ -46,7 +46,7 @@ public boolean isEmpty()
4646
return response;
4747
}//end of method isEmpty
4848
/**
49-
* enQueue method is insert value to queue
49+
* method is insert value to queue
5050
* @param int
5151
* @return boolean
5252
*/
@@ -64,7 +64,7 @@ public boolean enQueue(int element)
6464
return response;
6565
}//end of method enQueue
6666
/**
67-
* dequeue method is removing value from queue
67+
* method is removing value from queue
6868
* @param None
6969
* @return int
7070
*/
@@ -81,7 +81,7 @@ public int deQueue()
8181
return response;
8282
}// end of method deQueue
8383
/**
84-
* show method is print the queue elements
84+
* method is print the queue elements
8585
* @param None
8686
* @return None
8787
*/
@@ -95,7 +95,7 @@ public void show()
9595
}
9696
}// end of method show
9797
/**
98-
* peek method is show the first element in queue
98+
* method is show the first element in queue
9999
* @param None
100100
* @return int
101101
*/
@@ -107,12 +107,8 @@ public int peek()
107107
response = _queue[_front + 1];
108108
}
109109
return response;
110-
}
111-
/**
112-
* main method
113-
* @param args (array type java.lang)
114-
* @return None
115-
*/
110+
}// end of method peek
111+
116112
public static void main(String[] args)
117113
{
118114
// making queue object
@@ -127,4 +123,4 @@ public static void main(String[] args)
127123
queue.isEmpty(); //return false
128124
System.out.println(queue.deQueue() + " deleted from the list"); // return 1000 deleted from the list
129125
}// end of method main
130-
}
126+
}// end of class Queue

0 commit comments

Comments
 (0)