Computer Science · Data Structures
Consider the following array-based Queue implementation in Python. What is the value of q.front after executing the given operations? class Queue: def init(self, size): self.arr = [None]*size; self.front = -1; self.rear = -1; self.size = size def enqueue(self, val): if self.rear == self.size - 1: return 'Full' if self.front == -1: self.front = 0 self.rear += 1; self.arr[self.rear] = val q = Queue(3); q.enqueue(10); q.enqueue(20); q.enqueue(30)
- 1-1
- 22
- 30✓
- 43
Correct answer
0
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Data Structures?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Data Structures