CSD201_-_SU_2024_-_FE_2351.webp
P

CSD201_-_SU_2024_-_FE_2351.webp

(Choose 1 answer)
Specify the correct implementation of pop() method of a stack. This stack uses java.util.LinkedList for storing data and the end of the list is treated as the top of the stack. (Choose the most suitable one)
A. void pop(Object x)
{ if (isEmpty()) return(null);pool.remove(pool.size()-1);}
B. Object pop(){ if (isEmpty()) return(null);return(pool.removeLast());}
C. Object pop()
{if (isEmpty()) return;return(pool.remove(pool.size()-1));}
D. Object pop()
{ if (isEmpty()) return(null);return(pool.remove(pool.size()));}

Thông tin

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

Image metadata

Filename
CSD201_-_SU_2024_-_FE_2351.webp
File size
316.2 KB
Dimensions
2239px x 1174px

Share this media

Back
Bên trên Bottom