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

Method getRear

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

Get the last item from the deque.

()

Source from the content-addressed store, hash-verified

130
131 /** Get the last item from the deque. */
132 public int getRear() {
133 if(this.size == 0) { // if array is empty, return -1
134 return -1;
135 }
136 return arr[rear]; // else return the rear
137 }
138
139 /** Checks whether the circular deque is empty or not. */
140 public boolean isEmpty() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected