MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / getFront

Method getFront

Java/design-circular-deque.java:124–129  ·  view source on GitHub ↗

Get the front item from the deque.

()

Source from the content-addressed store, hash-verified

122
123 /** Get the front item from the deque. */
124 public int getFront() {
125 if(this.size == 0) { // if array is empty, return -1
126 return -1;
127 }
128 return arr[front]; // else return the element
129 }
130
131 /** Get the last item from the deque. */
132 public int getRear() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected