CSD201_-_FE_-_SU_2023_401.webp
C

CSD201_-_FE_-_SU_2023_401.webp

  • Media owner Carla89
  • Ngày thêm
OD
(Choose 1 answer)
Suppose we are implementing a queue using a singly linked list where the end of the list i:
of the queue.
}
Specify the correct implementation of enqueue() method of the queue. (Choose the most:
A. void enqueue(Object x)
{ Node p = new Node(x);
p.next = null;
tail.next = p;tail = p;
}
B. void enqueue(Object x)
{ Node p = new Node(x);
p.next = null;
if(isEmpty())
head = tail = p;
else
{ tail.next = p;
tail = p;
}
C. void enqueue(Object x){ Node p = new Node(x);
p.next = null;if(isEmpty())
head = tail = p;
else
tail.next = p;
22

Thông tin

Category
CSD201
Thêm bởi
Carla89
Ngày thêm
Lượt xem
1,607
Lượt bình luận
14
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD201_-_FE_-_SU_2023_401.webp
File size
58.2 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom