(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