单选题120 秒 6. 下列关于结构体初始化的写法,正确的是( )。struct Point { int x, y; }; Point p = (1,2);struct Point { int x, y; }; Point p = {1,2};struct Point { int x, y; }; Point p = new Point(1,2);struct Point { int x, y; }; Point p = <1,2>;
单选题120 秒 10. 某排序算法对如下数据排序(按 score 升序),则下面关于该排序算法稳定性的描述中,说法正确的是()。 初始:(90,'A'), (90,'B'), (80,'C'), (90,'D') 排序后:(80,'C'), (90,'A'), (90,'B'), (90,'D')不稳定,因为出现了相同分数稳定,因为相同 score 的相对顺序保持为 A 在 B 前、B 在 D 前不稳定,因为 C 跑到前面了无法判断
单选题120 秒 15. 下列函数实现排行榜中单个元素的位置调整(类似插入排序的相邻搬移)。当某玩家分数增加,需将其向前移动时,while 循环的条件应为( )。i > 0 && cur.score > players[i-1].scorei > 0 && cur.score < players[i-1].scorei < n-1 && cur.score > players[i+1].scorei < n-1 && cur.score < players[i+1].score