Lecture 8

You always need at least one function that puts

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: ” at position “i” into “L”. You always need at least one function that puts something INTO an abstract data type. Sometimes you have several such functions. The C++ function call is: The C++ function call is: x = L.Length( ); 3 L.Insert(i, newitem); 4 Delete(L,i) We need to specify more about the behavior of Insert. What if we are trying to insert something at position “3” and there is something already at position “3”? Then we move the item from “3” to “4”, etc. What if we are trying to insert something at “3” and the list is empty? We prohibit insert at any place after length(L)+1. 5 This deletes the item at position “i” in th...
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