填空题

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

【参考答案】

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

单项选择题
下面的哪些程序段可能导致错误 ( ) Ⅰ: 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.Ⅲ、Ⅳ
单项选择题
设有如下程序: import java.util.*; public class Sun { public static void main(String args[ ]) { int score; String a; Random r=new Random(); score=r.nextInt(4)+5; switch(score) { case 0: a= E ; break; case 1: a= D ; break; case 2: a= C ; break; case 3: a= B ; break; default: a= A ; } System.out.println(A) ; } } 程序运行的结果是( )。
A.a="A"
B.aa"E" a="A"
C.a="E"
D.a="C"
相关试题
  • 下列JApplet对鼠标单击事件进行处理,当鼠...
  • 变量名、 【14】 首单词小写,其余单词...
  • 阅读下面代码:import java.awt.*;pub...
  • Applet工作在图形方式下,向其中绘图、显示...
  • Java图形用户界面编程中的最基本组成部分是...