CSD201_-_FA_2024_-_FE_-_C1_2980.webp
T

CSD201_-_FA_2024_-_FE_-_C1_2980.webp

  • Media owner Thu Hà1
  • Ngày thêm
(Choose 1 answer)
Suppose we are implementing a stack of Integers using a singly linked list where the head of the list is treated as the top of the stack.
Specify the correct implementation of push() method of the stack. (Choose the most suitable one)
A. void push(Integer x){ Node p = new Node(x);p.next = head;head=p.next;}
B. void push(Integer x){ Node p = new Node(x);p.next = head;}
C. void push(Integer x){ Node p = new Node(x);p.next = null;head=p;}
D. void push(Integer x){ Node p = new Node(x);p.next = head;head=p;}

50

Thông tin

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

Image metadata

Filename
CSD201_-_FA_2024_-_FE_-_C1_2980.webp
File size
228.1 KB
Dimensions
1920px x 1012px

Share this media

Back
Bên trên Bottom