Untitled
unknown
plain_text
2 years ago
566 B
11
Indexable
class Tile{ public int x; public int y; public Tile(int x, int y){ this.x = x; this.y = y; } } class TileQueue{ public Tile[] queue = new Tile[1000005]; public int front, rear; public TileQueue(){ this.front = -1; this.rear = -1; } public void reset(){ this.front = -1; this.rear = -1; } public void enQueue(Tile c){ rear++; queue[rear] = c; } public Tile deQueue(){ front++; return queue[front]; } public boolean isEmpty(){ if (rear == front){ return true; } return false; } }
Editor is loading...
Leave a Comment