1表-顺序存储结构概要.ppt

1表-顺序存储结构概要

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 过程: 1、判断idx的合法性 2、返回原来的theItems [idx] 原型: public AnyType set( int idx, AnyType newVal ) 作用:将theItems[idx]赋值为newVal set theItems A 10 theItems[0] theItems[9] set(5,newVal) newVal set old=theItems[5] set public AnyType set( int idx, AnyType newVal ) { if( idx 0 || idx size( ) ) throw new ArrayIndexOutOfBoundsException( “Index + idx + ; size + size( ) ); AnyType old = theItems[ idx ]; theItems[ idx ] = newV

文档评论(0)

1亿VIP精品文档

相关文档