数据结构(牛小飞)1 表-顺序存储结构.pptVIP

  • 1
  • 0
  • 约8.35千字
  • 约 58页
  • 2017-05-30 发布于浙江
  • 举报

数据结构(牛小飞)1 表-顺序存储结构.ppt

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 过程: 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精品文档

相关文档