How Do You Insert An Element At The Beginning Of The List #81
How do you insert an element at the beginning of the list?
This multiple choice question (MCQ) is related to the book/course gs gs121 Data Structures and Algorithms. It can also be found in gs gs121 Abstract Data Types - Singly Linked Lists - Quiz No.1.
How do you insert an element at the beginning of the list?
public void insertBegin(Node node) { node.setNext(head); head = node; size++; }
public void insertBegin(Node node) { head = node; node.setNext(head); size++; }
public void insertBegin(Node node) { Node temp = head.getNext() node.setNext(temp); head = node; size++; }
public void insertBegin(Node node) { Node temp = head.getNext() node.setNext(temp); node = head; size++; }
Similar question(s) are as followings:
Online Quizzes of gs121 Data Structures and Algorithms
Binary Trees - Binary Search Tree - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Binary Search Tree - Quiz No.2
gs gs121 Data Structures and Algorithms
Online Quizzes
Binary Trees - Preorder Traversal - Quiz No.1
gs gs121 Data Structures and Algorithms
Online Quizzes