Lecture 11

Delete cur deallocates storage space 7 precondition

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: es up memory space. delete cur; // deallocates storage space 7 PRECONDITION: head points to a sorted non-empty linked list. X is an integer to be deleted. 8 What is left to do (for you)? POSTCONDITION: head points to a sorted linked list that does not contain X. Either the sorted linked list is unchanged, then Success if False. Or the sorted linked list is one element shorter, then the variable Success is True. 1) 2) 3) 4) Put all pieces together Write a function header Add the function to class listClass Use the same variables as listInsert 9 Compare Linked List and Array Destructor Deallocate all the nodes in...
View Full Document

This document was uploaded on 03/31/2014 for the course CS 114 at NJIT.

Ask a homework question - tutors are online