Question: S209 Data Structures and Algorithms -Quiz 2 riday, Feb 22, 2019 1. Figure 1 shows a Singly linked list with four nodes. The reference variable
S209 Data Structures and Algorithms -Quiz 2 riday, Feb 22, 2019 1. Figure 1 shows a Singly linked list with four nodes. The reference variable head points to the first nod The reference variable tail points to the last node. Each node has an integer element and a next reference. head tail next element node Figure Assume that we defined a Node class already The statement Node newest -new Node"E") can be used to allocate a new node whose element is Please use short English sentences or pseudocode to describe the following operations. You are encouraged to draw pictures to justify your code. (Write a few lines of code to accomplish each operation can get extra 8 credits for each question). A. (25 points) insert a new node which has an element "E" at the head of a Singly linked list B. (25 points) Insert a new node which has an element "E" at the tail of a Singly linked list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
