数据库安全工程师单选难度 3真题改编 · 2023
380. 在教学管理系统中,存在如下关系模式:
- 教师表:`T(T#, NAME)`(`T#` 为教师工号,主键)
- 学生表:`S(S#, NAME)`(`S#` 为学生学号,主键)
- 成绩表:`G(S#, T#, NU)`(记录学生在某教师授课下获得的成绩 `NU`;`S#` 外键指向 `S`,`T#` 外键指向 `T`)
问:实体“教师 `T`”与“学生 `S`”之间的联系类型为()。
练习本题 ›
算法与数据结构栈单选难度 3真题改编 · 2024
381. 下列程序的运行结果是( )
import java.util.*;
class Test{
public static void main(String[] args){
int[] pushA={1,2,4,5,3,6};
int[] popA1={4,5,2,3,1,6};
int[] popA2={4,6,5,2,3,1};
boolean res1=IsPopOrder(pushA,popA1);
boolean res2=IsPopOrder(pushA,popA2);
System.out.println(res1);
System.out.println(res2);
}
public static boolean IsPopOrder(int[] pushA,int[] popA){
if(pushA.length==0||popA.length==0) return false;
Stack<Integer> st=new Stack<Integer>();
int index=0;
for(int i=0;i<pushA.length;i++){
st.push(pushA[i]);
while(!st.empty()&&st.peek()==popA[index]){
st.pop();
index++;
}
}
return st.empty();
}
}
练习本题 ›