填空题

在一个有n个元素的顺序表的第i个元素(1≤i≤n)之前插入一个新元素时,需要向后移动 【1】 个元素。

【参考答案】

n-i+1
<上一题 目录 下一题>
热门 试题

单项选择题
下面程序的输出结果是( )。 public class Sun public static void main(String args[ ]) int n=4 ,sum=0; while(n>0) sum+=n; n--; System.out.println( sum is +sum);
A.sum is 10
B.sum is 4
C.10
D.4
单项选择题
下面的哪些程序段可能导致错误 ( ) Ⅰ:String s= Gone with the wind ; String t= good ; String k=s+t; Ⅱ:String s= Gone with the wind ; String t; t=s[3]+ one ; Ⅲ:String s= Gone with the wind ; String standard=s.toUpperCase(); Ⅳ:String s= home directory ; String t=s- directory ;
A.Ⅱ、Ⅲ
B.Ⅱ、Ⅳ
C.Ⅰ、Ⅳ
D.Ⅲ、Ⅳ
相关试题
  • 下列JApplet对鼠标单击事件进行处理,当鼠...
  • 变量名、 【14】 首单词小写,其余单词...
  • 有如下代码段,请填写完整所缺的部分。 im...
  • Applet工作在图形方式下,向其中绘图、显示...
  • Java图形用户界面编程中的最基本组成部分是...