Assignment14 - declarations above(a Using the original list...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 2984 Computational Thinking Assignment 14 10 points Done by: individual A C data structure and the variable first are declared as follows: struct Element { int data; Element* next; }; Element* first; The Element structure can be used to form a sequential list of integers. Each element of the list contains a field named data to hold an integer and a field named next to hold a pointer to the following element in the list. An example of such a structure is pictured below. Answer the following questions using the picture below and the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: declarations above. (a) Using the original list pictured below, show the statements necessary to add a new list element containing the number 6 in the list following the element that contains 5 and before the element that contains 10. (b) Using the original list pictured below, show the statements necessary to remove the element with the number 10 from the list. In each case be sure that you have properly allocated or deallocated the memory as needed. first 10 12 5 null...
View Full Document

This note was uploaded on 01/23/2012 for the course CS 2984 taught by Professor Lewis during the Spring '08 term at Virginia Tech.

Ask a homework question - tutors are online