├── figures
├── .DS_Store
├── intro.png
└── paper.png
├── ProgrammingComprehension
├── eval
│ ├── category.npy
│ ├── example.npy
│ ├── deal_answer.py
│ ├── README.md
│ └── example.json
└── testcases
│ ├── testcases_zh.json
│ └── testcases_en.json
└── README.md
/figures/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/APEXLAB/CodeApex/HEAD/figures/.DS_Store
--------------------------------------------------------------------------------
/figures/intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/APEXLAB/CodeApex/HEAD/figures/intro.png
--------------------------------------------------------------------------------
/figures/paper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/APEXLAB/CodeApex/HEAD/figures/paper.png
--------------------------------------------------------------------------------
/ProgrammingComprehension/eval/category.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/APEXLAB/CodeApex/HEAD/ProgrammingComprehension/eval/category.npy
--------------------------------------------------------------------------------
/ProgrammingComprehension/eval/example.npy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/APEXLAB/CodeApex/HEAD/ProgrammingComprehension/eval/example.npy
--------------------------------------------------------------------------------
/ProgrammingComprehension/eval/deal_answer.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | import json
3 |
4 |
5 | def deal_answer():
6 |
7 | model_answer = np.load('example.npy',allow_pickle=True)
8 | category = np.load('category.npy',allow_pickle=True)
9 |
10 | cu_mdoel_answer = model_answer[np.where(category == '0')]
11 | cr_mdoel_answer = model_answer[np.where(category == '1')]
12 | mur_mdoel_answer = model_answer[np.where(category == '2')]
13 | # 0 for cu for Conceptual Understanding,
14 | # 1 for cr for Commonsense Reasoning,
15 | # 2 for mhr for Multi-Hop Reasoning,
16 |
17 |
18 | json_data = {
19 | 'Conceptual Comprehention': {str(index): item for index, item in enumerate(cu_mdoel_answer)},
20 | 'Commonsense Reasoning': {str(index): item for index, item in enumerate(cr_mdoel_answer)},
21 | 'Multi-hop/Complex Reasoning': {str(index): item for index, item in enumerate(mur_mdoel_answer)},
22 | }
23 |
24 | b = json.dumps(json_data,indent=4)
25 | with open('example.json', 'w') as f:
26 | f.write(b)
27 |
28 | return 0
29 |
30 |
31 |
32 | if __name__=="__main__":
33 | deal_answer()
34 |
35 | pass
--------------------------------------------------------------------------------
/ProgrammingComprehension/eval/README.md:
--------------------------------------------------------------------------------
1 | # Evaluation for CodeApex
2 |
3 | Open our [benchmark website](https://apex.sjtu.edu.cn/codeapex/) for evaluation.
4 |
5 | ## 1. Register
6 | Click register button. Input your username (unique for everyone), password, confirmed password, and email, and then click "Send Verifiction Code" button and wait for email verifiction code (valid in 5 minute). Input code and register.
7 |
8 |
9 | ## 2. Login
10 | After registering, you should click login button to sign in.
11 |
12 |
13 | ## 3. Leaderboard
14 | The leaderboard page is a leaderboard, which contains a Programming Comprehension Leaderboard in Chinese and a Programming Comprehension Leaderboard in English. In these two leaderboards, CU score means Conceptual Understanding scores, CR score for Commonsense Reasoning, and MCR stands for Multi-hop Reasoning. The Code Generatation Leaderboards are also completed.
15 |
16 |
17 | ## 4. Submit
18 | #### 1) Answer Format
19 | Users should be responsible for the correctness and compliance of their inputs. The format of answer generated by LLM is json, and the json file is divided into three dictionaries in order, representing the answers for CU, CR, and MCR, with each dictionary's answers sorted by ID within the dictionary. We provide a example.json.
20 |
21 | Your input should be a npy file containing your answer to the testcases, and run the deal_answer.py to generate the json file for evaluation.
22 | ```
23 | python deal_answer.py
24 | ```
25 | #### 2) How to submit
26 | You should login and click submit page. First click "choose file" button, and then input the name, author and description of your model name. Then click upload button, then click process butto, and the score of your model will appear. You will have a daily limit of 5 submissions.
27 |
28 | Due to time constraints, there are some issues with the website. Please bear with us.
29 |
30 |
--------------------------------------------------------------------------------
/ProgrammingComprehension/eval/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "Conceptual Comprehention": {
3 | "0": "C",
4 | "1": "C",
5 | "2": "C",
6 | "3": "C",
7 | "4": "C",
8 | "5": "C",
9 | "6": "C",
10 | "7": "C",
11 | "8": "C",
12 | "9": "C",
13 | "10": "C",
14 | "11": "C",
15 | "12": "C",
16 | "13": "C",
17 | "14": "C",
18 | "15": "C",
19 | "16": "C",
20 | "17": "C",
21 | "18": "C",
22 | "19": "C",
23 | "20": "C",
24 | "21": "C",
25 | "22": "C",
26 | "23": "C",
27 | "24": "C",
28 | "25": "C",
29 | "26": "C",
30 | "27": "C",
31 | "28": "C",
32 | "29": "C",
33 | "30": "C",
34 | "31": "C",
35 | "32": "C",
36 | "33": "C",
37 | "34": "C",
38 | "35": "C",
39 | "36": "C",
40 | "37": "C",
41 | "38": "C",
42 | "39": "C",
43 | "40": "C",
44 | "41": "C",
45 | "42": "C",
46 | "43": "C",
47 | "44": "C",
48 | "45": "C",
49 | "46": "C",
50 | "47": "C",
51 | "48": "C",
52 | "49": "C",
53 | "50": "C",
54 | "51": "C",
55 | "52": "C",
56 | "53": "C",
57 | "54": "C",
58 | "55": "C",
59 | "56": "C",
60 | "57": "C",
61 | "58": "C",
62 | "59": "C",
63 | "60": "C",
64 | "61": "C",
65 | "62": "C",
66 | "63": "C",
67 | "64": "C",
68 | "65": "C",
69 | "66": "C",
70 | "67": "C",
71 | "68": "C",
72 | "69": "C",
73 | "70": "C",
74 | "71": "C",
75 | "72": "C",
76 | "73": "C",
77 | "74": "C",
78 | "75": "C",
79 | "76": "C",
80 | "77": "C",
81 | "78": "C",
82 | "79": "C",
83 | "80": "C",
84 | "81": "C",
85 | "82": "C",
86 | "83": "C",
87 | "84": "C",
88 | "85": "C",
89 | "86": "C",
90 | "87": "C",
91 | "88": "C",
92 | "89": "C"
93 | },
94 | "Commonsense Reasoning": {
95 | "0": "C",
96 | "1": "C",
97 | "2": "C",
98 | "3": "C",
99 | "4": "C",
100 | "5": "C",
101 | "6": "C",
102 | "7": "C",
103 | "8": "C",
104 | "9": "C",
105 | "10": "C",
106 | "11": "C",
107 | "12": "C",
108 | "13": "C",
109 | "14": "C",
110 | "15": "C",
111 | "16": "C",
112 | "17": "C",
113 | "18": "C",
114 | "19": "C",
115 | "20": "C",
116 | "21": "C",
117 | "22": "C",
118 | "23": "C",
119 | "24": "C",
120 | "25": "C",
121 | "26": "C",
122 | "27": "C",
123 | "28": "C",
124 | "29": "C",
125 | "30": "C",
126 | "31": "C",
127 | "32": "C",
128 | "33": "C",
129 | "34": "C",
130 | "35": "C",
131 | "36": "C",
132 | "37": "C",
133 | "38": "C",
134 | "39": "C",
135 | "40": "C",
136 | "41": "C",
137 | "42": "C",
138 | "43": "C",
139 | "44": "C",
140 | "45": "C",
141 | "46": "C",
142 | "47": "C",
143 | "48": "C",
144 | "49": "C",
145 | "50": "C",
146 | "51": "C",
147 | "52": "C",
148 | "53": "C",
149 | "54": "C",
150 | "55": "C",
151 | "56": "C",
152 | "57": "C",
153 | "58": "C",
154 | "59": "C",
155 | "60": "C",
156 | "61": "C",
157 | "62": "C",
158 | "63": "C",
159 | "64": "C",
160 | "65": "C",
161 | "66": "C",
162 | "67": "C",
163 | "68": "C",
164 | "69": "C",
165 | "70": "C",
166 | "71": "C",
167 | "72": "C",
168 | "73": "C",
169 | "74": "C",
170 | "75": "C",
171 | "76": "C",
172 | "77": "C",
173 | "78": "C",
174 | "79": "C",
175 | "80": "C",
176 | "81": "C",
177 | "82": "C",
178 | "83": "C",
179 | "84": "C",
180 | "85": "C",
181 | "86": "C",
182 | "87": "C",
183 | "88": "C",
184 | "89": "C",
185 | "90": "C",
186 | "91": "C",
187 | "92": "C",
188 | "93": "C",
189 | "94": "C",
190 | "95": "C",
191 | "96": "C",
192 | "97": "C",
193 | "98": "C"
194 | },
195 | "Multi-hop/Complex Reasoning": {
196 | "0": "C",
197 | "1": "C",
198 | "2": "C",
199 | "3": "C",
200 | "4": "C",
201 | "5": "C",
202 | "6": "C",
203 | "7": "C",
204 | "8": "C",
205 | "9": "C",
206 | "10": "C",
207 | "11": "C",
208 | "12": "C",
209 | "13": "C",
210 | "14": "C",
211 | "15": "C",
212 | "16": "C",
213 | "17": "C",
214 | "18": "C",
215 | "19": "C",
216 | "20": "C",
217 | "21": "C",
218 | "22": "C",
219 | "23": "C",
220 | "24": "C",
221 | "25": "C",
222 | "26": "C",
223 | "27": "C",
224 | "28": "C",
225 | "29": "C",
226 | "30": "C",
227 | "31": "C",
228 | "32": "C",
229 | "33": "C",
230 | "34": "C",
231 | "35": "C",
232 | "36": "C",
233 | "37": "C",
234 | "38": "C",
235 | "39": "C",
236 | "40": "C",
237 | "41": "C",
238 | "42": "C",
239 | "43": "C",
240 | "44": "C",
241 | "45": "C",
242 | "46": "C",
243 | "47": "C",
244 | "48": "C",
245 | "49": "C",
246 | "50": "C",
247 | "51": "C",
248 | "52": "C",
249 | "53": "C",
250 | "54": "C",
251 | "55": "C",
252 | "56": "C",
253 | "57": "C",
254 | "58": "C",
255 | "59": "C",
256 | "60": "C"
257 | }
258 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #
2 |
3 | 
4 |
5 | CodeApex is a bilingual programming evaluation benchmark for Large Language Models. It consists two basic programming tasks: programming comprehension and code generation. **Programming Comprehension Test** consists of 250 multiple choice quesitions, including conceptual understanding, commonsense reasoning, and multi-hop reasoning three question categories. **Code generation Task** consists of 476 C++ based algorithm problems, covering common algorithm knowledge points like binary search, depth-firsts-search and so on. In the future, CodeApex will publish other code-related functional tests, such as code correction. This is an evaluation repository for the Paper "CodeApex: A Bilingual Programming Evaluation Benchmark for Large Language Models".
6 |
7 |
8 |
9 |
10 |
11 | ### News
12 |
13 | - [2023.09.05] CodeApex is published on [arXiv](https://arxiv.org/pdf/2309.01940.pdf) and [Github](https://github.com/APEXLAB/CodeApex.git). [Benchmark website]((https://apex.sjtu.edu.cn/codeapex/)) is open for commission now.
14 |
15 |
16 |
17 | ### Table of Contents
18 |
19 | - Leaderboard
20 | - Data
21 | - How to Evaluation on CodeApex
22 | - How to Submit
23 | - Licenses
24 | - Citation
25 |
26 |
27 |
28 | ### Leaderboard
29 |
30 | The public leaderboard is presented in [Leaderboard](https://apex.sjtu.edu.cn/codeapex/leaderboard/).
31 |
32 | #### Programming Comprehension
33 |
34 | | Model | AO-EN | COT-EN | AO-ZH | COT-ZH |
35 | | ------------------------ | ------ | ------ | ------ | ------ |
36 | | ChatGLM-6B | 0.2960 | 0.2640 | 0.2960 | 0.2880 |
37 | | ChatGLM-6B* | 0.3200 | 0.2760 | 0.2960 | 0.2480 |
38 | | ChatGLM2-6B | 0.2987 | 0.2960 | 0.2987 | 0.3240 |
39 | | ChatGLM2-6B* | 0.3040 | 0.2960 | 0.3040 | 0.3360 |
40 | | MOSS-16B* | 0.3120 | 0.2360 | 0.3120 | 0.2240 |
41 | | Chinese-Alpaca-7B | 0.2947 | 0.2640 | 0.2880 | 0.2680 |
42 | | Chinese-Alpaca-7B* | 0.2840 | 0.2800 | 0.2840 | 0.2640 |
43 | | Chinese-Alpaca-plus-7B | 0.2987 | 0.2880 | 0.2653 | 0.3240 |
44 | | Chinese-Alpaca-plus-7B* | 0.2573 | 0.2480 | 0.2853 | 0.2400 |
45 | | Chinese-Alpaca-13B | 0.2733 | 0.2520 | 0.2733 | 0.2640 |
46 | | Chinese-Alpaca-13B* | 0.2547 | 0.2160 | 0.2627 | 0.2640 |
47 | | Chinese-Alpaca-plus-13B | 0.2827 | 0.2560 | 0.2827 | 0.2600 |
48 | | Chinese-Alpaca-plus-13B* | 0.2973 | 0.2560 | 0.2573 | 0.2920 |
49 | | BELLE-7B-1M | 0.3080 | 0.2120 | 0.2947 | 0.2720 |
50 | | BELLE-7B-1M* | 0.3040 | 0.1840 | 0.3013 | 0.2600 |
51 | | BELLE-7B-2M | 0.2613 | 0.2040 | 0.2760 | 0.2240 |
52 | | BELLE-7B-2M* | 0.2400 | 0.1880 | 0.2413 | 0.2400 |
53 | | BELLE-LLaMA-7B-0.6M | 0.2880 | 0.2320 | 0.3053 | 0.2760 |
54 | | BELLE-LLaMA-7B-0.6M* | 0.3000 | 0.2600 | 0.3000 | 0.3200 |
55 | | BELLE-LLaMA-7B-2M | 0.2680 | 0.1880 | 0.2387 | 0.2640 |
56 | | BELLE-LLaMA-7B-2M* | 0.2840 | 0.1880 | 0.2840 | 0.2800 |
57 | | BELLE-LLaMA-13B-2M | 0.2840 | 0.2120 | 0.2840 | 0.2560 |
58 | | BELLE-LLaMA-13B-2M* | 0.2693 | 0.2120 | 0.2827 | 0.2600 |
59 | | InternLM-Chat-7B | 0.3733 | 0.3160 | 0.3720 | 0.2880 |
60 | | Baichuan-7B | 0.3147 | 0.1000 | 0.3147 | 0.0720 |
61 | | EduChat-base-002-7B* | 0.3147 | 0.2360 | 0.2480 | 0.2480 |
62 | | EduChat-base-002-13B* | 0.3267 | 0.2680 | 0.3013 | 0.2800 |
63 | | EduChat-sft-002-7B* | 0.2920 | 0.2560 | 0.2560 | 0.2520 |
64 | | CodeT5-plus-16B | 0.2640 | - | 0.2640 | - |
65 | | CodeT5-plus-16B* | 0.2467 | - | 0.3160 | - |
66 | | CodeT5-plus-6B | 0.3173 | - | 0.2693 | - |
67 | | CodeT5-plus-6B* | 0.3040 | - | 0.2573 | - |
68 | | GPT-3.5-turbo | 0.4893 | 0.4740 | 0.4893 | 0.5260 |
69 | | GPT-3.5-turbo* | 0.4413 | 0.4853 | 0.5053 | 0.5187 |
70 |
71 | #### Code Generation
72 |
73 | | | ZH | ZH | ZH | ZH | EN | EN | EN | EN |
74 | | ----------------------- | -------------- | -------- | ---------- | ----------- | -------------- | -------- | ---------- | ----------- |
75 | | **Model** | **Compilable** | **AC@1** | **AC@all** | **AC Rate** | **Compilable** | **AC@1** | **AC@all** | **AC Rate** |
76 | | GPT-3.5-turbo | 0.9118 | 0.6660 | 0.4853 | 0.5644 | 0.8929 | 0.6597 | 0.4832 | 0.5606 |
77 | | MOSS-16B | 0.5231 | 0.2458 | 0.1492 | 0.1879 | 0.6092 | 0.2626 | 0.1513 | 0.2002 |
78 | | vicuna-13B | 0.7983 | 0.3046 | 0.1492 | 0.2045 | 0.7815 | 0.2983 | 0.1218 | 0.1861 |
79 | | ChatGLM-6B | 0.5693 | 0.2143 | 0.0924 | 0.1371 | 0.6429 | 0.2080 | 0.0693 | 0.1203 |
80 | | ChatGLM2-6B | 0.5399 | 0.2143 | 0.1197 | 0.1560 | 0.5399 | 0.1891 | 0.0819 | 0.1243 |
81 | | Chinese-alpaca-plus-13B | 0.7164 | 0.2773 | 0.1387 | 0.1886 | 0.7017 | 0.2878 | 0.1345 | 0.1963 |
82 | | BELLE-7B-1M | 0.4244 | 0.1639 | 0.0651 | 0.0954 | 0.5273 | 0.2038 | 0.0651 | 0.1161 |
83 | | BELLE-LLaMA-13B-2M | 0.5105 | 0.1996 | 0.0903 | 0.1283 | 0.5357 | 0.2227 | 0.0861 | 0.1434 |
84 | | WizardCoder-15B | 0.8634 | 0.4496 | 0.2773 | 0.3468 | 0.8361 | 0.4391 | 0.2752 | 0.3444 |
85 | | Starcoder-self-instruct | 0.4853 | 0.2227 | 0.1366 | 0.1679 | 0.6765 | 0.3382 | 0.1891 | 0.2494 |
86 | | Baichuan-Chat-13B | 0.6218 | 0.3130 | 0.1786 | 0.2303 | 0.7605 | 0.3319 | 0.1681 | 0.2310 |
87 | | InternLM-chat-7B | 0.4265 | 0.1513 | 0.0924 | 0.1128 | 0.7626 | 0.3025 | 0.1597 | 0.2126 |
88 |
89 | ### Data
90 |
91 | Test data are published in this repo.
92 |
93 | First, clone the this repo:
94 |
95 | ```
96 | git clone https://github.com/SJTU-LIT/ceval.git
97 | ```
98 |
99 | The data is in ProgrammingComprehension/testcases and CodeGeneration/data, whose format is json.
100 |
101 | The format of programming comprehension is:
102 |
103 | ```
104 | [
105 | {
106 | "question": "If there is a definition: char str[] = {'h','1','2','0','a','b'}; const char *p = str; Which of the following statements is correct:____\n",
107 | "A": "p[2] = 's'",
108 | "B": "strcpy(str,\"123456\")",
109 | "C": "strcpy(p,\"abc\")",
110 | "D": "strcpy(str,\"abc\")",
111 | "category": 1,
112 | "id": 0
113 | },
114 | ...
115 | ]
116 | ```
117 |
118 | The format of code generation is:
119 |
120 | ```
121 | [
122 | {
123 | "id": 1964,
124 | "problem_description": "Given 4 positive integers a, b, c, d, calculate the value of the expression (a*b*c)%d, where % represents the modulo operation.",
125 | "function_declaration": "int calculate_remainder(int a, int b, int c, int d)",
126 | "code_context": "#include\n\n// function start\n\n// function end\n\nint main(){\n int a,b,c,d;\n scanf(\"%d%d%d%d\",&a,&b,&c,&d);\n // calling start\n int result = calculate_remainder(a, b, c, d);\n // calling end\n printf(\"%d\", result);\n}",
127 | "example": "[{\"input\": \"2 3 4 5\", \"output\": \"4\"}]",
128 | "time_limit": 1000,
129 | "memory_limit": 256
130 | },
131 | ...
132 | ]
133 | ```
134 |
135 |
136 |
137 | ### How to Evaluation on CodeApex
138 |
139 | #### Programming Comprehension
140 |
141 | You can evaluate your model's response on our [website](https://apex.sjtu.edu.cn/codeapex/). Users should be responsible for the correctness and compliance of their inputs. The format of answer generated by LLM is json, and the json file is divided into three dictionaries in order, representing the answers for CU, CR, and MCR, with each dictionary's answers sorted by ID within the dictionary. We provide an example *example.json*. Your input should be a npy file containing your answer to the testcases, and run the deal_answer.py to generate the json file for evaluation.
142 |
143 | [How to submit?](https://github.com/APEXLAB/CodeApex/blob/main/ProgrammingComprehension/eval/README.md)
144 |
145 | #### Code Generation
146 |
147 | Online evaluation of code generation tasks is being set up. Coming soon.
148 |
149 |
150 |
151 | ### Citation
152 |
153 | Please cite using the following bibtex entry:
154 |
155 | ```
156 | @misc{fu2023codeapex,
157 | title={CodeApex: A Bilingual Programming Evaluation Benchmark for Large Language Models},
158 | author = {Fu, Lingyue and Chai, Huacan and Luo, Shuang and Du, Kounianhua and Zhang, Weiming and Fan, Longteng and Lei, Jiayi and Rui, Renting and Lin, Jianghao and Fang, Yuchen and Liu, Yifan and Wang, Jingkuan and Qi, Siyuan and Zhang, Kangning and Zhang, Weinan and Yu, Yong},
159 | year={2023},
160 | eprint={2309.01940},
161 | archivePrefix={arXiv},
162 | primaryClass={cs.CL}
163 | }
164 | ```
165 |
166 |
--------------------------------------------------------------------------------
/ProgrammingComprehension/testcases/testcases_zh.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "question": "若有定义:char str[] = {'h','1','2','0','a','b'};const char *p = str; 下列语句正确的是:____",
4 | "A": "p[2] = 's'",
5 | "B": "strcpy(str,\"123456\")",
6 | "C": "strcpy(p,\"abc\")",
7 | "D": "strcpy(str,\"abc\")",
8 | "category": 1,
9 | "id": 0
10 | },
11 | {
12 | "question": "执行下列语句后,s的值是____\n```s = 0;for (int i = 1; i <= 10 ++i)\nif (i % 2 == 0 || i % 3 == 0) continue;\nelse s += i;```",
13 | "A": "55",
14 | "B": "49",
15 | "C": "13",
16 | "D": "1",
17 | "category": 1,
18 | "id": 1
19 | },
20 | {
21 | "question": "若```char x=97;```则变量x包含几个字符____",
22 | "A": "1个",
23 | "B": "2个",
24 | "C": "4个",
25 | "D": "8个",
26 | "category": 0,
27 | "id": 2
28 | },
29 | {
30 | "question": "执行以下语句:\n```int x; char s[100]; cin>>x; cin.get(); cin>>s;```\n当用户输入:2021(回车符)Hello(空格符)Sjtu(回车符)后字符串s中的值为:____",
31 | "A": "\"Sjtu\"",
32 | "B": "\"Hello Sjtu\"",
33 | "C": "\"Hello\"",
34 | "D": "'H'",
35 | "category": 1,
36 | "id": 3
37 | },
38 | {
39 | "question": "下列选项中两个表达式的运算结果相同的是____",
40 | "A": "3/2和3.0/2.0",
41 | "B": "3/2和3.0/2",
42 | "C": "3/2.0和3.0/2.0",
43 | "D": "3/2.0和3/2",
44 | "category": 0,
45 | "id": 4
46 | },
47 | {
48 | "question": "下列数中哪一个是8进制数____",
49 | "A": "0x1g",
50 | "B": "010",
51 | "C": "080",
52 | "D": "01b",
53 | "category": 0,
54 | "id": 5
55 | },
56 | {
57 | "question": "下面的说法中,错误的是____",
58 | "A": "算法原地工作的含义是指不需要任何额外的辅助空间",
59 | "B": "在相同规模n下,复杂度为O(n)的算法在时间上总是优于复杂度为O(2n)的算法",
60 | "C": "所谓时间复杂度,是指最坏情况下估算算法执行时间的一个上界",
61 | "D": "同一个算法,实现语言的级别越高,执行效率越低",
62 | "category": 0,
63 | "id": 6
64 | },
65 | {
66 | "question": "若线性表最常用的操作是存取第i个元素及其前驱和后继元素的值,为了提高效率,应采用____的存储方式。",
67 | "A": "单链表",
68 | "B": "双向链表",
69 | "C": "单循环链表",
70 | "D": "顺序表",
71 | "category": 0,
72 | "id": 7
73 | },
74 | {
75 | "question": "下面的说法中,错误的是____。Ⅰ.算法原地工作的含义是指不需要任何额外的辅助空间。Ⅱ.在相同规模n下,复杂度为O(n)的算法在时间上总是优于复杂度为O(2n)的算法。Ⅲ.所谓时间复杂度,是指最坏情况下估算算法执行时间的一个上界。Ⅳ.同一个算法,实现语言的级别越高,执行效率越低",
76 | "A": "Ⅰ",
77 | "B": "Ⅰ,Ⅱ",
78 | "C": "Ⅰ,Ⅳ",
79 | "D": "Ⅲ",
80 | "category": 0,
81 | "id": 8
82 | },
83 | {
84 | "question": "设线性表有n个元素,严格说来,以下操作中,____在顺序表上实现要比在链表上实现的效率高。Ⅰ.输出第i(1≤i≤n)个元素值。Ⅱ.交换第3个元素与第4个元素的值。Ⅲ.顺序输出这n个元素的值",
85 | "A": "Ⅰ",
86 | "B": "Ⅰ、Ⅲ",
87 | "C": "Ⅰ、Ⅱ",
88 | "D": "Ⅱ、Ⅲ",
89 | "category": 2,
90 | "id": 9
91 | },
92 | {
93 | "question": "下列关于线性表说法中,正确的是____。Ⅰ.顺序存储方式只能用于存储线性结构。Ⅱ.取线性表的第i个元素的时间与i的大小有关。Ⅲ.静态链表需要分配较大的连续空间,插入和删除不需要移动元素。Ⅳ.在一个长度为n的有序单链表中插入一个新结点并仍保持有序的时间复杂度为O(n)。Ⅴ.若用单链表来表示队列,则应该选用带尾指针的循环链表",
94 | "A": "Ⅰ、Ⅱ",
95 | "B": "Ⅰ、Ⅲ、Ⅳ、Ⅴ",
96 | "C": "Ⅳ、Ⅴ",
97 | "D": "Ⅲ、Ⅳ、Ⅴ",
98 | "category": 0,
99 | "id": 10
100 | },
101 | {
102 | "question": "给定有n个元素的一维数组,建立一个有序单链表的最低时间复杂度是____",
103 | "A": "O(1)",
104 | "B": "O(n)",
105 | "C": "O(n^2)",
106 | "D": "O(nlog2n)",
107 | "category": 1,
108 | "id": 11
109 | },
110 | {
111 | "question": "设链表不带头结点且所有操作均在表头进行,则下列最不适合作为链栈的是____",
112 | "A": "只有表头结点指针,没有表尾指针的双向循环链表",
113 | "B": "只有表尾结点指针,没有表头指针的双向循环链表",
114 | "C": "只有表头结点指针,没有表尾指针的单向循环链表",
115 | "D": "只有表尾结点指针,没有表头指针的单向循环链表",
116 | "category": 0,
117 | "id": 12
118 | },
119 | {
120 | "question": "用S表示进栈操作,用X表示出栈操作,若元素的进栈顺序是1234,为了得到1342的出栈顺序,相应的S和X的操作序列为____",
121 | "A": "SXSXSSXX",
122 | "B": "SSSXXSXX",
123 | "C": "SXSSXXSX",
124 | "D": "SXSSXSXX",
125 | "category": 1,
126 | "id": 13
127 | },
128 | {
129 | "question": "已知循环队列的存储空间为数组 A[21],front 指向队头元素的前一个位置,rear 指向队尾元素,假设当前 front 和 rear 的值分别为8和3,则该队列的长度为____",
130 | "A": "5",
131 | "B": "6",
132 | "C": "16",
133 | "D": "17",
134 | "category": 1,
135 | "id": 14
136 | },
137 | {
138 | "question": "最适合用作链队的链表是____",
139 | "A": "带队首指针和队尾指针的循环单链表",
140 | "B": "带队首指针和队尾指针的非循环单链表",
141 | "C": "只带队首指针的非循环单链表",
142 | "D": "只带队首指针的循环单链表",
143 | "category": 0,
144 | "id": 15
145 | },
146 | {
147 | "question": "某队列允许在其两端进行入队操作,但仅允许在一端进行出队操作。若元素a,b,c,d,e依次入此队列后再进行出队操作,则不可能得到的出队序列是____",
148 | "A": "b,a,c,d,e",
149 | "B": "d,b,a,c,e",
150 | "C": "d,b,c,a,e",
151 | "D": "e,c,b,a,d",
152 | "category": 1,
153 | "id": 16
154 | },
155 | {
156 | "question": "串’ababaaababaa’的next数组值为____",
157 | "A": "01234567899",
158 | "B": "012121111212",
159 | "C": "011234223456",
160 | "D": "0123012322345",
161 | "category": 1,
162 | "id": 17
163 | },
164 | {
165 | "question": "串 ‘ababaaababaa’的 next 数组为____",
166 | "A": "-1,0,1,2,3,4,5,6,7,8,8,8",
167 | "B": "-1,0,1,0,1,0,0,0,0,1,0,1",
168 | "C": "-1,0,0,1,2,3,1,1,2,3,4,5",
169 | "D": "-1,0,1,2,-1,0,1,2,1,1,2,3",
170 | "category": 1,
171 | "id": 18
172 | },
173 | {
174 | "question": "串’ababaaababaa'的nextval数组为____",
175 | "A": "0,1,0,1,1,2,0,1,0,1,0,2",
176 | "B": "0,1,0,1,1,4,1,1,0,1,0,2",
177 | "C": "0,1,0,1,0,4,2,1,0,1,0,4",
178 | "D": "0,1,1,1,0,2,1,1,0,1,0,4",
179 | "category": 1,
180 | "id": 19
181 | },
182 | {
183 | "question": "设主串T='abaabaabcabaabc',模式串S=’abaabc',采用KMP算法进行模式匹配,到匹配成功时为止,在匹配过程中进行的单个字符间的比较次数是____",
184 | "A": "9",
185 | "B": "10",
186 | "C": "12",
187 | "D": "15",
188 | "category": 1,
189 | "id": 20
190 | },
191 | {
192 | "question": "对于一棵具有 n 个结点、度为4的树来说,____",
193 | "A": "树的高度至多是n-3",
194 | "B": "树的高度至多是n-4",
195 | "C": "第i层上至多有 4(i-1)个结点",
196 | "D": "至少在某一层上正好有4个结点",
197 | "category": 1,
198 | "id": 21
199 | },
200 | {
201 | "question": "在一棵度为4的树T中,若有20个度为4的结点,10个度为3的结点,1个度为2的结点,10 个度为1的结点,则树T的叶结点个数是____",
202 | "A": "41",
203 | "B": "82",
204 | "C": "113",
205 | "D": "122",
206 | "category": 1,
207 | "id": 22
208 | },
209 | {
210 | "question": "下说法中,正确的是____",
211 | "A": "在完全二叉树中,叶子结点的双亲的左兄弟 (若存在)一定不是叶子结点",
212 | "B": "任何一棵二叉树,叶子结点个数为度为2的结点数减 1,即 n0=n2-1",
213 | "C": "完全二叉树不适合顺序存储结构,只有满二叉树适合顺序存储结构",
214 | "D": "结点按完全二叉树层序编号的二叉树中,第i个结点的左孩子的编号为2i",
215 | "category": 0,
216 | "id": 23
217 | },
218 | {
219 | "question": "一个具有 1025 个结点的二叉树的高h为____",
220 | "A": "11",
221 | "B": "10",
222 | "C": "11~1025",
223 | "D": "10~1024",
224 | "category": 1,
225 | "id": 24
226 | },
227 | {
228 | "question": "一棵有 124 个叶子结点的完全二叉树,最多有____个结点。",
229 | "A": "247",
230 | "B": "248",
231 | "C": "249",
232 | "D": "250",
233 | "category": 1,
234 | "id": 25
235 | },
236 | {
237 | "question": "一个有 28 条边的非连通无向图至少有____个顶点。",
238 | "A": "7",
239 | "B": "8",
240 | "C": "9",
241 | "D": "10",
242 | "category": 1,
243 | "id": 26
244 | },
245 | {
246 | "question": "对于一个有 n 个顶点的图:若是连通无向图,其边的个数至少为____;若是强连通有向图,其边的个数至少为____",
247 | "A": "n-1,n",
248 | "B": "n-1,n(n-1)",
249 | "C": "n,n",
250 | "D": "n,n(n-1)",
251 | "category": 1,
252 | "id": 27
253 | },
254 | {
255 | "question": "若无向图 G =(V,E)中含有7个顶点,要保证图 G在任何情况下都是连通的,则需要的边数最少是____",
256 | "A": "6",
257 | "B": "15",
258 | "C": "16",
259 | "D": "21",
260 | "category": 1,
261 | "id": 28
262 | },
263 | {
264 | "question": "已知无向图 G含有 16条边,其中度为4的顶点个数为3,度为3 的顶点个数为4,其他顶点的度均小于3。图 G所含的顶点个数至少是____",
265 | "A": "10",
266 | "B": "11",
267 | "C": "13",
268 | "D": "15",
269 | "category": 1,
270 | "id": 29
271 | },
272 | {
273 | "question": "已知一个长度为 16 的顺序表L,其元素按关键字有序排列,若采用折半查找法查找一个L中不存在的元素,则关键字的比较次数最多是____",
274 | "A": "4",
275 | "B": "5",
276 | "C": "6",
277 | "D": "7",
278 | "category": 1,
279 | "id": 30
280 | },
281 | {
282 | "question": "分别以下列序列构造二叉排序树,与用其他3个序列所构造的结果不同的是____",
283 | "A": "(100,80,90,60,120,110,130)",
284 | "B": "(100,120,110,130,80,60,90)",
285 | "C": "(100,60,80,90,120,110,130)",
286 | "D": "(100,80,60,90,120,130,110)",
287 | "category": 1,
288 | "id": 31
289 | },
290 | {
291 | "question": "在含有 n个结点的二叉排序树中查找某个关键字的结点时,最多进行____次比较",
292 | "A": "n/2",
293 | "B": "log2n",
294 | "C": "log2n+1",
295 | "D": "n",
296 | "category": 1,
297 | "id": 32
298 | },
299 | {
300 | "question": "对下列关键字序列,不可能构成某二叉排序树中一条查找路径的是____",
301 | "A": "95,22,91,24,94,71",
302 | "B": "92,20,91,34,88,35",
303 | "C": "21,89,77,29,36,38",
304 | "D": "12,25,71,68,33,34",
305 | "category": 1,
306 | "id": 33
307 | },
308 | {
309 | "question": "现有一棵无重复关键字的平衡二叉树(AVL),对其进行中序遍历可得到一个降序序列。下列关于该平衡二叉树的叙述中,正确的是____",
310 | "A": "根结点的度一定为2",
311 | "B": "树中最小元素一定是叶结点",
312 | "C": "最后插入的元素一定是叶结点",
313 | "D": "树中最大元素一定是无左子树",
314 | "category": 1,
315 | "id": 34
316 | },
317 | {
318 | "question": "已知a=1,b=2,c=3,则表达是++a||-b&&++c的值为____",
319 | "A": "0",
320 | "B": "1",
321 | "C": "2",
322 | "D": "3",
323 | "category": 2,
324 | "id": 35
325 | },
326 | {
327 | "question": "下列表达式选项中,____是正确的。",
328 | "A": "++(a++)",
329 | "B": "a++b",
330 | "C": "a+++b",
331 | "D": "a++++b",
332 | "category": 0,
333 | "id": 36
334 | },
335 | {
336 | "question": "在循环语句中使用break语句的作用是____",
337 | "A": "结束本次循环",
338 | "B": "结束该层循环",
339 | "C": "结束所有循环",
340 | "D": "结束程序执行",
341 | "category": 0,
342 | "id": 37
343 | },
344 | {
345 | "question": "对if后的括号中的表达式,要求i不为0的时候表达式为真,该表达式表示正确的为_____",
346 | "A": "i",
347 | "B": "!i",
348 | "C": "i<>0",
349 | "D": "i=0",
350 | "category": 0,
351 | "id": 38
352 | },
353 | {
354 | "question": "下列循环语句的执行次数是____。while(!1) cout<<”ok!”;",
355 | "A": "0次",
356 | "B": "1次",
357 | "C": "2次",
358 | "D": "无数次",
359 | "category": 2,
360 | "id": 39
361 | },
362 | {
363 | "question": "在C++中对数组下标说法正确的是____",
364 | "A": "初始化数组的值的个数可以多于定义的数组元素的个数,多出部分将被忽略。",
365 | "B": "初始化数组的值的个数可以少于定义的数组元素的个数。",
366 | "C": "初始化数组的值的个数必须等于定义的数组元素的个数。",
367 | "D": "初始化数组的值可以通过跳过逗号的方式来省略。如int a[3]={1, ,2};",
368 | "category": 0,
369 | "id": 40
370 | },
371 | {
372 | "question": "数组定义为:int a[2][2]={1,2,3,4};则a[1][0]%3为____",
373 | "A": "0",
374 | "B": "1",
375 | "C": "2",
376 | "D": "4",
377 | "category": 1,
378 | "id": 41
379 | },
380 | {
381 | "question": "数组定义为:```int a[][2]={5,6,1,2,3,8};```则能用于计算数组下标的是____",
382 | "A": "sizeofA:/sizeof(int)",
383 | "B": "sizeof(a[])/sizeof(3)",
384 | "C": "sizeof(a[][2])/sizeof(int)",
385 | "D": "sizeofA:/sizeof(a[2][1])",
386 | "category": 1,
387 | "id": 42
388 | },
389 | {
390 | "question": "下列叙述中正确的是____",
391 | "A": "C++语言程序中,main()函数必须在其它函数之前,函数内可以嵌套定义函数。",
392 | "B": "C++语言程序中,main()函数的位置没有限制,函数内不可以嵌套定义函数。",
393 | "C": "C++语言程序中,main()函数必须在其它函数之前,函数内不可以嵌套定义函数。",
394 | "D": "C++语言程序中,main()函数必须在其它函数之后,函数内可以嵌套调用函数。",
395 | "category": 0,
396 | "id": 43
397 | },
398 | {
399 | "question": "下列对return语句叙述错误的是____",
400 | "A": "在函数定义中可能有return语句,也可能没有return语句。",
401 | "B": "在函数定义中可以有多条return语句。",
402 | "C": "在函数定义中每条return语句可能返回多个值。",
403 | "D": "如果函数类型不是void型,则函数定义中必须有return语句。",
404 | "category": 0,
405 | "id": 44
406 | },
407 | {
408 | "question": "C++语言中函数返回值的类型是由____决定的。",
409 | "A": "return语句中的表达式类型",
410 | "B": "调用该函数的主调函数类型",
411 | "C": "定义函数时所指定的函数类型",
412 | "D": "以上说法都不正确",
413 | "category": 0,
414 | "id": 45
415 | },
416 | {
417 | "question": "C++中,关于参数默认值的描述正确的是____",
418 | "A": "只能在函数定义时设置参数默认值",
419 | "B": "设置参数默认值时,应当从右向左设置",
420 | "C": "设置参数默认值时,应当全部设置",
421 | "D": "设置参数默认值后,调用函数不能再对参数赋值",
422 | "category": 0,
423 | "id": 46
424 | },
425 | {
426 | "question": "使用重载函数编程序的目的是____",
427 | "A": "使用相同的函数名调用功能相似但参数不同的函数",
428 | "B": "共享程序代码",
429 | "C": "提高程序的运行速度",
430 | "D": "节省存储空间",
431 | "category": 0,
432 | "id": 47
433 | },
434 | {
435 | "question": "系统在调用重载函数时,下列不能作为确定调用哪个重载函数的依据的选项是____",
436 | "A": "函数名",
437 | "B": "参数个数",
438 | "C": "函数类型",
439 | "D": "参数类型",
440 | "category": 0,
441 | "id": 48
442 | },
443 | {
444 | "question": "数组作为函数的形参,把数组名作为函数的实参时,传递给函数的是____",
445 | "A": "数组中各元素的值",
446 | "B": "数组中元素的个数",
447 | "C": "数组中第0个元素的值",
448 | "D": "该数组的首地址",
449 | "category": 0,
450 | "id": 49
451 | },
452 | {
453 | "question": "要使变量i成为int型变量x的别名,正确的定义语句是____",
454 | "A": "int &i=x;",
455 | "B": "int i=&x;",
456 | "C": "int &i=&x;",
457 | "D": "int i=x;",
458 | "category": 2,
459 | "id": 50
460 | },
461 | {
462 | "question": "在下列指针表达式中,与下标访问a[i][j]不等效的是____",
463 | "A": "*(a+i+j)",
464 | "B": "(*(a+i))[j]",
465 | "C": "*(*(a+i)+j)",
466 | "D": "*(a[i]+j)",
467 | "category": 2,
468 | "id": 51
469 | },
470 | {
471 | "question": "已定义字符串```char str[5]```,则下列表达式中不能表示str[1]的地址的是____",
472 | "A": "str+1",
473 | "B": "str++",
474 | "C": "&str[0]+1",
475 | "D": "&str[1]",
476 | "category": 2,
477 | "id": 52
478 | },
479 | {
480 | "question": "已知:```int a[]={1,2,3,4,5,6},*p=a,x;```下面语句中x的值为5的是____",
481 | "A": "p+=3;x=*(p++);",
482 | "B": "p+=5;x=*p++;",
483 | "C": "p+=4;x=*++p;",
484 | "D": "p+=4; x=*p++",
485 | "category": 2,
486 | "id": 53
487 | },
488 | {
489 | "question": "若有说明:int i,j=6,*p;p=&i;则与i=j等价的语句是____",
490 | "A": "i=*p;",
491 | "B": "*p=*&j;",
492 | "C": "i=&j;",
493 | "D": "i=**p;",
494 | "category": 2,
495 | "id": 54
496 | },
497 | {
498 | "question": "设p1和p2是指向同一个int型一维数组的指针变量,k为int型变量,则不能正确执行的语句是____",
499 | "A": "k=*p1+*p2;",
500 | "B": "p2=k;",
501 | "C": "p1=p2;",
502 | "D": "k=*p1*(*p2);",
503 | "category": 2,
504 | "id": 55
505 | },
506 | {
507 | "question": "执行以下程序段后,m的值为____。\n ```int a[2][3]={{1,2,3},{4,5,6}};int m,*p=&a[0][0];m=(*p)*(*(p+2))*(*(p+4));```",
508 | "A": "15",
509 | "B": "14",
510 | "C": "13",
511 | "D": "12",
512 | "category": 2,
513 | "id": 56
514 | },
515 | {
516 | "question": "设有如下定义,下面关于ptr正确叙述是____。\n ```int (*ptr)();``` ",
517 | "A": "ptr是指向一维数组的指针变量。",
518 | "B": "ptr是指向int 型数据的指针变量。",
519 | "C": "ptr是指向函数的指针,该函数返回一个int型数据。",
520 | "D": "ptr是一个函数名,该函数的返回值是指向int型数据的指针。",
521 | "category": 2,
522 | "id": 57
523 | },
524 | {
525 | "question": "下列选项中,不是合法的整型常量的是____",
526 | "A": "288",
527 | "B": "288L",
528 | "C": "0288",
529 | "D": "0x288",
530 | "category": 1,
531 | "id": 58
532 | },
533 | {
534 | "question": "循环语句``` for ( k = 5; k = 0; --k);```的循环次数是____",
535 | "A": "0",
536 | "B": "5",
537 | "C": "6",
538 | "D": "无限次",
539 | "category": 2,
540 | "id": 59
541 | },
542 | {
543 | "question": "如有函数```f(A x, A *y, int size, A &z)```,并有定义```A b[2]```,调用```f(b[1], b, 2, b[0])```时,A的构造函数的调用次数是____",
544 | "A": "1",
545 | "B": "2",
546 | "C": "3",
547 | "D": "4",
548 | "category": 1,
549 | "id": 60
550 | },
551 | {
552 | "question": "若有定义:```char *p = “h12\\0ab”, str[] = “h12\\0ab”; ```则sizeof(p)、sizeof(str)和strlen(p)的值是____",
553 | "A": "4、4、3",
554 | "B": "7、7、7",
555 | "C": "4、8、7",
556 | "D": "4、7、3",
557 | "category": 2,
558 | "id": 61
559 | },
560 | {
561 | "question": "以下选项中不合法的运算符重载函数名是____",
562 | "A": "operator! ",
563 | "B": "operator()",
564 | "C": "operator@",
565 | "D": "operator!=",
566 | "category": 2,
567 | "id": 62
568 | },
569 | {
570 | "question": "如果m=1,n=1,执行了表达式 (m --) || (n *= m)后m和n的值分别是____",
571 | "A": "1,0",
572 | "B": "1,1",
573 | "C": "0,0",
574 | "D": "0,1",
575 | "category": 2,
576 | "id": 63
577 | },
578 | {
579 | "question": "类A正确的拷贝构造函数原型是____",
580 | "A": "A(A &other)",
581 | "B": "A(const A &other)",
582 | "C": "A(A other)",
583 | "D": "void A(A &other)",
584 | "category": 2,
585 | "id": 64
586 | },
587 | {
588 | "question": "以下选项中不合法的字符常量是____",
589 | "A": "'d'",
590 | "B": "'t'",
591 | "C": "'\\123'",
592 | "D": "'\\'",
593 | "category": 0,
594 | "id": 65
595 | },
596 | {
597 | "question": "C++的整型常量0101的十进制值是____",
598 | "A": "5",
599 | "B": "101",
600 | "C": "65",
601 | "D": "4097",
602 | "category": 0,
603 | "id": 66
604 | },
605 | {
606 | "question": "语句cout << \"abc0\\0def\"的输出结果是____",
607 | "A": "abc0\\0def\\",
608 | "B": "abc0\\0def",
609 | "C": "abc",
610 | "D": "abc0",
611 | "category": 1,
612 | "id": 67
613 | },
614 | {
615 | "question": "如有函数f(const A &x, A &y),并有定义A b(2),调用f(4, b)时,A的构造函数的调用次数是____",
616 | "A": "非法调用,编译出错",
617 | "B": "0",
618 | "C": "1",
619 | "D": "2",
620 | "category": 1,
621 | "id": 68
622 | },
623 | {
624 | "question": "执行下列语句时,输出的行数是:____\nint s = 1;while (s < 10) {s *= 2;if (s % 4 != 0) continue;cout << s << endl;}",
625 | "A": "1",
626 | "B": "2",
627 | "C": "3",
628 | "D": "4",
629 | "category": 2,
630 | "id": 69
631 | },
632 | {
633 | "question": "若有定义int *p = NULL; 语句cout << p << ' ' << *p;的结果是____",
634 | "A": "p的地址NULL",
635 | "B": "p的地址0",
636 | "C": "0 0",
637 | "D": "运行出错",
638 | "category": 2,
639 | "id": 70
640 | },
641 | {
642 | "question": "若有定义:char str[] = {'h', '1', '2', '\\0', 'a', 'b'}; 则sizeof(str)、strlen(str)的值是____",
643 | "A": "7、3",
644 | "B": "7、7",
645 | "C": "6、3",
646 | "D": "6、6",
647 | "category": 2,
648 | "id": 71
649 | },
650 | {
651 | "question": "以下哪个操作符既可以重载成成员函数,也可以重载成类的友元函数____",
652 | "A": "<<",
653 | "B": "+=",
654 | "C": "=",
655 | "D": "()",
656 | "category": 0,
657 | "id": 72
658 | },
659 | {
660 | "question": "设有定义int x; char ch; 下列不能够输出ch 的ASCII码的语句是____",
661 | "A": "cout << (int)ch;",
662 | "B": "cout << int(ch);",
663 | "C": "cout << ch;",
664 | "D": "cout << (x = ch);",
665 | "category": 2,
666 | "id": 73
667 | },
668 | {
669 | "question": "若有如下定义,则对数组元素的成员引用不正确的是____。\nstruct Student{int id; char *name; Student(int len = 10) {name = new char[len];} };Student stu [2],*p; p=stu;",
670 | "A": "p[1].id",
671 | "B": "p->id",
672 | "C": "(*p).name",
673 | "D": "*p.name",
674 | "category": 2,
675 | "id": 74
676 | },
677 | {
678 | "question": "如将类X的*运算符重载为友元函数,实现类X的两个对象相乘,并返回相乘后的结果,则该函数的声明语句为____",
679 | "A": "X operator*(const X & a , const X & b);",
680 | "B": "X operator*(const X & a) const;",
681 | "C": "X & operator*(const X & a , const X & b);",
682 | "D": "X & operator*( const X & a) const;",
683 | "category": 2,
684 | "id": 75
685 | },
686 | {
687 | "question": "判断字符类型的变量ch的内容为数字字符的表达式是____",
688 | "A": "'0'<= ch <= '9'",
689 | "B": "(ch >= '0') && (ch <= '9')",
690 | "C": "(ch >='0') || (ch <= '9')",
691 | "D": "(ch >= 0) && ( ch <= 9)",
692 | "category": 2,
693 | "id": 76
694 | },
695 | {
696 | "question": "若有定义:char *s;接着立即执行下列哪个语句运行时不会出现错误____",
697 | "A": "s ={\"SJTU\"};",
698 | "B": "s =\"SJTU\";",
699 | "C": "strcpy(s, \"SJTU\");",
700 | "D": "s[0] = 'S';",
701 | "category": 2,
702 | "id": 77
703 | },
704 | {
705 | "question": "关于函数的定义,下面哪个说法是错误的____",
706 | "A": "一个程序中不能出现同名函数",
707 | "B": "void类型的函数也可以使用return语句",
708 | "C": "函数调用时的实际参数个数可以少于形式参数个数",
709 | "D": "return后面的表达值的类型一定是函数的返回类型",
710 | "category": 0,
711 | "id": 78
712 | },
713 | {
714 | "question": "关于类的静态成员函数,下面说法错误的是____",
715 | "A": "只能访问静态成员",
716 | "B": "没有this指针",
717 | "C": "只能通过\"类名::函数名\"访问",
718 | "D": "函数定义必须写在类中",
719 | "category": 0,
720 | "id": 79
721 | },
722 | {
723 | "question": "一个源文件想要定义一个本源文件专用的、不允许其他源文件共享的全局变量,则需要在本文件定义该全局变量前加限定词。____",
724 | "A": "auto",
725 | "B": "extern",
726 | "C": "static",
727 | "D": "register",
728 | "category": 0,
729 | "id": 80
730 | },
731 | {
732 | "question": "下面定义中,非法的是____",
733 | "A": "const int a = 10, *p = &a;",
734 | "B": "int b; const int &a = b;",
735 | "C": "const int a = 10 , &b = a;",
736 | "D": "const int a = 10; int *p = &a;",
737 | "category": 2,
738 | "id": 81
739 | },
740 | {
741 | "question": "当使用ifstream流定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为____",
742 | "A": "ios::in",
743 | "B": "ios::out",
744 | "C": "ios::in|ios::out",
745 | "D": "ios::binary",
746 | "category": 0,
747 | "id": 82
748 | },
749 | {
750 | "question": "类B从类A继承,并有定义:A *pa; B *pb;下面不正确的用法是____",
751 | "A": "pa = pb;",
752 | "B": "pb = pa;",
753 | "C": "pa = (A *) pb;",
754 | "D": "pb = (B *) pa;",
755 | "category": 2,
756 | "id": 83
757 | },
758 | {
759 | "question": "有类模板template obj;",
761 | "B": "foo obj;",
762 | "C": "foo obj;",
763 | "D": "foo obj;",
764 | "category": 2,
765 | "id": 84
766 | },
767 | {
768 | "question": "以下不是面向对象特性的是____",
769 | "A": "多态",
770 | "B": "继承",
771 | "C": "泛型",
772 | "D": "递归",
773 | "category": 0,
774 | "id": 85
775 | },
776 | {
777 | "question": "某计算机系统中整数用8位补码表示,则10010100 + 00101111结果值的十进制表示是____",
778 | "A": "195",
779 | "B": "-67",
780 | "C": "-61",
781 | "D": "67",
782 | "category": 1,
783 | "id": 86
784 | },
785 | {
786 | "question": "如果字母A的内码是65,语句cout << 'A' + 1; 的正确输出是____",
787 | "A": "'A' + 1",
788 | "B": "66",
789 | "C": "066",
790 | "D": "B",
791 | "category": 1,
792 | "id": 87
793 | },
794 | {
795 | "question": "如有函数f(A &x, const A &y),并有定义A b(2),调用f(4, b)时,A的构造函数的调用次数是____",
796 | "A": "非法调用,编译出错",
797 | "B": "0",
798 | "C": "1",
799 | "D": "2",
800 | "category": 1,
801 | "id": 88
802 | },
803 | {
804 | "question": "执行下列语句时,输出的行数是____\nint s = 1;while (s < 5) {if (++s = 4 ) break;cout << s << endl;}",
805 | "A": "0",
806 | "B": "1",
807 | "C": "3",
808 | "D": "4",
809 | "category": 2,
810 | "id": 89
811 | },
812 | {
813 | "question": "下列语句段{A * p1 = new A; auto_ptr p2( new A); shared_ptr p3( new A), p4 = p3; }, A的析构函数执行的次数是____",
814 | "A": "0",
815 | "B": "1",
816 | "C": "2",
817 | "D": "3",
818 | "category": 2,
819 | "id": 90
820 | },
821 | {
822 | "question": "在程序中,对A类对象a需要执行1 + a,并且A类有一个需要一个整型参数的构造函数,下列选项中不可行的方案是____",
823 | "A": "在A类中定义一个向整型 转换的类型转换函数",
824 | "B": "在A类中添加一个向实型转换的类型转换函数",
825 | "C": "在A类中增加一个重载+的成员函数",
826 | "D": "在A类中增加一个重载+的友元函数",
827 | "category": 0,
828 | "id": 91
829 | },
830 | {
831 | "question": "设有class A {……};class B: public A {……};,并有定义: A *p = new B;,下列语句中合法的是____",
832 | "A": "B *q = p;",
833 | "B": "B b = *p;",
834 | "C": "B &b = *p;",
835 | "D": "A &a = *p;",
836 | "category": 2,
837 | "id": 92
838 | },
839 | {
840 | "question": "若有如下定义:const char *str[4] = {\"aaa\",\"bbb\",\"ccc\",\"ddd\"},则不能正确输出4个字符串的语句是____",
841 | "A": "for (int i = 0; i <4; ++ i) cout << str[i] << endl;",
842 | "B": "for (int i = 0; i <4; ++ i) cout << *(str + i) << endl;",
843 | "C": "for (const char **p = str; p < str + 4; ++ p) cout << p << endl;",
844 | "D": "for (const char **p = str; p < str + 4; ++ p) cout << *p << endl;",
845 | "category": 2,
846 | "id": 93
847 | },
848 | {
849 | "question": "下面X类的运算符重载函数中,原型错误的是____",
850 | "A": "X &operator=(const X & a);",
851 | "B": "X &operator=( X && a);",
852 | "C": "X & operator+=( const X & a);",
853 | "D": "X & operator+=( X & a);",
854 | "category": 2,
855 | "id": 94
856 | },
857 | {
858 | "question": "不能正确判断字符类型的变量ch的内容为数字字符的表达式是____",
859 | "A": "((ch >= '0') + (ch <= '9')) == 2",
860 | "B": "(ch >= '0') && (ch <= '9')",
861 | "C": "!((ch <'0') || (ch > '9'))",
862 | "D": "!((ch <='0') || (ch > ='9'))",
863 | "category": 2,
864 | "id": 95
865 | },
866 | {
867 | "question": "若有定义:char str1[5];const char *p = \"abc\";下列不正确的语句是____",
868 | "A": "p = \"def\";",
869 | "B": "strcpy(p, str1)",
870 | "C": "p = str1;",
871 | "D": "strcpy(str1,p);",
872 | "category": 2,
873 | "id": 96
874 | },
875 | {
876 | "question": "若有函数void f( A r1, const A &r2, A &r3),并有A x1(2), x2(4); 则调用函数f(x1, 5, x2)时,A的构造函数(包括拷贝构造函数)调用次数是____",
877 | "A": "0",
878 | "B": "1",
879 | "C": "2",
880 | "D": "3",
881 | "category": 1,
882 | "id": 97
883 | },
884 | {
885 | "question": "关于类的常量数据成员,下面说法错误的是____",
886 | "A": "必须在对象构造时赋初值",
887 | "B": "除构造函数外,任何成员函数都不能修改常量数据成员的值",
888 | "C": "非const的成员函数不能访问常量数据成员",
889 | "D": "不同的对象有不同的常量数据成员值",
890 | "category": 0,
891 | "id": 98
892 | },
893 | {
894 | "question": "如果希望函数中的局部变量在函数执行结束后依然存在,则需要在此变量定义前加限定词____",
895 | "A": "auto",
896 | "B": "extern",
897 | "C": "static",
898 | "D": "register",
899 | "category": 0,
900 | "id": 99
901 | },
902 | {
903 | "question": "若有函数f(int *a, const int &b, int &c)以及定义int m;和const int n = 9;,以下合法的函数调用是____",
904 | "A": "f((&m, 5, 5)",
905 | "B": "f(&m, 5, m)",
906 | "C": "f(&n, n , n)",
907 | "D": "f(m,m,n);",
908 | "category": 2,
909 | "id": 100
910 | },
911 | {
912 | "question": "下面文件流对象中,不能读文件的是____",
913 | "A": "fstream obj(\"ff\");",
914 | "B": "fstream obj(\"\"ff\", ios::binary)",
915 | "C": "fstream obj(\"ff\", ios::in | ios::out)",
916 | "D": "fstream obj(\"ff\", ios::in | ios::app)",
917 | "category": 2,
918 | "id": 101
919 | },
920 | {
921 | "question": "若有定义:class A {public: virtual void display(); }; class B:public A { public: virtual void display();}; 以及定义:B b; 下面无法调用派生类的display函数的语句是____",
922 | "A": "A *p = &b; p->display();",
923 | "B": "b.diaplay()",
924 | "C": "A a = b; a.display()",
925 | "D": "A &a = b; a.display();",
926 | "category": 2,
927 | "id": 102
928 | },
929 | {
930 | "question": "假设A是一个类名,下面的异常捕获中,错误的是____",
931 | "A": "catch (…);",
932 | "B": "catch(int);",
933 | "C": "catch (A x);",
934 | "D": "catch (int 5);",
935 | "category": 2,
936 | "id": 103
937 | },
938 | {
939 | "question": "下面陈述中错误的是____",
940 | "A": "多态性为软件系统的扩展提供便利",
941 | "B": "继承是代码重用的一种手段,也是运行时多态性的实现基础",
942 | "C": "派生类不可能是抽象类",
943 | "D": "友元函数是允许访问对象私有成员的全局函数",
944 | "category": 0,
945 | "id": 104
946 | },
947 | {
948 | "question": "整型常量011对应的十进制数是____",
949 | "A": "3",
950 | "B": "9",
951 | "C": "11",
952 | "D": "17",
953 | "category": 1,
954 | "id": 105
955 | },
956 | {
957 | "question": "某计算机系统中int用2字节表示,若有定义int a = -1,则cout << hex <display()分别调用的是____",
1102 | "A": "A类的display() A类的display()",
1103 | "B": "B类的display() B类的display()",
1104 | "C": "A类的display() B类的display()",
1105 | "D": "B类的display() A类的display();",
1106 | "category": 2,
1107 | "id": 122
1108 | },
1109 | {
1110 | "question": "A类的移动构造函数原型是____",
1111 | "A": "A( A other);",
1112 | "B": "A( const A & other);",
1113 | "C": "A( A &&other);",
1114 | "D": "A( A &other);",
1115 | "category": 0,
1116 | "id": 123
1117 | },
1118 | {
1119 | "question": "下有如下定义语句:int a[] = {1,2,3,4,5};,则对语句int *p=a;正确的描述是____",
1120 | "A": "语句int *p = a;定义不正确",
1121 | "B": "语句int *p=a;初始化变量p,使其指向数组对象a的第一个元素",
1122 | "C": "语句int *p=a; 是把数组a的所有元素值赋给变量p",
1123 | "D": "语句int *p=a; 是把a[0]的值赋给变量p",
1124 | "category": 2,
1125 | "id": 124
1126 | },
1127 | {
1128 | "question": "一棵结点数大于等于3的红黑树,以下描述正确的是____",
1129 | "A": "根结点的度一定是2",
1130 | "B": "最后插入的元素一定是叶结点",
1131 | "C": "最小元素一定无左孩子",
1132 | "D": "最后插入的元素一定是红结点",
1133 | "category": 0,
1134 | "id": 125
1135 | },
1136 | {
1137 | "question": "下面排序算法中,时间性能与数据初始排列状态无关的算法是____",
1138 | "A": "直接插入排序",
1139 | "B": "堆排序",
1140 | "C": "冒泡排序",
1141 | "D": "归并排序",
1142 | "category": 0,
1143 | "id": 126
1144 | },
1145 | {
1146 | "question": "下列中缀表达式中能够用一个容量为4的运算符栈转换成后缀表达式的是____",
1147 | "A": "( 1 + 2)* ( 6 / 2 -1)",
1148 | "B": "1+2 * 3 ^ (5+2) / 4 +6",
1149 | "C": "1+ 2 * (3 -8 / 2) *3",
1150 | "D": "(2* 3) ^ 2 ^ 3 / 4",
1151 | "category": 2,
1152 | "id": 127
1153 | },
1154 | {
1155 | "question": "若入栈序列为SJTU,则下列哪个序列可能是其出栈序列?____",
1156 | "A": "SJTU",
1157 | "B": "UJTS",
1158 | "C": "STJU",
1159 | "D": "JTSU",
1160 | "category": 1,
1161 | "id": 128
1162 | },
1163 | {
1164 | "question": "下图中合法的拓扑序列是____",
1165 | "A": "ABCDEFG",
1166 | "B": "ABDCFEG",
1167 | "C": "ABCEFDG",
1168 | "D": "ABDECFG",
1169 | "category": 1,
1170 | "id": 129
1171 | },
1172 | {
1173 | "question": "要使一棵非空二叉树的前序序列与中序序列相同,其所有非叶结点须满足的条件是____",
1174 | "A": "只有左子树",
1175 | "B": "只有右子树",
1176 | "C": "结点的度均为12",
1177 | "D": "结点的度均为2",
1178 | "category": 1,
1179 | "id": 130
1180 | },
1181 | {
1182 | "question": "设有如下图所示的火车车轨,入口到出口之间有3条轨道,列车的行进方向均为从左至右,列车可驶入任意一条轨道。现有编号为1~9的9节列车,进站次序是乱序(如:5、1、3、4、8、9、2、6、7表示最先进站的是5,然后依次是1、3、4、……,最后是7 )。若期望驶出的次序依次为1~9,下列进站序列中能完成重组的是____",
1183 | "A": "1、3、2、4、5、6、8、7、9",
1184 | "B": "5、2、8、6、1、7、9、4、3",
1185 | "C": "5、2、8、6、1、7、9、4、3",
1186 | "D": "9、2、1、5、8、4、3、6、7",
1187 | "category": 1,
1188 | "id": 131
1189 | },
1190 | {
1191 | "question": "某棵表达式树的前序遍历序列是:* + / 3 2 8 - 7 1,中序遍历序列是:3 / 2 + 8 * 7 - 1,如下描述正确的是____",
1192 | "A": "对应的中缀表达式是 3 / 2 + 8 * 7 - 1",
1193 | "B": "对应的中缀表达式是 ( 3 / 2 + 8 * 7 - 1 )",
1194 | "C": "对应的后缀表达式是 * + / 3 2 8 - 7 1",
1195 | "D": "对应的后缀表达式是 3 2 / 8 + 7 1 - *",
1196 | "category": 2,
1197 | "id": 132
1198 | },
1199 | {
1200 | "question": "已知二叉树的前序遍历序列为ABCD,后序遍历序列为CDBA,则不可能的中序遍历序列是____",
1201 | "A": "CBDA",
1202 | "B": "ACBD",
1203 | "C": "ACBD",
1204 | "D": "ADCB",
1205 | "category": 1,
1206 | "id": 133
1207 | },
1208 | {
1209 | "question": "在一个带头尾结点的双链表中,删除指针p指向的结点的合法语句是____",
1210 | "A": "p->prev->next = p->next; p->next->prev = p->prev; delete p;",
1211 | "B": "q = p; delete p; q->prev->next = q->next; q->next->prev = q->prev;",
1212 | "C": "q1 = delete p; p->prev; q2 = p->next; q1->next = q2; q2->prev = q1;",
1213 | "D": "q1 = p->prev; q2 = q1->next; delete p; q1->next = q2; q2->prev = q1;",
1214 | "category": 2,
1215 | "id": 134
1216 | },
1217 | {
1218 | "question": "如果数据的原始排列非常接近排序后的状态,可以选择____",
1219 | "A": "直接插入排序",
1220 | "B": "直接选择排序",
1221 | "C": "猴子排序",
1222 | "D": "快速排序",
1223 | "category": 0,
1224 | "id": 135
1225 | },
1226 | {
1227 | "question": "对5个元素进行编码,不可能是哈夫曼编码的是____",
1228 | "A": "000、0010、1100、1010、1111",
1229 | "B": "00、01、100、101、11",
1230 | "C": "00、01、100、101、11",
1231 | "D": "0、10、1100、1101、111",
1232 | "category": 1,
1233 | "id": 136
1234 | },
1235 | {
1236 | "question": "在双链表类中增加一个迭代器。迭代器的数据成员是指向双链表的结点的指针cur。在迭代器itr指向的位置上插入一个元素x。插入后迭代器指向新插入的结点。结点类node的构造函数原型是node(node *prev, int x, node *next); 假设所有的数据成员都是公有的,下面选项中合法的是 (构造函数)____",
1237 | "A": "itr,cur = new node(itr.cur->prev, x, itr.cur->next);itr.cur->prev->next = itr.cur->ext->prev = itr.cur;",
1238 | "B": "itr.cue->prev->next = itr.cur->prev = new node(itr.cur->prev, x, itr.cur->next);itr.cur = itr.cur->prev;",
1239 | "C": "itr.cue->prev->next = itr.cur->prev = new node(itr.cur->prev, x, itr.cur-);itr.cur = itr.cur->prev;",
1240 | "D": "itr.cue->prev = itr.cur->prev->next = new node(itr.cur->prev, x, itr.cur-);itr.cur = itr.cur->prev;",
1241 | "category": 2,
1242 | "id": 137
1243 | },
1244 | {
1245 | "question": "将数据1、2、3、4、5、6依次进入一个FIFO的队列,在插入过程中可能有一些出队操作,最终所有元素都要出队。下列选项中可能的出队次序是____",
1246 | "A": "6、5、4、3、2、1",
1247 | "B": "1、2、3、4、5、6",
1248 | "C": "2、1、3、5、4、6",
1249 | "D": "3、2、1、6、5、4",
1250 | "category": 1,
1251 | "id": 138
1252 | },
1253 | {
1254 | "question": "将优先级为3、6、5、1、7、0、9的元素依次进入一个优先级队列,数值越小优先级越高,在入队过程中可能有一些出队操作,最后所有元素都要出队。下列选项中不可能的出队次序是____",
1255 | "A": "3、5、6、0、1、7、9",
1256 | "B": "3、1、6、5、0、7、9",
1257 | "C": "0、1、3、5、6、7、9",
1258 | "D": "3、0、1、5、6、7、9",
1259 | "category": 1,
1260 | "id": 139
1261 | },
1262 | {
1263 | "question": "对元素3、1、6、0、5、7、9进行一趟排序后的结果是0、1、6、3、5、7、9,则选用的排序算法可能是____",
1264 | "A": "冒泡排序",
1265 | "B": "直接插入排序",
1266 | "C": "插入排序",
1267 | "D": "希尔排序中的3-排序",
1268 | "category": 0,
1269 | "id": 140
1270 | },
1271 | {
1272 | "question": "若有a:b:c:d:e依次进入一个栈中,期间可以有出栈。如果第一个出栈的元素是c,第二个出栈的元素不可能是____",
1273 | "A": "a",
1274 | "B": "b",
1275 | "C": "d",
1276 | "D": "e",
1277 | "category": 1,
1278 | "id": 141
1279 | },
1280 | {
1281 | "question": "在如下邻接矩阵中\n| ∞ | 5 | 1 | ∞ | ∞ | ∞ |/n| 5 | ∞ | ∞ | 1 | ∞ | ∞ |/n| 1 | ∞ | ∞ | 4 | 2 | ∞ |/n| ∞ | 1 | 4 | ∞ | 2 | 2 |/n| ∞ | ∞ | 2 | 2 | ∞ | 2 |/n| ∞ | ∞ | ∞ | 2 | 2 | ∞ |/n最小生成树是:____",
1282 | "A": "(0,1)(1,3)(2,4)(3,4)(4,5)",
1283 | "B": "(0,2)(1,3)(2,4)(3,4)(4,2)",
1284 | "C": "(0,2)(1,3)(2,4)(3,4)(3,5)",
1285 | "D": "(0,2)(2,3)(2,4)(3,4)(4,5)",
1286 | "category": 1,
1287 | "id": 142
1288 | },
1289 | {
1290 | "question": "若将关键字 1,2,3,4,5,6,7 依次插入到初始为空的AVL树 T 中,则 T 中平衡因子为 0 的非叶子结点的个数是____",
1291 | "A": "0",
1292 | "B": "1",
1293 | "C": "2",
1294 | "D": "3",
1295 | "category": 1,
1296 | "id": 143
1297 | },
1298 | {
1299 | "question": "下列程序段的时间复杂度是____\ncount = 0;for (k = 1; k <= n; k *= 2)for (j = 1; j <= n; j = j+1)count++;",
1300 | "A": "O(log2n)",
1301 | "B": "O(n)",
1302 | "C": "O(nlog2n)",
1303 | "D": "O(n^2)",
1304 | "category": 2,
1305 | "id": 144
1306 | },
1307 | {
1308 | "question": "设有1000000个待排序的数字,如果需要用最快的方法选出其中最小的10个,则用下列哪个方法可以达到此目的____",
1309 | "A": "快速排序",
1310 | "B": "堆排序",
1311 | "C": "归并排序",
1312 | "D": "希尔排序",
1313 | "category": 0,
1314 | "id": 145
1315 | },
1316 | {
1317 | "question": "若元素A:B:C:D:e、f依次进栈,允许进栈、退栈操作交替进行。但最多只允许连续执行两次退栈,则不可能得到的出栈序列是____",
1318 | "A": "dcebfa",
1319 | "B": "cbdaef",
1320 | "C": "cbdafe",
1321 | "D": "adcfeb",
1322 | "category": 1,
1323 | "id": 146
1324 | },
1325 | {
1326 | "question": "在一棵度为4的树T中,若有20个度为4的结点,10个度为3的结点,1个度为2的结点,10个度为1的结点,则树T的叶结点个数是____",
1327 | "A": "81",
1328 | "B": "82",
1329 | "C": "122",
1330 | "D": "123",
1331 | "category": 1,
1332 | "id": 147
1333 | },
1334 | {
1335 | "question": "对于下列关键字序列,不可能构成某二叉查找树中一条查找路径的序列是____",
1336 | "A": "21,89,77,29,36,38",
1337 | "B": "92,20,91,34,88,35",
1338 | "C": "95,22,91,24,94,71",
1339 | "D": "12,25,71,68,33,34",
1340 | "category": 1,
1341 | "id": 148
1342 | },
1343 | {
1344 | "question": "若一棵二叉树的前序遍历序列为a,e,b,d,c,后序遍历序列为b,c,d,e,a,则根结点的孩子结点____",
1345 | "A": "只有e",
1346 | "B": "有e、b",
1347 | "C": "有e、c",
1348 | "D": "无法确定",
1349 | "category": 1,
1350 | "id": 149
1351 | },
1352 | {
1353 | "question": "设哈夫曼编码的长度不超过4,若已对两个字符编码为1和01,则最多还可以对个字符编码____",
1354 | "A": "2",
1355 | "B": "3",
1356 | "C": "4",
1357 | "D": "5",
1358 | "category": 1,
1359 | "id": 150
1360 | },
1361 | {
1362 | "question": "若用邻接矩阵存储有向图,矩阵中主对角线以下的元素均为零,则关于该图拓扑序列的结论是____",
1363 | "A": "存在,且唯一",
1364 | "B": "不存在",
1365 | "C": "存在,可能不唯一",
1366 | "D": "无法确定是否存在",
1367 | "category": 0,
1368 | "id": 151
1369 | },
1370 | {
1371 | "question": "下列关于最小生成树的说法中,正确的是____。I. 最小生成树树的代价唯一;II. 权值最小的边一定会出现在所有的最小生成树中;III. Prim算法从不同顶点开始得到的最小生成树一定相同;IV. Prim算法和Kruskal算法得到的最小生成树总不相同",
1372 | "A": "仅I",
1373 | "B": "仅II",
1374 | "C": "仅I、III",
1375 | "D": "仅II、IV",
1376 | "category": 0,
1377 | "id": 152
1378 | },
1379 | {
1380 | "question": "在内部排序过程中,对尚未确定最终位置的所有元素进行一遍处理称为一趟排序。对一组数据(2,12,16,88,5,10)进行排序,若前三趟排序结果如下。第一趟:2,12,16,5,10,88;第二趟:2,12,5,10,16,88;第三趟:2,5,10,12,16,88。则采用的排序方法是____",
1381 | "A": "堆排序",
1382 | "B": "起泡排序",
1383 | "C": "基数排序",
1384 | "D": "直接插入排序",
1385 | "category": 0,
1386 | "id": 153
1387 | },
1388 | {
1389 | "question": "不带头尾结点的双循环链表中结点node的结构为(prev,data,next),head是指向双循环链表中某个结点的指针。链表为空时,head的值为NULL。在初始为空的双循环链表中插入一个值为d的结点的操作是____",
1390 | "A": "head->data = d; head->next=head->prev = NULL;",
1391 | "B": "head->data = d; head->next=head->prev = head;",
1392 | "C": "head = new node; head->data = d; head->next=head->prev = NULL;",
1393 | "D": "head = new node; head->data = d; head->next=head->prev = head;",
1394 | "category": 2,
1395 | "id": 154
1396 | },
1397 | {
1398 | "question": "设二叉查找树前序遍历序列为(15、5、0、3、10、30、18、16、40、35、50、45),这棵树是否为AVL树以及这棵树的高度为____(只有一个根节点的树高度为1)",
1399 | "A": "是,4",
1400 | "B": "是,5",
1401 | "C": "否,4",
1402 | "D": "否,5",
1403 | "category": 1,
1404 | "id": 155
1405 | },
1406 | {
1407 | "question": "对一组权值为{1、2、3、4、5、6、7、8}的元素构建一棵哈夫曼树,树的高度是____",
1408 | "A": "4",
1409 | "B": "5",
1410 | "C": "6",
1411 | "D": "7",
1412 | "category": 1,
1413 | "id": 156
1414 | },
1415 | {
1416 | "question": "已知一个最小化堆的层次遍历为(1、4、10、5、6、111、13、9、8),在此堆中插入元素3,插入后3的层次为(根节点是第一层)____",
1417 | "A": "1",
1418 | "B": "2",
1419 | "C": "3",
1420 | "D": "4",
1421 | "category": 1,
1422 | "id": 157
1423 | },
1424 | {
1425 | "question": "在二叉树结点的前序序列、中序序列和后序序列中,所有叶子结点的先后顺序____",
1426 | "A": "完全相同",
1427 | "B": "前序和中序相同,而与后序不同",
1428 | "C": "都不相同",
1429 | "D": "中序和后序相同,而与前序不同",
1430 | "category": 0,
1431 | "id": 158
1432 | },
1433 | {
1434 | "question": "一组整数1到10依次进入一个栈,如果栈的规模为5,则不可能出栈的序列为____",
1435 | "A": "1,2,3,4,5,6,7,8,9,10",
1436 | "B": "5,4,6,7,3,2,9,8,10,1",
1437 | "C": "4,5,3,6,10,9,8,7,2,1",
1438 | "D": "4,3,6,5,8,7,10,9,2,1",
1439 | "category": 1,
1440 | "id": 159
1441 | },
1442 | {
1443 | "question": "利用快速排序对数据{5,6,3,4,9,10,1,2,7,8}进行排序。划分时用第一个元素作为标准元素。经过一趟划分后,数组元素的次序为____",
1444 | "A": "1,2,3,4,5,6,7,8,9,10",
1445 | "B": "2,1,3,4,5,10,9,6,7,8",
1446 | "C": "1,2,3,4,5,9,10,6,7,8",
1447 | "D": "3,4,1,2,5,6,9,10,7,8",
1448 | "category": 1,
1449 | "id": 160
1450 | },
1451 | {
1452 | "question": "利用孩子兄弟链存储树,则根结点的右指针是____",
1453 | "A": "指向最左孩子",
1454 | "B": "指向最右孩子",
1455 | "C": "空",
1456 | "D": "不确定",
1457 | "category": 1,
1458 | "id": 161
1459 | },
1460 | {
1461 | "question": "在结点结构为(prev,data,next)的双向循环链表中,在p指针所指向的结点前插入一个指针q所指向的新结点,其修改指针的操作是____",
1462 | "A": "p->prev = q; q->next = p; p->prev->next = q; q->prev = q;",
1463 | "B": "p->prev = q; p->prev->next = q; q->next = p; q->prev = p->prev;",
1464 | "C": "q->prev = p->prev; q->next = p; p->prev = q; p->prev = q;",
1465 | "D": "q->next = p; q->prev = p->prev; p->prev->next = q; p->prev = q;",
1466 | "category": 2,
1467 | "id": 162
1468 | },
1469 | {
1470 | "question": "设一组初始记录关键字序列为(0,5,10,15,20,25,30,35,40,45,50,55,60,65,70),则利用二分法查找关键字60需要比较的关键字个数为____",
1471 | "A": "1",
1472 | "B": "2",
1473 | "C": "3",
1474 | "D": "4",
1475 | "category": 1,
1476 | "id": 163
1477 | },
1478 | {
1479 | "question": "一组纪录的关键字序列为(22,66,30,70,60,87,24),利用堆排序将其按递增次序排序,通过buildHeap建立的初始堆为____",
1480 | "A": "(22,60,24,70,66,87,30)",
1481 | "B": "(87,70,30,66,60,22,24)",
1482 | "C": "(22,24,30,60,66,70,87)",
1483 | "D": "(87,70,66,60,30,24,22)",
1484 | "category": 1,
1485 | "id": 164
1486 | },
1487 | {
1488 | "question": "某二叉树的先序序列和后序序列正好相反,则该二叉树一定是怎么样的二叉树____",
1489 | "A": "空或只有一个结点",
1490 | "B": "叶子结点数至多为1",
1491 | "C": "任一结点无左儿子",
1492 | "D": "任一结点无右儿子",
1493 | "category": 1,
1494 | "id": 165
1495 | },
1496 | {
1497 | "question": "下列选项给出的是从根分别到达两个叶节点路径上的权值序列,能属于同一棵哈夫曼树的是____",
1498 | "A": "24,10,5和24,10,7",
1499 | "B": "24,10,5和24,12,7",
1500 | "C": "24,10,10和24,14,11",
1501 | "D": "24,10,5和24,14,6",
1502 | "category": 1,
1503 | "id": 166
1504 | },
1505 | {
1506 | "question": "如元素进栈次序是1、2、3、4、5、6,则不可能的出栈次序是____",
1507 | "A": "1、2、3、4、5、6",
1508 | "B": "6、5、4、3、2、1",
1509 | "C": "1、2、4、3、6、5",
1510 | "D": "1、4、2、3、5、6、",
1511 | "category": 1,
1512 | "id": 167
1513 | },
1514 | {
1515 | "question": "二叉查找树中不可能出现查找的序列是____",
1516 | "A": "10、20、30、25",
1517 | "B": "10、20、30、19",
1518 | "C": "10、20、30、40",
1519 | "D": "10、5、7、9",
1520 | "category": 1,
1521 | "id": 168
1522 | },
1523 | {
1524 | "question": "在循环队列中,如果数组规模是size,front指向队头元素前一个单元,rear指向队尾元素,则队列长度是____",
1525 | "A": "rear - front",
1526 | "B": "(rear-front) % size",
1527 | "C": "(rear-front + size)%size",
1528 | "D": "(rear-front + 1 + size)%size",
1529 | "category": 2,
1530 | "id": 169
1531 | },
1532 | {
1533 | "question": "考虑如下数组: 59,19,50,17,12,15,2,5,7,11,6,14,99。将其转变为最⼤堆⾄少需要多少次交换?",
1534 | "A": "4",
1535 | "B": "5",
1536 | "C": "3",
1537 | "D": "6",
1538 | "category": 1,
1539 | "id": 170
1540 | },
1541 | {
1542 | "question": "关于⽤队头位置固定的顺序队列,以下说法正确的是____",
1543 | "A": "只能⼊队不能出队",
1544 | "B": "⼊队⼀定引起⼤量数据移动",
1545 | "C": "出队操作的复杂度为O(1)",
1546 | "D": "出队会引起⼤量数据移动",
1547 | "category": 0,
1548 | "id": 171
1549 | },
1550 | {
1551 | "question": "在含有n个结点的⼆叉查找树中查找某个关键字的结点时,最多进⾏____次⽐较",
1552 | "A": "log(2n)+1",
1553 | "B": "log(n)/log(2)",
1554 | "C": "n",
1555 | "D": "n/2",
1556 | "category": 1,
1557 | "id": 172
1558 | },
1559 | {
1560 | "question": "当⽤⼤⼩为N的数组存储循环队列,front指向的单元不存储数据元素,则该队列的最⼤⻓度为____",
1561 | "A": "n+1",
1562 | "B": "n-1",
1563 | "C": "n-2",
1564 | "D": "n",
1565 | "category": 1,
1566 | "id": 173
1567 | },
1568 | {
1569 | "question": "含有20个结点的平衡⼆叉树的最⼤深度为____",
1570 | "A": "5",
1571 | "B": "6",
1572 | "C": "7",
1573 | "D": "4",
1574 | "category": 1,
1575 | "id": 174
1576 | },
1577 | {
1578 | "question": "以下说法正确的是____",
1579 | "A": "循环队列中,令front指向的单元不存储队列元素,判断队满的条件为(rear+1)%MaxSize==front",
1580 | "B": "全对",
1581 | "C": "全错",
1582 | "D": "栈的操作为先进后出",
1583 | "category": 0,
1584 | "id": 175
1585 | },
1586 | {
1587 | "question": "以下说法正确的是____",
1588 | "A": "全对",
1589 | "B": "进⾏出栈运算前应判断栈是否空",
1590 | "C": "全错",
1591 | "D": "栈的操作为先进后出",
1592 | "category": 0,
1593 | "id": 176
1594 | },
1595 | {
1596 | "question": "以下说法正确的是____",
1597 | "A": "全对",
1598 | "B": "全错",
1599 | "C": "栈是⼀种存储结构",
1600 | "D": "栈的操作为先进后出",
1601 | "category": 0,
1602 | "id": 177
1603 | },
1604 | {
1605 | "question": "⼀个栈的⼊栈顺序是1,2,3,4,则不可能的出栈序列是____?",
1606 | "A": "4 3 1 2",
1607 | "B": "1 4 3 2",
1608 | "C": "1 2 4 3",
1609 | "D": "2 1 4 3",
1610 | "category": 1,
1611 | "id": 178
1612 | },
1613 | {
1614 | "question": "通过_____⽅法可以判断出⼀个有向图是否有环。",
1615 | "A": "求节点的度",
1616 | "B": "全错",
1617 | "C": "求关键路径",
1618 | "D": "拓扑排序",
1619 | "category": 0,
1620 | "id": 179
1621 | },
1622 | {
1623 | "question": "通过_____⽅法可以判断出⼀个有向图是否有环。",
1624 | "A": "求节点的度",
1625 | "B": "深度优先遍历",
1626 | "C": "求关键路径",
1627 | "D": "全错",
1628 | "category": 0,
1629 | "id": 180
1630 | },
1631 | {
1632 | "question": "对于⼀个有向图,若⼀个顶点的⼊度为K1,出度为K2,则对应邻接表中该顶点单链表中的结点数为____",
1633 | "A": "K1+K2",
1634 | "B": "K2",
1635 | "C": "fabs(K1-K2)",
1636 | "D": "K1",
1637 | "category": 1,
1638 | "id": 181
1639 | },
1640 | {
1641 | "question": "给定如下基于数组的最⼤化堆: {75,72,59,63,48,15,43,61},以下哪⼀个数组可以正确表示其删除两次根元素后的结果?",
1642 | "A": "63,59,61,43,48,15",
1643 | "B": "63,59,48,15,43,61",
1644 | "C": "63,61,59,43,48,15",
1645 | "D": "63,61,59,48,43,15",
1646 | "category": 1,
1647 | "id": 182
1648 | },
1649 | {
1650 | "question": "已知有序表{3,7,12,21,54,57,65,76,87,90,92,94},⽤⼆分查找在表中查找90,第3次⽐较的记录是____",
1651 | "A": "76",
1652 | "B": "87",
1653 | "C": "90",
1654 | "D": "92",
1655 | "category": 1,
1656 | "id": 183
1657 | },
1658 | {
1659 | "question": "下⾯叙述中错误的是哪些选项?",
1660 | "A": "全错",
1661 | "B": "基数排序是⼀种稳定的排序⽅法",
1662 | "C": "哈夫曼树是带权路径⻓度最短的树,路径上权值较⼤的结点离根较近",
1663 | "D": "当从⼀个最⼩堆中删除⼀个元素时,需要把堆尾元素填补到堆顶位置,然后再按条件把它逐层向上调整到合适位置",
1664 | "category": 0,
1665 | "id": 184
1666 | },
1667 | {
1668 | "question": "下⾯叙述中错误的是哪些选项?",
1669 | "A": "拓扑排序是指结点值必须有序的排序",
1670 | "B": "基数排序是⼀种稳定的排序⽅法",
1671 | "C": "哈夫曼树是带权路径⻓度最短的树,路径上权值较⼤的结点离根较近",
1672 | "D": "全错",
1673 | "category": 0,
1674 | "id": 185
1675 | },
1676 | {
1677 | "question": "时间复杂度不受数据初始状态影响⽽恒为O(nlogn)的是____",
1678 | "A": "冒泡排序",
1679 | "B": "堆排序",
1680 | "C": "希尔排序",
1681 | "D": "快速排序",
1682 | "category": 0,
1683 | "id": 186
1684 | },
1685 | {
1686 | "question": "有 1000 个⽆序的整数,希望使⽤最快的⽅式找出前 50 个最⼤的,最佳的选择是____",
1687 | "A": "基数排序",
1688 | "B": "冒泡排序",
1689 | "C": "堆排序",
1690 | "D": "快速排序",
1691 | "category": 0,
1692 | "id": 187
1693 | },
1694 | {
1695 | "question": "在⼆叉查找树中进⾏查找的效率与____有关",
1696 | "A": "被查找结点的度",
1697 | "B": "⼆叉查找树的深度",
1698 | "C": "⼆叉查找树的结点的个数",
1699 | "D": "⼆叉查找树的存储结构",
1700 | "category": 0,
1701 | "id": 188
1702 | },
1703 | {
1704 | "question": "下列关于遍历的描述,正确的是____",
1705 | "A": "全错",
1706 | "B": "由⼆叉树某种遍历⽅式产⽣的结果是⼀个线性序列",
1707 | "C": "给定⼆叉树的某种遍历结果不能唯⼀确定这棵树,但由⼆叉树的两种遍历结果可以推导出这棵⼆叉树",
1708 | "D": "由树的前序遍历和后序遍历,可以唯⼀确定这棵树",
1709 | "category": 0,
1710 | "id": 189
1711 | },
1712 | {
1713 | "question": "下列关于遍历的描述,正确的是____",
1714 | "A": "遍历既有递归算法,⼜有⾮递归算法",
1715 | "B": "全错",
1716 | "C": "给定⼆叉树的某种遍历结果不能唯⼀确定这棵树,但由⼆叉树的两种遍历结果可以推导出这棵⼆叉树",
1717 | "D": "由树的前序遍历和后序遍历,可以唯⼀确定这棵树",
1718 | "category": 0,
1719 | "id": 190
1720 | },
1721 | {
1722 | "question": "对线性表进⾏⼆分查找时,要求线性表必须____",
1723 | "A": "以顺序⽅式存储,且结点按关键字有序存储",
1724 | "B": "以顺序⽅式存储",
1725 | "C": "以链接⽅式存储,且结点按关键字有序存储",
1726 | "D": "以链接⽅式存储",
1727 | "category": 0,
1728 | "id": 191
1729 | },
1730 | {
1731 | "question": "以下关于图的叙述中,正确的是____",
1732 | "A": "强连通有向图的任何顶点到其他所有顶点都有弧",
1733 | "B": "图的任意顶点的⼊度等于出度",
1734 | "C": "有向图的边集的⼦集和顶点集的⼦集可构成原有向图的⼦图",
1735 | "D": "有向完全图⼀定是强连通有向图",
1736 | "category": 0,
1737 | "id": 192
1738 | },
1739 | {
1740 | "question": "已知两个⻓度为m和n的双链表,在使⽤现有链表结点空间的前提下,将⻓为n的链表合并到⻓为m的链表的后⾯,所需的时间复杂度是____",
1741 | "A": "O(m+n)",
1742 | "B": "O(m)",
1743 | "C": "O(1)",
1744 | "D": "O(n)",
1745 | "category": 1,
1746 | "id": 193
1747 | },
1748 | {
1749 | "question": "下列关于散列表的说法中,正确的有____。I. 采⽤除留余数法时,数组的⻓度最好是素数。II. 散列查找中不需要任何关键字的⽐较。III. 散列表在查找成功时平均查找⻓度与表⻓有关IV. 若在散列表中删除⼀个元素,不能简单地将该元素删除。",
1750 | "A": "I和IV",
1751 | "B": "和III",
1752 | "C": "IV",
1753 | "D": "II和III",
1754 | "category": 1,
1755 | "id": 194
1756 | },
1757 | {
1758 | "question": "后缀表达式9 2 3 * +10 2 / - 的值为____",
1759 | "A": "23",
1760 | "B": "17",
1761 | "C": "10",
1762 | "D": "20",
1763 | "category": 1,
1764 | "id": 195
1765 | },
1766 | {
1767 | "question": "向⼀个有100个元素的顺序表中插⼊⼀个元素并保持原来顺序不变,在插⼊位置等概率分布的情况下,平均需要移动多少元素?",
1768 | "A": "50",
1769 | "B": "50.5",
1770 | "C": "49.5",
1771 | "D": "1",
1772 | "category": 1,
1773 | "id": 196
1774 | },
1775 | {
1776 | "question": "下列关于⽆向连通图特性的叙述中,正确的是____。I. 所有顶点的度之和为偶数。II. 边数⼤于顶点个数减1。III. ⾄少有⼀个顶点的度为1",
1777 | "A": "只有II",
1778 | "B": "I和II",
1779 | "C": "只有I",
1780 | "D": "I和III",
1781 | "category": 0,
1782 | "id": 197
1783 | },
1784 | {
1785 | "question": "下列关于B树和B+树的叙述中,错误的是____",
1786 | "A": "B树和B+树都可以⽤于⽂件索引结构",
1787 | "B": "B树和B+树都是平衡的多叉树",
1788 | "C": "B树和B+树都能有效地⽀持随机查找",
1789 | "D": "B树和B+树都能有效地⽀持顺序查找",
1790 | "category": 0,
1791 | "id": 198
1792 | },
1793 | {
1794 | "question": "下列说法正确的是____",
1795 | "A": "数据的逻辑结构唯⼀确定了其存储结构",
1796 | "B": "数据的逻辑结构独⽴于其存储结构",
1797 | "C": "数据结构仅由其逻辑结构和存储结构决定",
1798 | "D": "全错",
1799 | "category": 0,
1800 | "id": 199
1801 | },
1802 | {
1803 | "question": "将 7,8,9,2,3,5,6,4 顺序插⼊⼀棵初始为空的AVL树。下列句⼦中哪句是错的____",
1804 | "A": "有2个结点的平衡因⼦为-1",
1805 | "B": "2和5是兄弟",
1806 | "C": "3是4的⽗结点",
1807 | "D": "7 是根结点",
1808 | "category": 0,
1809 | "id": 200
1810 | },
1811 | {
1812 | "question": "由度为2的哈夫曼树推⼴到度为3的哈夫曼树,A、 B、 C、 D、 E、 F、 G的权值分别是3、 12、 7、 4、2、 8、 11,则字符A在哈夫曼树的第____层(设根结点在第1层)。",
1813 | "A": "3",
1814 | "B": "2",
1815 | "C": "4",
1816 | "D": "5",
1817 | "category": 1,
1818 | "id": 201
1819 | },
1820 | {
1821 | "question": "若从⽆向图的任意顶点出发进⾏⼀次深度优先搜索即可访问所有顶点,则该图⼀定是____",
1822 | "A": "强连通图",
1823 | "B": "有回路",
1824 | "C": "⼀棵树",
1825 | "D": "连通图",
1826 | "category": 1,
1827 | "id": 202
1828 | },
1829 | {
1830 | "question": "⼀个算法的时间复杂度为(n^3+n^2*(log(n)/log(2))+8n)/n^2,⽤⼤O表示法为____",
1831 | "A": "O(logn)",
1832 | "B": "O(n^3)",
1833 | "C": "O(n+logn+8/n)",
1834 | "D": "O(n)",
1835 | "category": 2,
1836 | "id": 203
1837 | },
1838 | {
1839 | "question": "按____遍历⼆叉查找树得到的是⼀个有序序列",
1840 | "A": "前序",
1841 | "B": "层次序",
1842 | "C": "中序",
1843 | "D": "后序",
1844 | "category": 0,
1845 | "id": 204
1846 | },
1847 | {
1848 | "question": "在表⻓为N的顺序表中,删除结点最多需要移动的元素数据个数是____",
1849 | "A": "N-1",
1850 | "B": "N/2",
1851 | "C": "N",
1852 | "D": "1",
1853 | "category": 1,
1854 | "id": 205
1855 | },
1856 | {
1857 | "question": "下列叙述中不正确的是____",
1858 | "A": "堆排序的时间复杂度为O(nlogn)",
1859 | "B": "堆排序的空间复杂度为O(1)",
1860 | "C": "堆排序是⼀种稳定的排序算法",
1861 | "D": "整个构建堆的时间复杂度为O(n)",
1862 | "category": 0,
1863 | "id": 206
1864 | },
1865 | {
1866 | "question": "若哈夫曼编码的⻓度不超过4,并且已知其中两个字符的编码为0和100,则最多还可以编码____个字符。",
1867 | "A": "7",
1868 | "B": "3",
1869 | "C": "5",
1870 | "D": "6",
1871 | "category": 1,
1872 | "id": 207
1873 | },
1874 | {
1875 | "question": "已知⼀棵⼆叉树的叶⼦结点在前序遍历中的相对次序是ABCDEF,则这些结点在后序遍历中的相对次序是____",
1876 | "A": "ABCFED",
1877 | "B": "⽆法确定",
1878 | "C": "FEDCBA",
1879 | "D": "ABCDEF",
1880 | "category": 1,
1881 | "id": 208
1882 | },
1883 | {
1884 | "question": "栈的插⼊和删除操作在____",
1885 | "A": "栈顶",
1886 | "B": "栈中",
1887 | "C": "栈底",
1888 | "D": "任意位置",
1889 | "category": 0,
1890 | "id": 209
1891 | },
1892 | {
1893 | "question": "设栈S 和队列Q 的初始状态为空,元素e1,e2,e3,e4,e5和e6依次通过栈S,⼀个元素出栈后即进队列Q,若6 个元素出队的序列是e2,e4,e3,e6,e5,e1则栈S的容量⾄少应该是____",
1894 | "A": "5",
1895 | "B": "3",
1896 | "C": "2",
1897 | "D": "4",
1898 | "category": 1,
1899 | "id": 210
1900 | },
1901 | {
1902 | "question": "给定初始待排序列{ 15,9,7,8,20,-1,4 }。如果希尔排序第⼀趟结束后得到序列为{ 15,-1,4,8,20,9,7 },则该趟增量为____",
1903 | "A": "2",
1904 | "B": "4",
1905 | "C": "3",
1906 | "D": "1",
1907 | "category": 1,
1908 | "id": 211
1909 | },
1910 | {
1911 | "question": "在⼀棵⾮空⼆叉树的中序遍历序列中,某个结点的相邻结点不可能是____",
1912 | "A": "它右⼦树上的最左结点",
1913 | "B": "它左⼦树上的最右结点",
1914 | "C": "它的兄弟结点",
1915 | "D": "它的⽗结点",
1916 | "category": 0,
1917 | "id": 212
1918 | },
1919 | {
1920 | "question": "设森林F对应的⼆叉树为B,它有m+1个结点,B的根为p,p的右⼦树结点个数为n,森林F中第⼀棵树的结点个数是多少?",
1921 | "A": "m-n",
1922 | "B": "条件不⾜,⽆法确定",
1923 | "C": "m-n+1",
1924 | "D": "n+1",
1925 | "category": 1,
1926 | "id": 213
1927 | },
1928 | {
1929 | "question": "双链表相对单链表的优点有____",
1930 | "A": "全错",
1931 | "B": "可以直接获得链表中指定结点的直接前驱",
1932 | "C": "具有更优的空间复杂度",
1933 | "D": "可以直接获得链表中指定结点的直接后继",
1934 | "category": 0,
1935 | "id": 214
1936 | },
1937 | {
1938 | "question": "双链表相对单链表的优点有____",
1939 | "A": "更快的从终端结点开始逆序访问到起始结点",
1940 | "B": "全错",
1941 | "C": "具有更优的空间复杂度",
1942 | "D": "可以直接获得链表中指定结点的直接后继",
1943 | "category": 0,
1944 | "id": 215
1945 | },
1946 | {
1947 | "question": "⾮空循环链表head的尾结点tail满⾜以下条件____",
1948 | "A": "tail==NULL;",
1949 | "B": "tail->next==head;",
1950 | "C": "tail->next==NULL;",
1951 | "D": "head->next==tail;",
1952 | "category": 2,
1953 | "id": 216
1954 | },
1955 | {
1956 | "question": "下列哪种树的中序遍历序列是有序的?____",
1957 | "A": "AVL树",
1958 | "B": "二叉树",
1959 | "C": "堆",
1960 | "D": "哈夫曼树",
1961 | "category": 0,
1962 | "id": 217
1963 | },
1964 | {
1965 | "question": "下列哪种树的中序遍历序列是有序的?____",
1966 | "A": "全错",
1967 | "B": "⼆叉查找树",
1968 | "C": "堆",
1969 | "D": "哈夫曼树",
1970 | "category": 0,
1971 | "id": 218
1972 | },
1973 | {
1974 | "question": "以下代码的算法复杂度是____?\ncount=0;for(k=1; k<=n; k*=2)for(j=1; j<=n; j++)count++;",
1975 | "A": "O(n^2)",
1976 | "B": "O(nlogn)",
1977 | "C": "O(n^3)",
1978 | "D": "O(log(n)/LOG(2))",
1979 | "category": 2,
1980 | "id": 219
1981 | },
1982 | {
1983 | "question": "在常⽤的描述⼆叉查找树的存储结构中,关键字值最⼤的结点____",
1984 | "A": "左指针⼀定为空",
1985 | "B": "右指针⼀定为空",
1986 | "C": "左右指针均不为空",
1987 | "D": "左右指针均为空",
1988 | "category": 0,
1989 | "id": 220
1990 | },
1991 | {
1992 | "question": "当采⽤分块查找时,数据的组织⽅式要求____",
1993 | "A": "数据分为若⼲块,每块内数据有序,且块间也必须有序",
1994 | "B": "数据分为若⼲块,每块中的数据个数必须相同",
1995 | "C": "数据分为若⼲块,每块内数据有序,但块间不必有序",
1996 | "D": "数据分为若⼲块,每块内数据不必有序,但块间必须有序",
1997 | "category": 0,
1998 | "id": 221
1999 | },
2000 | {
2001 | "question": "给定⼀个⾜够⼤的空栈,有4个元素的进栈次序为A、 B、 C、 D,则以CD开头的栈序列的个数为____",
2002 | "A": "1",
2003 | "B": "3",
2004 | "C": "2",
2005 | "D": "4",
2006 | "category": 1,
2007 | "id": 222
2008 | },
2009 | {
2010 | "question": "考虑⼀个最⼩堆,其所有结点的元素排序后恰好为{1,2,...,1024}。记根结点的深度为1,则整数9在堆中的最⼤深度可能是多少?",
2011 | "A": "9",
2012 | "B": "10",
2013 | "C": "4",
2014 | "D": "2",
2015 | "category": 1,
2016 | "id": 223
2017 | },
2018 | {
2019 | "question": "某⼆叉树的前序遍历序列是ABDCEF,中序遍历序列是BDAECF,则该⼆叉树对应的森林包括____棵树。",
2020 | "A": "3",
2021 | "B": "2",
2022 | "C": "4",
2023 | "D": "1",
2024 | "category": 1,
2025 | "id": 224
2026 | },
2027 | {
2028 | "question": "下⾯四种排序中____是稳定的",
2029 | "A": "冒泡排序",
2030 | "B": "全错",
2031 | "C": "快速排序",
2032 | "D": "归并排序",
2033 | "category": 0,
2034 | "id": 225
2035 | },
2036 | {
2037 | "question": "下⾯四种排序中____是稳定的",
2038 | "A": "全错",
2039 | "B": "希尔排序",
2040 | "C": "快速排序",
2041 | "D": "归并排序",
2042 | "category": 0,
2043 | "id": 226
2044 | },
2045 | {
2046 | "question": "从空树开始,依次插⼊元素52,26,14,32,71,60,93,58,24和41后构成了⼀棵⼆叉查找树。在该树查找60要进⾏的⽐较次数是____",
2047 | "A": "4",
2048 | "B": "5",
2049 | "C": "3",
2050 | "D": "6",
2051 | "category": 1,
2052 | "id": 227
2053 | },
2054 | {
2055 | "question": "下列关于m阶B树的说法中,错误的是____",
2056 | "A": "所有叶结点都在同⼀层次上",
2057 | "B": "⾮叶节点⾄少有m/2(m为偶数)或(m+1) /2(m为奇数)棵⼦树",
2058 | "C": "根结点中的数据是有序的",
2059 | "D": "根结点⾄多有m棵⼦树",
2060 | "category": 1,
2061 | "id": 228
2062 | },
2063 | {
2064 | "question": "若⼀个算法的时间复杂度为O(n),其中n的含义是____",
2065 | "A": "问题规模",
2066 | "B": "循环层数",
2067 | "C": "语句条数",
2068 | "D": "函数数量",
2069 | "category": 0,
2070 | "id": 229
2071 | },
2072 | {
2073 | "question": "若已知⼀队列⽤单链表表示,该单链表的当前状态(含3个元素)是: 1->2->3,其中x->y表示x的下⼀节点是y。此时,如果将元素4⼊队,然后队列出队,则单链表的状态是____",
2074 | "A": "2->3->4",
2075 | "B": "答案不唯⼀",
2076 | "C": "1->2->3",
2077 | "D": "4->2->1",
2078 | "category": 1,
2079 | "id": 230
2080 | },
2081 | {
2082 | "question": "以下关于双向链表的描述错误的是____",
2083 | "A": "双向链表便于插⼊和删除",
2084 | "B": "双向链表指针可以前后两个⽅向移动",
2085 | "C": "双向链表和单向链表占⽤同样的存储空间",
2086 | "D": "双向链表不必占⽤连续的存储空间",
2087 | "category": 0,
2088 | "id": 231
2089 | },
2090 | {
2091 | "question": "前序遍历序列为1、 2、 3的不同⼆叉树个数为____",
2092 | "A": "5",
2093 | "B": "3",
2094 | "C": "4",
2095 | "D": "6",
2096 | "category": 1,
2097 | "id": 232
2098 | },
2099 | {
2100 | "question": "下述编码中哪⼀个不是前缀码____",
2101 | "A": "(0,10,110,111)",
2102 | "B": "(0,1,00,11)",
2103 | "C": "(00,01,10,11)",
2104 | "D": "(1,01,000,001",
2105 | "category": 0,
2106 | "id": 233
2107 | },
2108 | {
2109 | "question": "图的⼴度优先⽣成树的树⾼⽐深度优先⽣成树的树⾼____",
2110 | "A": "⼩",
2111 | "B": "⼩或相等",
2112 | "C": "⼤",
2113 | "D": "⼤或相等",
2114 | "category": 0,
2115 | "id": 234
2116 | },
2117 | {
2118 | "question": "在含有n个顶点和e条边的⽆向图的邻接矩阵中,零元素的个数为____",
2119 | "A": "2e",
2120 | "B": "n^2-e",
2121 | "C": "n^2-2e",
2122 | "D": "e",
2123 | "category": 1,
2124 | "id": 235
2125 | },
2126 | {
2127 | "question": "⼀棵深度为k的AVL树,其每个分⽀结点的平衡因⼦均为0,则该平衡⼆叉树共有____个结点",
2128 | "A": "2^(k-1)-1",
2129 | "B": "2^k-1",
2130 | "C": "2^k",
2131 | "D": "2^(k-1)+1",
2132 | "category": 1,
2133 | "id": 236
2134 | },
2135 | {
2136 | "question": "下列说法中正确的是_____。",
2137 | "A": "从源点到终点的最短路径是唯⼀的。",
2138 | "B": "对有向图G,如果以任⼀顶点出发进⾏⼀次深度优先或⼴度优先搜索能访问到每个顶点,则该图⼀定是完全图。",
2139 | "C": "拓扑排序是按 AOE ⽹中每个结点事件的最早发⽣时间对结点进⾏排序。",
2140 | "D": "⼀个有向图的拓扑序列中若顶点a在顶点b之前,则图中必有⼀条弧。",
2141 | "category": 0,
2142 | "id": 237
2143 | },
2144 | {
2145 | "question": "设在磁盘上存放有375000个记录,做5路平衡归并排序,内存⼯作区能容纳600个记录,为把所有记录排好序,需要做____趟平衡归并。",
2146 | "A": "3",
2147 | "B": "4",
2148 | "C": "5",
2149 | "D": "6",
2150 | "category": 1,
2151 | "id": 238
2152 | },
2153 | {
2154 | "question": "AVL树是⼀种平衡的⼆叉查找树,树中任⼀结点具有下列哪⼀特性____",
2155 | "A": "左、右⼦树的⾼度均相同",
2156 | "B": "左、右⼦树⾼度差的绝对值不超过1",
2157 | "C": "左⼦树的⾼度均⼤于右⼦树的⾼度",
2158 | "D": "左⼦树的⾼度均⼩于右⼦树的⾼度",
2159 | "category": 0,
2160 | "id": 239
2161 | },
2162 | {
2163 | "question": "⼀棵⼆叉树有n个结点,在该树的⼆叉链表存储表示中,空指针字段的个数是____",
2164 | "A": "n-1",
2165 | "B": "n+1",
2166 | "C": "n",
2167 | "D": "2n",
2168 | "category": 1,
2169 | "id": 240
2170 | },
2171 | {
2172 | "question": "下⾯四种排序中____的空间复杂度最⾼",
2173 | "A": "堆排序",
2174 | "B": "归并排序",
2175 | "C": "冒泡排序",
2176 | "D": "插⼊排序",
2177 | "category": 0,
2178 | "id": 241
2179 | },
2180 | {
2181 | "question": "在存储数据的时候,不仅要存储各元素的值,还要存储____",
2182 | "A": "数据元素的类型",
2183 | "B": "数据的操作⽅法",
2184 | "C": "数据元素之间的关系",
2185 | "D": "全错",
2186 | "category": 0,
2187 | "id": 242
2188 | },
2189 | {
2190 | "question": "B+树不同于B树的特点之⼀是____",
2191 | "A": "结点中含有关键字",
2192 | "B": "根结点⾄少有两个分⽀",
2193 | "C": "所有叶结点都在同⼀层上",
2194 | "D": "能⽀持顺序查找",
2195 | "category": 0,
2196 | "id": 243
2197 | },
2198 | {
2199 | "question": "将5个数据进⾏排序,最多需要⽐较____次",
2200 | "A": "5",
2201 | "B": "10",
2202 | "C": "20",
2203 | "D": "25",
2204 | "category": 1,
2205 | "id": 244
2206 | },
2207 | {
2208 | "question": "⼀趟排序结束后不⼀定能够选出⼀个元素放在其最终位置上的是____",
2209 | "A": "堆排序",
2210 | "B": "冒泡排序",
2211 | "C": "希尔排序",
2212 | "D": "快速排序",
2213 | "category": 0,
2214 | "id": 245
2215 | },
2216 | {
2217 | "question": "对n个不同的数进⾏从⼩到⼤的排序,冒泡排序在下列哪种情况⽐较的次数最多____",
2218 | "A": "从⼤到⼩排好的",
2219 | "B": "从⼩到⼤排好的",
2220 | "C": "元素⽆序",
2221 | "D": "元素基本有序",
2222 | "category": 0,
2223 | "id": 246
2224 | },
2225 | {
2226 | "question": "下列关于图遍历的说法不正确的是____。",
2227 | "A": "全错",
2228 | "B": "若从⼀个⽆向图中任⼀顶点出发,进⾏了⼀次深度优先遍历,就可以访问图中所有的顶点,则该图⼀定是连通的。",
2229 | "C": "图的⼴度优先遍历是⼀个递归过程。",
2230 | "D": "图的深度优先搜索中⼀般要采⽤队列来暂存刚访问过的顶点。",
2231 | "category": 0,
2232 | "id": 247
2233 | },
2234 | {
2235 | "question": "下列关于图遍历的说法不正确的是____。",
2236 | "A": "⼀个图的⼴度优先搜索树是唯⼀的。",
2237 | "B": "若从⼀个⽆向图中任⼀顶点出发,进⾏了⼀次深度优先遍历,就可以访问图中所有的顶点,则该图⼀定是连通的。",
2238 | "C": "全错",
2239 | "D": "图的深度优先搜索中⼀般要采⽤队列来暂存刚访问过的顶点。",
2240 | "category": 0,
2241 | "id": 248
2242 | },
2243 | {
2244 | "question": "设⼀组初始记录关键字序列为(345,53,67,9,62),则⽤基数排序需要进⾏____趟的分配和回收才能使得初始关键字序列变成有序序列",
2245 | "A": "1",
2246 | "B": "4",
2247 | "C": "3",
2248 | "D": "2",
2249 | "category": 1,
2250 | "id": 249
2251 | }
2252 | ]
--------------------------------------------------------------------------------
/ProgrammingComprehension/testcases/testcases_en.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "question": "If there is a definition: char str[] = {'h','1','2','0','a','b'}; const char *p = str; Which of the following statements is correct:____\n",
4 | "A": "p[2] = 's'",
5 | "B": "strcpy(str,\"123456\")",
6 | "C": "strcpy(p,\"abc\")",
7 | "D": "strcpy(str,\"abc\")",
8 | "category": 1,
9 | "id": 0
10 | },
11 | {
12 | "question": "After executing the following statement, the value of s is ____\n```s = 0;for (int i = 1; i <= 10 ++i)\nif (i % 2 == 0 || i % 3 == 0) continue;\nelse s += i;```",
13 | "A": "55",
14 | "B": "49",
15 | "C": "13",
16 | "D": "1",
17 | "category": 1,
18 | "id": 1
19 | },
20 | {
21 | "question": "If ```char x=97;```, how many characters does the variable x contain?",
22 | "A": "1",
23 | "B": "2",
24 | "C": "4",
25 | "D": "8",
26 | "category": 0,
27 | "id": 2
28 | },
29 | {
30 | "question": "Execute the following statement:\n```int x; char s[100]; cin>>x; cin.get(); cin>>s;```\nWhen the user inputs: 2021 (carriage return) Hello (space) Sjtu (carriage return), the value in string s is:____",
31 | "A": "\"Sjtu\"",
32 | "B": "\"Hello Sjtu\"",
33 | "C": "\"Hello\"",
34 | "D": "\"H\"",
35 | "category": 1,
36 | "id": 3
37 | },
38 | {
39 | "question": "Which two expressions in the following options have the same result?",
40 | "A": "3/2 and 3.0/2.0",
41 | "B": "3/2 and 3.0/2",
42 | "C": "3/2.0 and 3.0/2.0",
43 | "D": "3/2.0 and 3/2",
44 | "category": 0,
45 | "id": 4
46 | },
47 | {
48 | "question": "Which one of the following numbers is an octal number?",
49 | "A": "0x1g",
50 | "B": "010",
51 | "C": "080",
52 | "D": "01b",
53 | "category": 0,
54 | "id": 5
55 | },
56 | {
57 | "question": "The incorrect statement among the following is ____",
58 | "A": "The meaning of an algorithm working in-place is that it does not require any additional auxiliary space.",
59 | "B": "Among algorithms with the same scale n, an algorithm with a complexity of O(n) is always better in terms of time than an algorithm with a complexity of O(2n).",
60 | "C": "The so-called time complexity refers to an upper bound estimation of the algorithm's execution time in the worst case.",
61 | "D": "The higher the level of implementation",
62 | "category": 0,
63 | "id": 6
64 | },
65 | {
66 | "question": "If the most frequently used operations for a linear table are to access the value of the i-th element and its predecessor and successor, in order to improve efficiency, the ____ storage method should be adopted.",
67 | "A": "Singly linked list",
68 | "B": "Doubly linked list",
69 | "C": "Circular linked list",
70 | "D": "Sequential list",
71 | "category": 0,
72 | "id": 7
73 | },
74 | {
75 | "question": " In the following statement, the error is ____. I. The meaning of the algorithm working in place is that it does not require any additional auxiliary space. II. At the same scale n, algorithms with complexity O (n) always outperform algorithms with complexity O (2n) in terms of time Algorithm. III. The so-called time complexity refers to an upper bound for estimating algorithm execution time in the worst-case scenario. IV. The higher the implementation level of the same algorithm, the lower the execution efficiency.",
76 | "A": "I",
77 | "B": "I, II",
78 | "C": "I, IV",
79 | "D": "III",
80 | "category": 0,
81 | "id": 8
82 | },
83 | {
84 | "question": "If a linear table has n elements, strictly speaking, the operation ____ is more efficient to implement on a sequential list than on a linked list. I. Output the value of the i-th (1\u2264i\u2264n) element. II. Swap the values of the 3rd and 4th elements. III. Sequentially output the values of these n elements.",
85 | "A": "I",
86 | "B": "I, III",
87 | "C": "I, II",
88 | "D": "II, III",
89 | "category": 2,
90 | "id": 9
91 | },
92 | {
93 | "question": "Among the following statements about linear tables, the correct one is ____. The sequential storage method can only be used to store linear structures. II. The time of taking the i-th element of the linear table is related to the size of i. III. Static linked lists require the allocation of large continuous space, and insertion and deletion do not require moving elements. IV. The time complexity of inserting a new node into an ordered single chain table with a length of n while maintaining order is O (n). V. If a single linked list is used to represent a queue, a circular linked list with a trailing pointer should be used",
94 | "A": "\u2160\u3001\u2161",
95 | "B": "\u2160\u3001\u2162\u3001\u2163\u3001\u2164",
96 | "C": "\u2163\u3001\u2164",
97 | "D": "\u2162\u3001\u2163\u3001\u2164",
98 | "category": 0,
99 | "id": 10
100 | },
101 | {
102 | "question": "The lowest time complexity to create a sorted singly linked list from a one-dimensional array with n elements is ______",
103 | "A": "O(1)",
104 | "B": " O(n)",
105 | "C": "O(n^2)",
106 | "D": "O(nlog2n)",
107 | "category": 1,
108 | "id": 11
109 | },
110 | {
111 | "question": "Which of the following is the least suitable as a linked stack if the linked list does not have a head node and all operations are performed at the head of the list?\n",
112 | "A": "Doubly linked list with only a head node pointer and no tail pointer",
113 | "B": "Doubly linked list with only a tail node pointer and no head pointer",
114 | "C": "Singly linked list with only a head node pointer and no tail pointer",
115 | "D": "Singly linked list with only a tail node pointer and no head",
116 | "category": 0,
117 | "id": 12
118 | },
119 | {
120 | "question": "Use S for stack operation and X for stack operation. If the stack order of elements is 1234, in order to obtain the stack order of 1342, the corresponding operation sequences for S and X are____",
121 | "A": "SXSXSSXX",
122 | "B": "SSSXXSXX",
123 | "C": "SXSSXXSX",
124 | "D": "SXSSXSXX",
125 | "category": 1,
126 | "id": 13
127 | },
128 | {
129 | "question": "The storage space of the circular queue is an array A[21], where \"front\" points to the position before the front element, and \"rear\" points to the rear element. Assuming the current values of \"front\" and \"rear\" are 8 and 3 respectively, the length of the queue is ____.",
130 | "A": "5",
131 | "B": "6",
132 | "C": "16",
133 | "D": "17",
134 | "category": 1,
135 | "id": 14
136 | },
137 | {
138 | "question": "The most suitable linked list for use as a queue is ____.",
139 | "A": "Circular singly linked list with head and tail pointers",
140 | "B": "Non-circular singly linked list with head and tail pointers",
141 | "C": "Singly linked list with only head pointer",
142 | "D": "Circular singly linked list with only head pointer",
143 | "category": 0,
144 | "id": 15
145 | },
146 | {
147 | "question": "Which of the following is not a possible dequeue sequence if elements a, b, c, d, e are enqueued in a queue that allows enqueue operations at both ends but only allows dequeue operations at one end?",
148 | "A": "b,a,c,d,e",
149 | "B": "d,b,a,c,e",
150 | "C": "d,b,c,a,e",
151 | "D": "e,c,b,a,d",
152 | "category": 1,
153 | "id": 16
154 | },
155 | {
156 | "question": "The value of the next array for the string 'ababaaababaa' is ____.",
157 | "A": "01234567899",
158 | "B": "012121111212",
159 | "C": "011234223456",
160 | "D": "0123012322345",
161 | "category": 1,
162 | "id": 17
163 | },
164 | {
165 | "question": "The next array of the string 'ababaaababaa' is ____",
166 | "A": "-1,0,1,2,3,4,5,6,7,8,8,8",
167 | "B": "-1,0,1,0,1,0,0,0,0,1,0,1",
168 | "C": "-1,0,0,1,2,3,1,1,2,3,4,5",
169 | "D": "-1,0,1,2,-1,0,1,2,1,1,2,3",
170 | "category": 1,
171 | "id": 18
172 | },
173 | {
174 | "question": "The nextval array of the string 'ababaaababaa' is ____",
175 | "A": "0,1,0,1,1,2,0,1,0,1,0,2",
176 | "B": "0,1,0,1,1,4,1,1,0,1,0,2",
177 | "C": "0,1,0,1,0,4,2,1,0,1,0,4",
178 | "D": "0,1,1,1,0,2,1,1,0, 1,0,4",
179 | "category": 1,
180 | "id": 19
181 | },
182 | {
183 | "question": "The main string T='abaabaabcabaabc' and the pattern string S='abaabc'. Using the KMP algorithm for pattern matching, the number of single character comparisons performed during the matching process until a successful match is found is ____.",
184 | "A": "9",
185 | "B": "10",
186 | "C": "12",
187 | "D": "15",
188 | "category": 1,
189 | "id": 20
190 | },
191 | {
192 | "question": "For a tree with n nodes and a degree of 4,____",
193 | "A": "The height of the tree is at most n-3.",
194 | "B": "The height of the tree is at most n-4.",
195 | "C": "There are at most 4(i-1) nodes on the i-th level.",
196 | "D": "There is at least one level with exactly 4 nodes.",
197 | "category": 1,
198 | "id": 21
199 | },
200 | {
201 | "question": "In a tree T with a degree of 4, if there are 20 nodes with a degree of 4, 10 nodes with a degree of 3, 1 node with a degree of 2, and 10 nodes with a degree of 1, the number of leaf nodes in tree T is ____",
202 | "A": "41",
203 | "B": "82",
204 | "C": "113",
205 | "D": "122",
206 | "category": 1,
207 | "id": 22
208 | },
209 | {
210 | "question": "The correct statement among the following is____",
211 | "A": "In a complete binary tree, the left sibling (if exists) of a leaf node is always not a leaf node.",
212 | "B": "For any binary tree, the number of leaf nodes is equal to the number of nodes with degree 2 minus 1, that is n0=n2-1.",
213 | "C": "Complete binary trees are not suitable for sequential storage structure, only full binary trees are suitable for sequential storage structure.",
214 | "D": "In a binary tree with nodes numbered in a complete binary tree sequence, the left child of the i-th node is numbered 2i",
215 | "category": 0,
216 | "id": 23
217 | },
218 | {
219 | "question": "The height h of a binary tree with 1025 nodes is____",
220 | "A": "11",
221 | "B": "10",
222 | "C": "11~1025",
223 | "D": "10~1024",
224 | "category": 1,
225 | "id": 24
226 | },
227 | {
228 | "question": "A complete binary tree with 124 leaf nodes can have a maximum of ____ nodes.",
229 | "A": "247",
230 | "B": "248",
231 | "C": "249",
232 | "D": "250",
233 | "category": 1,
234 | "id": 25
235 | },
236 | {
237 | "question": "A disconnected undirected graph with 28 edges has at least ____ vertices.",
238 | "A": "7",
239 | "B": "8",
240 | "C": "9",
241 | "D": "10",
242 | "category": 1,
243 | "id": 26
244 | },
245 | {
246 | "question": "For a graph with n vertices: if it is a connected undirected graph, the minimum number of edges is ____; if it is a strongly connected directed graph, the minimum number of edges is ____.",
247 | "A": "n-1, n",
248 | "B": "n-1, n(n-1)",
249 | "C": "n, n",
250 | "D": "n, n(n-1)",
251 | "category": 1,
252 | "id": 27
253 | },
254 | {
255 | "question": "If a undirected graph G = (V, E) contains 7 vertices and needs to be connected in any scenario, the minimum number of edges required is ______",
256 | "A": "6",
257 | "B": "15",
258 | "C": "16",
259 | "D": "21",
260 | "category": 1,
261 | "id": 28
262 | },
263 | {
264 | "question": "The given undirected graph G has 16 edges, with 3 vertices having a degree of 4 and 4 vertices having a degree of 3, and the degrees of all other vertices are less than 3. The minimum number of vertices in graph G is at least ____.",
265 | "A": "10",
266 | "B": "11",
267 | "C": "13",
268 | "D": "15",
269 | "category": 1,
270 | "id": 29
271 | },
272 | {
273 | "question": "If a sorted list L with a length of 16 is used, and the binary search method is used to search for an element that does not exist in L, the maximum number of key comparisons is ____.",
274 | "A": "4",
275 | "B": "5",
276 | "C": "6",
277 | "D": "7",
278 | "category": 1,
279 | "id": 30
280 | },
281 | {
282 | "question": "Construct binary search trees with the following sequences, the result that is different from the result constructed with the other 3 sequences is:",
283 | "A": "(100,80,90,60,120,110,130)",
284 | "B": "(100,120,110,130,80,60,90)",
285 | "C": "(100,60,80,90,120,110,130)",
286 | "D": "(100,80,60,90,120,130,110)",
287 | "category": 1,
288 | "id": 31
289 | },
290 | {
291 | "question": "When searching for a node with a certain key in a binary search tree with n nodes, the maximum number of comparisons made is ____.",
292 | "A": "n/2",
293 | "B": "log2n",
294 | "C": "log2n+1",
295 | "D": "n",
296 | "category": 1,
297 | "id": 32
298 | },
299 | {
300 | "question": "Which of the following keyword sequences cannot form a search path in a binary search tree?",
301 | "A": "95,22,91,24,94,71",
302 | "B": "92,20,91,34,88,35",
303 | "C": "21,89,77,29,36,38",
304 | "D": "12,25,71,68,33,34",
305 | "category": 1,
306 | "id": 33
307 | },
308 | {
309 | "question": "There is a balanced binary tree (AVL) without repeated keywords, and a sequence in descending order can be obtained by inorder traversal. Which of the following statements about the balanced binary tree is correct ____",
310 | "A": "The degree of the root node is always 2.",
311 | "B": "The smallest element in the tree is always a leaf node.",
312 | "C": "The last inserted element is always a leaf node.",
313 | "D": "The largest element in the tree always has no left subtree.",
314 | "category": 1,
315 | "id": 34
316 | },
317 | {
318 | "question": "What is the value of the expression ++a||-b&&++c if a=1, b=2, and c=3?",
319 | "A": "0",
320 | "B": "1",
321 | "C": "2",
322 | "D": "3",
323 | "category": 2,
324 | "id": 35
325 | },
326 | {
327 | "question": "Which of the following expressions is correct?",
328 | "A": "++(a++)",
329 | "B": "a++b",
330 | "C": "a+++b",
331 | "D": " a++++b",
332 | "category": 0,
333 | "id": 36
334 | },
335 | {
336 | "question": "The purpose of using the break statement in a loop statement is to ____.",
337 | "A": "end the current iteration of the loop",
338 | "B": "end the current loop",
339 | "C": "end all loops",
340 | "D": "end the execution of the program",
341 | "category": 0,
342 | "id": 37
343 | },
344 | {
345 | "question": "The correct expression that represents when i is not equal to 0 is_____",
346 | "A": "i",
347 | "B": "!i",
348 | "C": "i<>0",
349 | "D": "i=0",
350 | "category": 0,
351 | "id": 38
352 | },
353 | {
354 | "question": "The number of times the following loop statement is executed is ____. while (!1) cout << \"ok!\";",
355 | "A": "0 times",
356 | "B": "1 time",
357 | "C": "2 times",
358 | "D": "infinite times",
359 | "category": 2,
360 | "id": 39
361 | },
362 | {
363 | "question": "In C++, the correct statement about array subscripts is____",
364 | "A": "The number of values used to initialize an array can be greater than the number of elements defined in the array, and the excess will be ignored.",
365 | "B": "The number of values used to initialize an array can be less than the number of elements defined in the array.",
366 | "C": "The number of values used to initialize an array must be equal to the number of elements defined in the array.",
367 | "D": "The value of the initialization array can be omitted by skipping commas. For example, int a [3]={1,2};",
368 | "category": 0,
369 | "id": 40
370 | },
371 | {
372 | "question": "If the array is defined as int a[2][2]={1,2,3,4}; then a[1][0]%3 is ____",
373 | "A": "0",
374 | "B": "1",
375 | "C": "2",
376 | "D": "4",
377 | "category": 1,
378 | "id": 41
379 | },
380 | {
381 | "question": "Given the array definition: `int a[][2]={5,6,1,2,3,8};`, what can be used to calculate the array index?",
382 | "A": "sizeofA:/sizeof(int)",
383 | "B": "sizeof(a[])/sizeof(3)",
384 | "C": "sizeof(a[][2])/sizeof(int)",
385 | "D": "sizeofA:/sizeof(a[2][1])",
386 | "category": 1,
387 | "id": 42
388 | },
389 | {
390 | "question": "The correct statement among the following is ____",
391 | "A": "In a C++ program, the main() function must come before other functions, and functions can be defined within other functions.",
392 | "B": "In a C++ program, there is no restriction on the position of the main() function, and functions cannot be defined within other functions.",
393 | "C": "In a C++ program, the main() function must come before other functions, and functions cannot be defined within other functions.",
394 | "D": "In a C++ language program, the main() function must be after other functions, and functions can be nested within a function.",
395 | "category": 0,
396 | "id": 43
397 | },
398 | {
399 | "question": "The incorrect statement about the return statement is ____",
400 | "A": "There may or may not be a return statement in a function definition.",
401 | "B": "There can be multiple return statements in a function definition.",
402 | "C": "Each return statement in a function definition may return multiple values.",
403 | "D": "If the function type is not void, there must be a return statement in the function definition.",
404 | "category": 0,
405 | "id": 44
406 | },
407 | {
408 | "question": "The return value type of a function in the C++ language is determined by ______.",
409 | "A": "the expression type in the return statement",
410 | "B": "the type of the calling function",
411 | "C": "the function type specified when defining the function",
412 | "D": "None of the above statements are correct",
413 | "category": 0,
414 | "id": 45
415 | },
416 | {
417 | "question": "The correct description about default values for parameters in C++ is:",
418 | "A": "Default values for parameters can only be set during function definition.",
419 | "B": "When setting default values for parameters, they should be set from right to left.",
420 | "C": "When setting default values for parameters, all parameters should be set.",
421 | "D": "After setting default values for parameters, the function cannot assign values to the parameters when called.",
422 | "category": 0,
423 | "id": 46
424 | },
425 | {
426 | "question": "The purpose of using overloaded functions in programming is to____",
427 | "A": "Use the same function name to call functions with similar functionality but different parameters",
428 | "B": "Share program code",
429 | "C": "Improve the program's running speed",
430 | "D": "Save storage space",
431 | "category": 0,
432 | "id": 47
433 | },
434 | {
435 | "question": "When calling an overloaded function, the following option cannot be used as the basis for determining which overloaded function to call:",
436 | "A": "Function name",
437 | "B": "Number of parameters",
438 | "C": "Function type",
439 | "D": "Parameter type",
440 | "category": 0,
441 | "id": 48
442 | },
443 | {
444 | "question": "When an array is used as a formal parameter of a function and the array name is used as an actual argument of the function, the value passed to the function is the ____.",
445 | "A": "values of each element in the array",
446 | "B": "number of elements in the array",
447 | "C": "value of the first element in the array",
448 | "D": "memory address of the array",
449 | "category": 0,
450 | "id": 49
451 | },
452 | {
453 | "question": "To make the variable i an alias for the int variable x, the correct definition statement is____",
454 | "A": "int &i=x;",
455 | "B": "int i=&x;",
456 | "C": "int &i=&x;",
457 | "D": "int i=x;",
458 | "category": 2,
459 | "id": 50
460 | },
461 | {
462 | "question": "Which of the following pointer expressions is not equivalent to accessing a[i][j] with subscripts?",
463 | "A": "*(a+i+j)",
464 | "B": "(*(a+i))[j]",
465 | "C": "*(*(a+i)+j)",
466 | "D": "*(a[i]+j)",
467 | "category": 2,
468 | "id": 51
469 | },
470 | {
471 | "question": "Which of the following expressions cannot represent the address of str[1] if the string char str[5] is defined as:",
472 | "A": "str+1",
473 | "B": "str++",
474 | "C": "&str[0]+1",
475 | "D": "&str[1]",
476 | "category": 2,
477 | "id": 52
478 | },
479 | {
480 | "question": "Given: ```int a[]={1,2,3,4,5,6},*p=a,x\uff1b```\n\nThe statement in which the value of x is 5 is ____\n",
481 | "A": "p+=3;x=*(p++);",
482 | "B": "p+=5;x=*p++;",
483 | "C": "p+=4;x=*++p;",
484 | "D": "p+=4; x=*p++;",
485 | "category": 2,
486 | "id": 53
487 | },
488 | {
489 | "question": "If there is an explanation: int i, j = 6, *p; p = &i; then the statement equivalent to i = j is ____",
490 | "A": "i = *p;",
491 | "B": "*p = *&j;",
492 | "C": "i = &j;",
493 | "D": "i = **p;",
494 | "category": 2,
495 | "id": 54
496 | },
497 | {
498 | "question": "Which of the following statements cannot be executed correctly if p1 and p2 are pointer variables pointing to the same one-dimensional array of type int, and k is a variable of type int?",
499 | "A": "k=*p1+*p2",
500 | "B": "p2=k",
501 | "C": "p1=p2",
502 | "D": "k=*p1*(*p2);",
503 | "category": 2,
504 | "id": 55
505 | },
506 | {
507 | "question": "After executing the program segment, the value of m is ____.\n```int a[2][3]={{1,2,3},{4,5,6}};int m,*p=&a[0][0];m=(*p)*(*(p+2))*(*(p+4));```",
508 | "A": "15",
509 | "B": "14",
510 | "C": "13",
511 | "D": "12",
512 | "category": 2,
513 | "id": 56
514 | },
515 | {
516 | "question": "Has the following definition, and the correct description of ptr is ____. n ` ` int (* ptr) (); ` ` `\n ",
517 | "A": "ptr is a pointer variable pointing to a one-dimensional array.\n",
518 | "B": "ptr is a 1-pointer variable pointing to int data.\n",
519 | "C": "ptr is a pointer to a function that returns an int data.\n",
520 | "D": "ptr is a function name whose return value is a pointer to int data.",
521 | "category": 2,
522 | "id": 57
523 | },
524 | {
525 | "question": "Which of the following options is not a legal integer constant?\n",
526 | "A": "288",
527 | "B": "288L",
528 | "C": "0288",
529 | "D": "0x288",
530 | "category": 1,
531 | "id": 58
532 | },
533 | {
534 | "question": "The number of iterations for the loop statement ```for (k = 5; k = 0; --k);``` is____.",
535 | "A": "0",
536 | "B": "5",
537 | "C": "6",
538 | "D": "infinite",
539 | "category": 2,
540 | "id": 59
541 | },
542 | {
543 | "question": "What is the number of times the constructor of A is called when calling f(b[1], b, 2, b[0])?",
544 | "A": "1",
545 | "B": "2",
546 | "C": "3",
547 | "D": "4",
548 | "category": 1,
549 | "id": 60
550 | },
551 | {
552 | "question": "If there are definitions: ```char *p = \"h12\\0ab\", str[] = \"h12\\0ab\";```, the values of sizeof(p), sizeof(str), and strlen(p) are____",
553 | "A": "4, 4, 3",
554 | "B": "7, 7, 7",
555 | "C": "4, 8, 7",
556 | "D": "4, 7, 3",
557 | "category": 2,
558 | "id": 61
559 | },
560 | {
561 | "question": "The invalid overloaded operator function name among the following options is ____",
562 | "A": "operator!",
563 | "B": "operator()",
564 | "C": "operator@",
565 | "D": "operator!=",
566 | "category": 2,
567 | "id": 62
568 | },
569 | {
570 | "question": "If m=1, n=1, what are the values of m and n after executing the expression (m--) || (n *= m)?",
571 | "A": "1, 0",
572 | "B": "1, 1",
573 | "C": "0, 0",
574 | "D": "0, 1",
575 | "category": 2,
576 | "id": 63
577 | },
578 | {
579 | "question": "The correct prototype for the copy constructor of class A is ______",
580 | "A": "A(A &other)",
581 | "B": "A(const A &other)",
582 | "C": "A(A other)",
583 | "D": "void A(A &other)",
584 | "category": 2,
585 | "id": 64
586 | },
587 | {
588 | "question": "Which of the following options is an illegal character constant?",
589 | "A": "'d'",
590 | "B": "'t'",
591 | "C": "'\\123'",
592 | "D": "'\\'",
593 | "category": 0,
594 | "id": 65
595 | },
596 | {
597 | "question": "The decimal value of the integer constant 0101 in C++ is ____",
598 | "A": "5",
599 | "B": "101",
600 | "C": "65",
601 | "D": "4097",
602 | "category": 0,
603 | "id": 66
604 | },
605 | {
606 | "question": "The output of the statement cout << \"abc0\\0def\" is____",
607 | "A": "abc0\\0def\\",
608 | "B": "abc0\\0def",
609 | "C": "abc",
610 | "D": "abc0",
611 | "category": 1,
612 | "id": 67
613 | },
614 | {
615 | "question": "If there is a function f(const A &x, A &y), and there is a definition A b(2), what is the number of times the constructor of A is called when f(4, b) is called?",
616 | "A": "Illegal call, compilation error",
617 | "B": "0",
618 | "C": "1",
619 | "D": "2",
620 | "category": 1,
621 | "id": 68
622 | },
623 | {
624 | "question": "When executing the following statement, the number of lines of output is:____\nint s = 1;while (s < 10) {s *= 2;if (s % 4 != 0) continue;cout << s << endl;}",
625 | "A": "1",
626 | "B": "2",
627 | "C": "3",
628 | "D": "4",
629 | "category": 2,
630 | "id": 69
631 | },
632 | {
633 | "question": "If there is a statement \"int *p = NULL; cout << p << ' ' << *p;\", the result is ____",
634 | "A": "The address of p is NULL",
635 | "B": "The address of p is 0",
636 | "C": "0 0",
637 | "D": "Runtime error",
638 | "category": 2,
639 | "id": 70
640 | },
641 | {
642 | "question": "If there is a definition: char str[] = {'h', '1', '2', '\\0', 'a', 'b'}; then the values of sizeof(str) and strlen(str) are____",
643 | "A": "7, 3",
644 | "B": "7, 7",
645 | "C": "6, 3",
646 | "D": "6, 6",
647 | "category": 2,
648 | "id": 71
649 | },
650 | {
651 | "question": "Which of the following operators can be overloaded as both a member function and a friend function of a class?",
652 | "A": "<<",
653 | "B": "+=",
654 | "C": "=",
655 | "D": "()",
656 | "category": 0,
657 | "id": 72
658 | },
659 | {
660 | "question": "The statement that cannot output the ASCII code of ch is ____.",
661 | "A": "cout << (int)ch;",
662 | "B": "cout << int(ch);",
663 | "C": "cout << ch;",
664 | "D": "cout << (x = ch);",
665 | "category": 2,
666 | "id": 73
667 | },
668 | {
669 | "question": "If the following definitions exist, which of the following is an incorrect reference to the member of an array element?\n\nstruct Student{int id; char *name; Student(int len = 10) {name = new char[len];} };Student stu [2],*p; p=stu;",
670 | "A": "p[1].id",
671 | "B": "p->id",
672 | "C": "(*p).name",
673 | "D": "*p.name",
674 | "category": 2,
675 | "id": 74
676 | },
677 | {
678 | "question": "If the * operator of class X is overloaded as a friend function to multiply two objects of class X and return the result of the multiplication, the declaration statement of this function is ____",
679 | "A": "X operator*(const X & a , const X & b);",
680 | "B": "X operator*(const X & a) const;",
681 | "C": "X & operator*(const X & a , const X & b);",
682 | "D": "X & operator*( const X & a) const;",
683 | "category": 2,
684 | "id": 75
685 | },
686 | {
687 | "question": "The expression to determine if the content of the character type variable ch is a numeric character is____",
688 | "A": "'0'<= ch <= '9'",
689 | "B": "(ch >= '0') && (ch <= '9')",
690 | "C": "(ch >='0') || (ch <= '9')",
691 | "D": "(ch >= 0) && ( ch <= 9)",
692 | "category": 2,
693 | "id": 76
694 | },
695 | {
696 | "question": "Which of the following statements, if executed immediately after the definition \"char *s;\", will not cause a runtime error?",
697 | "A": "s ={\"SJTU\"};",
698 | "B": "s =\"SJTU\";",
699 | "C": "strcpy(s, \"SJTU\");",
700 | "D": "s[0] = 'S';",
701 | "category": 2,
702 | "id": 77
703 | },
704 | {
705 | "question": "Which of the following statements about function definitions is incorrect?",
706 | "A": "A program cannot have functions with the same name.",
707 | "B": "Functions of void type can also use the return statement.",
708 | "C": "The number of actual arguments in a function call can be less than the number of formal parameters.",
709 | "D": "The type of the expression after return must match the return type of the function.",
710 | "category": 0,
711 | "id": 78
712 | },
713 | {
714 | "question": "The incorrect statement about static member functions of a class is:",
715 | "A": "Can only access static members",
716 | "B": "Does not have a this pointer",
717 | "C": "Can only be accessed through \"ClassName::functionName\"",
718 | "D": "Function definition must be written in the class",
719 | "category": 0,
720 | "id": 79
721 | },
722 | {
723 | "question": "To define a global variable that is specific to the source file and not allowed to be shared by other source files, a qualifier needs to be added before defining the global variable in the file.____",
724 | "A": "auto",
725 | "B": "extern",
726 | "C": "static",
727 | "D": "register",
728 | "category": 0,
729 | "id": 80
730 | },
731 | {
732 | "question": "Which of the following definitions is illegal?",
733 | "A": "const int a = 10, *p = &a;",
734 | "B": "int b; const int &a = b;",
735 | "C": "const int a = 10 , &b = a;",
736 | "D": "const int a = 10; int *p = &a;",
737 | "category": 2,
738 | "id": 81
739 | },
740 | {
741 | "question": "When using the ifstream stream to define a stream object and open a disk file, the implicit open mode of the file is ______",
742 | "A": "ios::in",
743 | "B": "ios::out",
744 | "C": "ios::in|ios::out",
745 | "D": "ios::binary",
746 | "category": 0,
747 | "id": 82
748 | },
749 | {
750 | "question": "Class B inherits from Class A and has a definition: A * pa; B * pb; The incorrect usage below is ____",
751 | "A": "'pa=pb;",
752 | "B": "pb=pa;",
753 | "C": "pa=(A *) pb;",
754 | "D": "pb=(B *) pa",
755 | "category": 2,
756 | "id": 83
757 | },
758 | {
759 | "question": "Which of the following definitions is correct for the given class template template obj;",
761 | "B": "foo obj;",
762 | "C": "foo obj;",
763 | "D": "foo obj;",
764 | "category": 2,
765 | "id": 84
766 | },
767 | {
768 | "question": "The following are not object-oriented features: ____ ",
769 | "A": "polymorphism",
770 | "B": "inheritance",
771 | "C": "generics",
772 | "D": "recursion",
773 | "category": 0,
774 | "id": 85
775 | },
776 | {
777 | "question": "What is the decimal representation of the result value of 10010100 + 00101111 in a computer system where integers are represented in 8-bit two's complement? ",
778 | "A": "195",
779 | "B": "-67",
780 | "C": "-61",
781 | "D": "67",
782 | "category": 1,
783 | "id": 86
784 | },
785 | {
786 | "question": "If the internal code of letter A is 65, the correct output of the statement cout << 'A' + 1; is ______",
787 | "A": "'A' + 1",
788 | "B": "66",
789 | "C": "066",
790 | "D": "B",
791 | "category": 1,
792 | "id": 87
793 | },
794 | {
795 | "question": "If there is a function f(A &x, const A &y), and there is a definition A b(2), what is the number of times the constructor of A is called when calling f(4, b)?",
796 | "A": "Illegal call, compilation error",
797 | "B": "0",
798 | "C": "1",
799 | "D": "2",
800 | "category": 1,
801 | "id": 88
802 | },
803 | {
804 | "question": "When executing the following statement, the number of lines of output is____\nint s = 1;while (s < 5) {if (++s = 4 ) break;cout << s << endl;}",
805 | "A": "0",
806 | "B": "1",
807 | "C": "3",
808 | "D": "4",
809 | "category": 2,
810 | "id": 89
811 | },
812 | {
813 | "question": "The number of times the destructor of A is executed in the given statement block {A * p1 = new A; auto_ptr p2( new A); shared_ptr p3( new A), p4 = p3; } is ____.",
814 | "A": "0",
815 | "B": "1",
816 | "C": "2",
817 | "D": "3",
818 | "category": 2,
819 | "id": 90
820 | },
821 | {
822 | "question": "In the program, when performing 1 + object a of class A, and class A has a constructor that requires an integer parameter, which of the following options is not feasible?",
823 | "A": "Define a type conversion function in class A that converts to an integer.",
824 | "B": "Add a type conversion function in class A that converts to a floating-point number.",
825 | "C": "Add a member function in class A that overloads +.",
826 | "D": "Add a friend function in class A that overloads +.",
827 | "category": 0,
828 | "id": 91
829 | },
830 | {
831 | "question": "Has class A {...}; class B: public A {...}; and has a definition: A * p=new B;, the legal ones in the following statements are ____",
832 | "A": "B * q=p;",
833 | "B": "B b=* p;",
834 | "C": "B&b=* p;",
835 | "D": "A&a=* p;",
836 | "category": 2,
837 | "id": 92
838 | },
839 | {
840 | "question": "If there is the following definition: const char *str[4] = {\"aaa\", \"bbb\", \"ccc\", \"ddd\"}, the statement that cannot correctly output the 4 strings is____",
841 | "A": "for (int i = 0; i <4; ++ i) cout << str[i] << endl;",
842 | "B": "for (int i = 0; i <4; ++ i) cout << *(str + i) << endl;",
843 | "C": "for (const char **p = str; p < str + 4; ++ p) cout < p < endl;",
844 | "D": "for (const char **p = str; p < str + 4; ++ p) cout < < *p < < endl;",
845 | "category": 2,
846 | "id": 93
847 | },
848 | {
849 | "question": "Which of the following operator overload functions in class X has a wrong prototype?",
850 | "A": "X &operator=(const X & a);",
851 | "B": "X &operator=( X && a);",
852 | "C": "X & operator+=( const X & a);",
853 | "D": "X & operator+=( X & a);",
854 | "category": 2,
855 | "id": 94
856 | },
857 | {
858 | "question": "The expression that correctly determines whether the content of the variable ch is a numeric character is:",
859 | "A": "((ch >= '0') + (ch <= '9')) == 2",
860 | "B": "(ch >= '0') && (ch <= '9')",
861 | "C": "!((ch <'0') || (ch > '9'))",
862 | "D": "!((ch <='0') || (ch > ='9'))",
863 | "category": 2,
864 | "id": 95
865 | },
866 | {
867 | "question": "If there is a definition: char str1[5]; const char *p = \"abc\"; the incorrect statement is ____",
868 | "A": "p = \"def\";",
869 | "B": "strcpy(p, str1)",
870 | "C": "p = str1;",
871 | "D": "strcpy(str1,p);",
872 | "category": 2,
873 | "id": 96
874 | },
875 | {
876 | "question": "If there is a function void f(A r1, const A &r2, A &r3), and A x1(2), x2(4); then the number of times A's constructor (including copy constructor) is called when calling the function f(x1, 5, x2) is ___.",
877 | "A": "0",
878 | "B": "1",
879 | "C": "2",
880 | "D": "3",
881 | "category": 1,
882 | "id": 97
883 | },
884 | {
885 | "question": "The incorrect statement about constant data members of a class is ______",
886 | "A": "The initial value must be assigned during object construction.",
887 | "B": "Any member function other than the constructor cannot modify the value of constant data members.",
888 | "C": "Non-const member functions cannot access constant data members.",
889 | "D": "Different objects have different constant data member values.",
890 | "category": 0,
891 | "id": 98
892 | },
893 | {
894 | "question": "If you want the local variables in a function to still exist after the function execution, you need to add the qualifier ____ before defining the variable.",
895 | "A": "auto",
896 | "B": "extern",
897 | "C": "static",
898 | "D": "register",
899 | "category": 0,
900 | "id": 99
901 | },
902 | {
903 | "question": "If there is a function f (int * a, const int&b, int&c) and the definitions int m; and const int n=9;, the following legal function calls are ____ ",
904 | "A": "f ((&m, 5, 5) ",
905 | "B": "f (&m, 5, m) ",
906 | "C": "f (&n, n, n) ",
907 | "D": "f (m, m, n);",
908 | "category": 2,
909 | "id": 100
910 | },
911 | {
912 | "question": "Which of the following file stream objects cannot read a file?",
913 | "A": "fstream obj(\"ff\"); ",
914 | "B": "fstream obj(\"\"ff\", ios::binary)",
915 | "C": "fstream obj(\"ff\", ios::in | ios::out)",
916 | "D": "fstream obj(\"ff\", ios::in | ios::app)",
917 | "category": 2,
918 | "id": 101
919 | },
920 | {
921 | "question": "Which of the following statements cannot call the derived class's display function when there are definitions: class A {public: virtual void display(); }; class B:public A { public: virtual void display();}; and B b;?",
922 | "A": "A *p = &b; p->display();",
923 | "B": "b.diaplay()",
924 | "C": "A a = b; a.display()",
925 | "D": "A &a = b; a.display()",
926 | "category": 2,
927 | "id": 102
928 | },
929 | {
930 | "question": "Assuming A is a class name, which of the following is incorrect in the exception handling?",
931 | "A": "catch (\u2026);",
932 | "B": "catch(int);",
933 | "C": "catch (A x);",
934 | "D": "catch (int 5);",
935 | "category": 2,
936 | "id": 103
937 | },
938 | {
939 | "question": "The statement that is incorrect is ____",
940 | "A": "Polymorphism provides convenience for the extension of software systems.",
941 | "B": "Inheritance is a means of code reuse and the foundation of runtime polymorphism.",
942 | "C": "Derived classes cannot be abstract classes.",
943 | "D": "Friend functions are global functions that are allowed to access private members of objects.",
944 | "category": 0,
945 | "id": 104
946 | },
947 | {
948 | "question": "What is the decimal number corresponding to the integer constant 011?",
949 | "A": "3",
950 | "B": "9",
951 | "C": "11",
952 | "D": "17",
953 | "category": 1,
954 | "id": 105
955 | },
956 | {
957 | "question": "In a certain computer system, where int is represented by 2 bytes, if int a is defined as -1, the output of cout << hex << a; is____",
958 | "A": "-1",
959 | "B": "\u20130x1",
960 | "C": "FFFF",
961 | "D": "65535",
962 | "category": 1,
963 | "id": 106
964 | },
965 | {
966 | "question": "If there is a definition: int a = 5; decltype(a+0.5) b; then the type and initial value of b are ____.",
967 | "A": "int 5",
968 | "B": "double 5.5",
969 | "C": "int random value",
970 | "D": "double random value",
971 | "category": 2,
972 | "id": 107
973 | },
974 | {
975 | "question": "If there is a definition: int a[] = {1,2,3,4,5}, len = 2; After executing the expression a[len++]=0, the values of array a and len respectively are ______",
976 | "A": "1,2,0,4,5 and 2",
977 | "B": "1,2,0,3,5 and 3",
978 | "C": "1,2,3,0,5 and 3",
979 | "D": "1,0,2,3,5and3",
980 | "category": 2,
981 | "id": 108
982 | },
983 | {
984 | "question": "If there is a definition: char ch; Which of the following expressions does not conform to the syntax of the C++ language?",
985 | "A": "ch = 100",
986 | "B": "ch = 'a' + 6",
987 | "C": "ch = '''",
988 | "D": "ch = '\\'",
989 | "category": 2,
990 | "id": 109
991 | },
992 | {
993 | "question": "If m = 1, n = 0, then the values of m and n after executing the expression (m *= 2) || (n = m++) are____",
994 | "A": "2 0",
995 | "B": "2 2",
996 | "C": "3 2",
997 | "D": "3 3",
998 | "category": 2,
999 | "id": 110
1000 | },
1001 | {
1002 | "question": "After executing the following loop, the value of s is ____.\ns = 0; for (k = 1; k <= 100; ++k) if (k % 5) continue; else ++s;",
1003 | "A": "100",
1004 | "B": "90",
1005 | "C": "80",
1006 | "D": "20",
1007 | "category": 2,
1008 | "id": 111
1009 | },
1010 | {
1011 | "question": "The statement that cannot output \"abcd\" if the internal code of the letter 'a' is 97 is ______",
1012 | "A": "for (auto ch = 'a'; ch <='d'; ++ch) cout <display() respectively call ____.",
1102 | "A": "A class's display() A class's display()",
1103 | "B": "B class's display() B class's display()",
1104 | "C": "A class's display() B class's display()",
1105 | "D": "B class's",
1106 | "category": 2,
1107 | "id": 122
1108 | },
1109 | {
1110 | "question": "The prototype of the move constructor for class A is ____",
1111 | "A": "A( A other);",
1112 | "B": "A( const A & other);",
1113 | "C": "A( A &&other);",
1114 | "D": "A( A &other);",
1115 | "category": 0,
1116 | "id": 123
1117 | },
1118 | {
1119 | "question": "has the following definition statement: int a []={1,2,3,4,5};, then statement int * p=a; the correct description is ____",
1120 | "A": "statement int * p=a; incorrect definition",
1121 | "B": "statement int * p=a; initializes variable p to point to the first element of array object a",
1122 | "C": "statement int * p=a; assigns all element values of array a to variable p",
1123 | "D": "statement int * p=a; assigns the value of a [0] to variable p",
1124 | "category": 2,
1125 | "id": 124
1126 | },
1127 | {
1128 | "question": "What is the correct description of a red black tree with node numbers greater than or equal to 3____",
1129 | "A": "The degree of the root node is always 2.",
1130 | "B": "The last inserted element is always a leaf node.",
1131 | "C": "The minimum element always has no left child.",
1132 | "D": "The last inserted element is always a red node.",
1133 | "category": 0,
1134 | "id": 125
1135 | },
1136 | {
1137 | "question": "The algorithm in the following sorting algorithms that has time complexity independent of the initial arrangement of the data is ____",
1138 | "A": "Insertion sort",
1139 | "B": "Heap sort",
1140 | "C": "Bubble sort",
1141 | "D": "Merge sort",
1142 | "category": 0,
1143 | "id": 126
1144 | },
1145 | {
1146 | "question": "Which of the following infix expressions can be converted to postfix expressions using an operator stack with a capacity of 4?",
1147 | "A": "(1 + 2)* (6 / 2 -1)",
1148 | "B": "1+2 * 3 ^ (5+2) / 4 +6",
1149 | "C": "1+ 2 * (3 -8 / 2) *3",
1150 | "D": " (2* 3) ^ 2 ^ 3 / 4",
1151 | "category": 2,
1152 | "id": 127
1153 | },
1154 | {
1155 | "question": "If the push sequence is SJTU, which of the following sequences could be the pop sequence?",
1156 | "A": "SJTU",
1157 | "B": "UJTS",
1158 | "C": "STJU",
1159 | "D": "JTSU",
1160 | "category": 1,
1161 | "id": 128
1162 | },
1163 | {
1164 | "question": "The valid topological sequences in the following figure are:",
1165 | "A": "ABCDEFG",
1166 | "B": "ABDCFEG",
1167 | "C": "ABCEFDG",
1168 | "D": "ABDECFG",
1169 | "category": 1,
1170 | "id": 129
1171 | },
1172 | {
1173 | "question": "To make the preorder sequence of a non-empty binary tree the same as the inorder sequence, the condition that all non-leaf nodes must satisfy is ____.",
1174 | "A": "Only have a left subtree",
1175 | "B": "Only have a right subtree",
1176 | "C": "The degree of the nodes is both 12",
1177 | "D": "The degree of the nodes is both 2",
1178 | "category": 1,
1179 | "id": 130
1180 | },
1181 | {
1182 | "question": "There are train tracks as shown in the following figure, with 3 tracks between the entrance and exit. The direction of train travel is from left to right, and trains can enter any track. There are currently 9 trains numbered 1-9, and the entry sequence is disorderly (for example, 5 represents the most advanced station, followed by 1, 3, 4,..., and finally 7) . If the expected sequence of departure is 1-9, which of the following entry sequences can complete the reorganization is ____ ",
1183 | "A": "1, 3, 2, 4, 5, 6, 8, 7, 9",
1184 | "B": "5, 2, 8, 6, 1, 7, 9, 4, 3",
1185 | "C": "5, 2, 8, 6, 1, 7, 9, 4, 3",
1186 | "D": "9, 2, 1, 5, 8, 4, 3, 6, 7",
1187 | "category": 1,
1188 | "id": 131
1189 | },
1190 | {
1191 | "question": "The pre-order traversal sequence of an expression tree is: * + / 3 2 8 - 7 1, the in-order traversal sequence is: 3 / 2 + 8 * 7 - 1, the correct description is ____",
1192 | "A": "The corresponding infix expression is 3 / 2 + 8 * 7 - 1.",
1193 | "B": "The corresponding infix expression is (3 / 2 + 8 * 7 - 1).",
1194 | "C": "The corresponding postfix expression is * + / 3 2 8 - 7 1.",
1195 | "D": "The corresponding postfix expression is 3 2 / 8 + 7 1 - *.",
1196 | "category": 2,
1197 | "id": 132
1198 | },
1199 | {
1200 | "question": "Given that the preorder traversal sequence of a binary tree is ABCD and the postorder traversal sequence is CDBA, then the impossible inorder traversal sequence is ____",
1201 | "A": "CBDA",
1202 | "B": "ACBD",
1203 | "C": "ACBD",
1204 | "D": "ADCB",
1205 | "category": 1,
1206 | "id": 133
1207 | },
1208 | {
1209 | "question": "The correct translation is:",
1210 | "A": "p->prev->next = p->next; p->next->prev = p->prev; delete p;",
1211 | "B": "q = p; delete p; q->prev->next = q->next; q->next->prev = q->prev;",
1212 | "C": "q1 = delete p; p->prev; q2 = p->next; q1->next = q2; q2->prev = q1;",
1213 | "D": "q1 = p->prev; q2 = q1->next; delete p; q1->next = q2; q2->prev = q1;",
1214 | "category": 2,
1215 | "id": 134
1216 | },
1217 | {
1218 | "question": "If the original arrangement of the data is very close to the sorted state, you can choose ____",
1219 | "A": "Insertion sort",
1220 | "B": "Selection sort",
1221 | "C": "Monkey sort",
1222 | "D": "Quick sort",
1223 | "category": 0,
1224 | "id": 135
1225 | },
1226 | {
1227 | "question": "Which of the following is not a possible Huffman coding for 5 elements?",
1228 | "A": "000, 0010, 1100, 1010, 1111",
1229 | "B": "00, 01, 100, 101, 1",
1230 | "C": "00, 01, 100, 101, 11",
1231 | "D": "0, 10, 1100, 1101, 111",
1232 | "category": 1,
1233 | "id": 136
1234 | },
1235 | {
1236 | "question": "Add an iterator to a doubly linked list class. The data members of the iterator are pointers to the nodes of the doubly linked list cur. Insert an element x at the position pointed to by the iterator itr. After insertion, the iterator points to the newly inserted node. The constructor prototype of the node class node is node (node * pre v, int x, node * next). Assuming that all data members are public, the legal option below is (constructor) ____",
1237 | "A": "itr, cur=new node (itr. cur ->prev, x, itr. cur ->next); Itr. cur ->prev ->next=itr. cur ->ext ->prev=itr. cur;",
1238 | "B": "itr. cur ->prev ->next=itr. cur ->prev=new node (itr. cur ->prev, x, itr. cur ->next); Itr. cur=itr. cur ->prev;",
1239 | "C": "itr. cur ->prev ->next=itr. cur ->prev=new node (itr. cur ->prev, x, itr. cur -); Itr. cur=itr. cur ->prev;",
1240 | "D": "itr. cur ->prev=itr. cur ->prev ->next=new node (itr. cur ->prev, x, itr. cur -); Itr. cur=itr. cur ->prev;",
1241 | "category": 2,
1242 | "id": 137
1243 | },
1244 | {
1245 | "question": "Enter data 1, 2, 3, 4, 5, and 6 into a FIFO queue in sequence. During the insertion process, there may be some out of queue operations, and ultimately all elements need to be out of queue. The possible exit order among the following options is____",
1246 | "A": "6, 5, 4, 3, 2, 1",
1247 | "B": "1, 2, 3, 4, 5, 6",
1248 | "C": "2, 1, 3, 5, 4, 6",
1249 | "D": "3, 2, 1, 6, 5, 4",
1250 | "category": 1,
1251 | "id": 138
1252 | },
1253 | {
1254 | "question": "\u5c06\u4f18\u5148\u7ea7\u4e3a3\u30016\u30015\u30011\u30017\u30010\u30019\u7684\u5143\u7d20\u4f9d\u6b21\u8fdb\u5165\u4e00\u4e2a\u4f18\u5148\u7ea7\u961f\u5217,\u6570\u503c\u8d8a\u5c0f\u4f18\u5148\u7ea7\u8d8a\u9ad8,\u5728\u5165\u961f\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u6709\u4e00\u4e9b\u51fa\u961f\u64cd\u4f5c,\u6700\u540e\u6240\u6709\u5143\u7d20\u90fd\u8981\u51fa\u961f\u3002\u4e0b\u5217\u9009\u9879\u4e2d\u4e0d\u53ef\u80fd\u7684\u51fa\u961f\u6b21\u5e8f\u662f____",
1255 | "A": "3, 5, 6, 0, 1, 7, 9",
1256 | "B": "3, 1, 6, 5, 0, 7, 9",
1257 | "C": "0, 1, 3, 5, 6, 7, 9",
1258 | "D": "3, 0, 1, 5, 6, 7,9",
1259 | "category": 1,
1260 | "id": 139
1261 | },
1262 | {
1263 | "question": "The possible sorting algorithm used to sort the elements 3, 1, 6, 0, 5, 7, 9 into the result 0, 1, 6, 3, 5, 7, 9 in one pass is ___.",
1264 | "A": "Bubble Sort",
1265 | "B": "Straight Insertion Sort",
1266 | "C": "Insertion Sort",
1267 | "D": "Shell Sort with 3-sorting",
1268 | "category": 0,
1269 | "id": 140
1270 | },
1271 | {
1272 | "question": "If a:b:c:d:e enter a stack in order, with the possibility of being popped out during the process, if the first element popped out is c, it is impossible for the second element to be____",
1273 | "A": "a",
1274 | "B": "b",
1275 | "C": "d",
1276 | "D": "e",
1277 | "category": 1,
1278 | "id": 141
1279 | },
1280 | {
1281 | "question": "The minimum spanning tree is:____\n| \u221e | 5 | 1 | \u221e | \u221e | \u221e |/n| 5 | \u221e | \u221e | 1 | \u221e | \u221e |/n| 1 | \u221e | \u221e | 4 | 2 | \u221e |/n| \u221e | 1 | 4 | \u221e | 2 | 2 |/n| \u221e | \u221e | 2 | 2 | \u221e | 2 |/n| \u221e | \u221e | \u221e | 2 | 2 | \u221e |/n",
1282 | "A": "(0,1)(1,3)(2,4)(3,4)(4,5)",
1283 | "B": "(0,2)(1,3)(2,4)(3,4)(4,2)",
1284 | "C": "(0,2)(1,3)(2,4)(3,4)(3,5)",
1285 | "D": "(0,2)(2,3)(2,4)(3,4)(4,5)",
1286 | "category": 1,
1287 | "id": 142
1288 | },
1289 | {
1290 | "question": "If the keywords 1, 2, 3, 4, 5, 6, 7 are inserted into an initially empty AVL tree T, the number of non-leaf nodes in T with a balance factor of 0 is____",
1291 | "A": "0",
1292 | "B": "1",
1293 | "C": "2",
1294 | "D": "3",
1295 | "category": 1,
1296 | "id": 143
1297 | },
1298 | {
1299 | "question": "The time complexity of the following code segment is ____\ncount = 0;for (k = 1; k <= n; k *= 2)for (j = 1; j <= n; j = j+1)count++;",
1300 | "A": "O(log2n)",
1301 | "B": "O(n)",
1302 | "C": "O(nlog2n)",
1303 | "D": "O(n^2)",
1304 | "category": 2,
1305 | "id": 144
1306 | },
1307 | {
1308 | "question": "If there are 1,000,000 numbers to be sorted and the fastest method is needed to select the smallest 10, which of the following methods can achieve this goal?",
1309 | "A": "Quick Sort",
1310 | "B": "Heap Sort",
1311 | "C": "Merge Sort",
1312 | "D": "Shell Sort",
1313 | "category": 0,
1314 | "id": 145
1315 | },
1316 | {
1317 | "question": "If elements A:B:C:D:e and f are pushed into a stack in order, with alternating push and pop operations allowed. However, at most two consecutive pop operations are allowed. The impossible sequence of popped elements is____",
1318 | "A": "dcebfa",
1319 | "B": "cbdaef",
1320 | "C": "cbdafe",
1321 | "D": "adcfeb",
1322 | "category": 1,
1323 | "id": 146
1324 | },
1325 | {
1326 | "question": "In a tree T with a degree of 4, if there are 20 nodes with a degree of 4, 10 nodes with a degree of 3, 1 node with a degree of 2, and 10 nodes with a degree of 1, the number of leaf nodes in tree T is ____",
1327 | "A": "81",
1328 | "B": "82",
1329 | "C": "122",
1330 | "D": "123",
1331 | "category": 1,
1332 | "id": 147
1333 | },
1334 | {
1335 | "question": "The keyword sequences that cannot form a search path in a binary search tree are:",
1336 | "A": "21,89,77,29,36,38",
1337 | "B": "92,20,91,34,88,35",
1338 | "C": "95,22,91,24,94,71",
1339 | "D": "12,25,71,68,33,34",
1340 | "category": 1,
1341 | "id": 148
1342 | },
1343 | {
1344 | "question": "If the preorder traversal sequence of a binary tree is a, e, b, d, c, and the postorder traversal sequence is b, c, d, e, a, then the child nodes of the root node are____",
1345 | "A": "only e",
1346 | "B": "e, b",
1347 | "C": "e, c",
1348 | "D": "cannot be determined",
1349 | "category": 1,
1350 | "id": 149
1351 | },
1352 | {
1353 | "question": "If the length of the Huffman encoding does not exceed 4, and if two characters have already been encoded as 1 and 01, a maximum of characters can be encoded as ____ ",
1354 | "A": "2 /n",
1355 | "B": "3 /n",
1356 | "C": "4 /n",
1357 | "D": "5",
1358 | "category": 1,
1359 | "id": 150
1360 | },
1361 | {
1362 | "question": "If a directed graph is stored using an adjacency matrix, with all elements below the main diagonal being zero, the conclusion about the topological sequence of this graph is ______",
1363 | "A": "Exists and unique",
1364 | "B": "Does not exist",
1365 | "C": "Exists, possibly not unique",
1366 | "D": "Cannot determine whether it exists",
1367 | "category": 0,
1368 | "id": 151
1369 | },
1370 | {
1371 | "question": "The correct statements about minimum spanning trees are as follows: I. The cost of the minimum spanning tree is unique; II. The edge with the minimum weight will always appear in all minimum spanning trees; III. The minimum spanning tree obtained by the Prim's algorithm will always be the same regardless of the starting vertex; IV. The minimum spanning trees obtained by the Prim's algorithm and Kruskal's algorithm will never be the same.",
1372 | "A": "Only I",
1373 | "B": "Only II",
1374 | "C": "Only I\u3001III",
1375 | "D": "Only II\u3001IV",
1376 | "category": 0,
1377 | "id": 152
1378 | },
1379 | {
1380 | "question": "In the internal sorting process, processing all elements that have not yet determined their final position once is called a single pass sorting. Sort a set of data (2,12,16,88,5,10), if the results of the first three rounds of sorting are as follows. The first trip: 2,12,16,5,10,88; The second trip: 2,12,5,10,16,88; The third trip: 2,5,10,12,16,88. The sorting method used is____",
1381 | "A": "Heap sort",
1382 | "B": "Bubble sort",
1383 | "C": "Radix sort",
1384 | "D": "Direct insertion sort",
1385 | "category": 0,
1386 | "id": 153
1387 | },
1388 | {
1389 | "question": "The operation of inserting a node with a value of d into an initially empty doubly circular linked list without a head and tail node, where the structure of the node is (prev, data, next), and head is a pointer to a node in the doubly circular linked list, is____",
1390 | "A": "head->data = d; head->next=head->prev = NULL;",
1391 | "B": "head->data = d; head->next=head->prev = head;",
1392 | "C": "head = new node; head->data = d; head->next=head->prev = NULL;",
1393 | "D": "head = new node; head->data = d; head->next=head->prev = head;",
1394 | "category": 2,
1395 | "id": 154
1396 | },
1397 | {
1398 | "question": "Is the binary search tree with preorder traversal sequence (15, 5, 0, 3, 10, 30, 18, 16, 40, 35, 50, 45) an AVL tree and what is the height of this tree? (The height of a tree with only one root node is 1)",
1399 | "A": " Yes, 4",
1400 | "B": "Yes, 5",
1401 | "C": "No, 4",
1402 | "D": "No, 5",
1403 | "category": 1,
1404 | "id": 155
1405 | },
1406 | {
1407 | "question": "The height of the Huffman tree constructed from a set of weights {1, 2, 3, 4, 5, 6, 7, 8} is ____",
1408 | "A": "4",
1409 | "B": "5",
1410 | "C": "6",
1411 | "D": "7",
1412 | "category": 1,
1413 | "id": 156
1414 | },
1415 | {
1416 | "question": "Given a level order traversal of a min-heap as (1, 4, 10, 5, 6, 111, 13, 9, 8), insert the element 3 into the heap. After insertion, at which level is the element 3 located? (The root node is considered as level 1)",
1417 | "A": "1",
1418 | "B": "2",
1419 | "C": "3",
1420 | "D": "4",
1421 | "category": 1,
1422 | "id": 157
1423 | },
1424 | {
1425 | "question": "The order of all leaf nodes in the preorder sequence, inorder sequence, and postorder sequence of a binary tree node is ____.",
1426 | "A": "completely the same",
1427 | "B": "the same as the preorder and inorder, but different from the postorder",
1428 | "C": "all different",
1429 | "D": "the same as the inorder and postorder, but different from the preorder",
1430 | "category": 0,
1431 | "id": 158
1432 | },
1433 | {
1434 | "question": "The impossible sequence to pop out of the stack, if the stack size is 5, is ______",
1435 | "A": "1,2,3,4,5,6,7,8,9,10",
1436 | "B": "5,4,6,7,3,2,9,8,10,1",
1437 | "C": "4,5,3,6,10,9,8,7,2,1",
1438 | "D": "4,3,6,5,8,7,10,9,2,1",
1439 | "category": 1,
1440 | "id": 159
1441 | },
1442 | {
1443 | "question": "Use quick sorting to sort data {5,6,3,4,9,10,1,2,7,8}. When partitioning, use the first element as the standard element. After a pass of partitioning, the order of the array elements is ____",
1444 | "A": "1,2,3,4,5,6,7,8,9,10",
1445 | "B": "2,1,3,4,5,10,9,6,7,8",
1446 | "C": "1,2,3,4,5,9,10,6,7,8",
1447 | "D": "3,4,2,2,5 6,9,10,7,8",
1448 | "category": 1,
1449 | "id": 160
1450 | },
1451 | {
1452 | "question": "Using a child sibling chain to store a tree, the right pointer of the root node is ____",
1453 | "A": "pointing to the leftmost child",
1454 | "B": "pointing to the rightmost child",
1455 | "C": "empty",
1456 | "D": "uncertain",
1457 | "category": 1,
1458 | "id": 161
1459 | },
1460 | {
1461 | "question": "The operation to modify the pointers in a doubly linked circular linked list with node structure (prev, data, next) when inserting a new node pointed by q before the node pointed by p is____",
1462 | "A": "p->prev = q; q->next = p; p->prev->next = q; q->prev = q;",
1463 | "B": "p->prev = q; p->prev->next = q; q->next = p; q->prev = p->prev;",
1464 | "C": "q->prev = p->prev; q->next = p; p->prev = q; p->prev = q;",
1465 | "D": "q->next = p; q->prev = p->prev; p->prev->next = q; p->prev = q;",
1466 | "category": 2,
1467 | "id": 162
1468 | },
1469 | {
1470 | "question": "Using binary search, the number of key comparisons required to find the key 60 in the initial record key sequence (0,5,10,15,20,25,30,35,40,45,50,55,60,65,70) is ____.",
1471 | "A": "1",
1472 | "B": "2",
1473 | "C": "3",
1474 | "D": "4",
1475 | "category": 1,
1476 | "id": 163
1477 | },
1478 | {
1479 | "question": "The key sequence of a set of records is (22,66,30,70,60,87,24). Use heap sort to sort them in increasing order. The initial heap established by buildHeap is ____",
1480 | "A": "(22,60,24,70,66,87,30)",
1481 | "B": "(87,70,30,66,60,22,24)",
1482 | "C": "(22,24,30,60,66,70,87)",
1483 | "D": "(87,70,66,60,30,24,22)",
1484 | "category": 1,
1485 | "id": 164
1486 | },
1487 | {
1488 | "question": "If the pre order sequence and post order sequence of a binary tree are exactly opposite, then what kind of binary tree the binary tree must be ____",
1489 | "A": "Empty or only one node",
1490 | "B": "The maximum number of leaf nodes is 1",
1491 | "C": "No left son at any node",
1492 | "D": "No right son at any node",
1493 | "category": 1,
1494 | "id": 165
1495 | },
1496 | {
1497 | "question": "The following options give the weight sequences from the root to two leaf nodes. Which ones can belong to the same Huffman tree?",
1498 | "A": "24, 10, 5 and 24, 10, 7",
1499 | "B": "24, 10, 5 and 24, 12, 7",
1500 | "C": "24, 10, 10 and 24, 14, 11",
1501 | "D": "24, 10, 5 and 24, 14, 6",
1502 | "category": 1,
1503 | "id": 166
1504 | },
1505 | {
1506 | "question": "The impossible order of element popping out if the order of pushing in is 1, 2, 3, 4, 5, 6 is____",
1507 | "A": "1, 2, 3, 4, 5, 6",
1508 | "B": "6, 5, 4, 3, 2, 1",
1509 | "C": "1, 2, 4, 3, 6, 5",
1510 | "D": "1,4,2,3,5,6",
1511 | "category": 1,
1512 | "id": 167
1513 | },
1514 | {
1515 | "question": "Which of the following sequences is impossible to find in a binary search tree?",
1516 | "A": "10, 20, 30, 25",
1517 | "B": "10, 20, 30, 19",
1518 | "C": "10, 20, 30, 40",
1519 | "D": "10, 5, 7, 9",
1520 | "category": 1,
1521 | "id": 168
1522 | },
1523 | {
1524 | "question": "In a circular queue, if the array size is size, front points to the unit before the front element of the queue, and rear points to the rear element, then the length of the queue is____",
1525 | "A": "rear - front",
1526 | "B": "(rear-front) % size",
1527 | "C": "(rear-front + size)%size",
1528 | "D": "(rear-front + 1 + size)%size",
1529 | "category": 2,
1530 | "id": 169
1531 | },
1532 | {
1533 | "question": "Consider the following array: 59, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 14, 99. How many swaps are required to transform it into a maximum heap at least",
1534 | "A": "4",
1535 | "B": "5",
1536 | "C": "3",
1537 | "D": "6",
1538 | "category": 1,
1539 | "id": 170
1540 | },
1541 | {
1542 | "question": "The correct statement about a fixed-order queue with a fixed front position is ____",
1543 | "A": "Can only enqueue and cannot dequeue",
1544 | "B": "Enqueuing always causes a large amount of data movement",
1545 | "C": "Dequeue operation has a complexity of O(1)",
1546 | "D": "Dequeue causes a large amount of data movement",
1547 | "category": 0,
1548 | "id": 171
1549 | },
1550 | {
1551 | "question": "When searching for a node with a certain key in a binary search tree with n nodes, the maximum number of comparisons performed is ____.",
1552 | "A": "log(2n)+1",
1553 | "B": "log(n)/log(2)",
1554 | "C": "n",
1555 | "D": "n/2",
1556 | "category": 1,
1557 | "id": 172
1558 | },
1559 | {
1560 | "question": "What is the maximum length of a queue when an array of size N is used to store a circular queue and the front pointer does not store any data elements?",
1561 | "A": "N+1",
1562 | "B": "N-1",
1563 | "C": "N-2",
1564 | "D": "N",
1565 | "category": 1,
1566 | "id": 173
1567 | },
1568 | {
1569 | "question": "The maximum depth of a balanced binary tree with 20 nodes is ____.",
1570 | "A": "5",
1571 | "B": "6",
1572 | "C": "7",
1573 | "D": "4",
1574 | "category": 1,
1575 | "id": 174
1576 | },
1577 | {
1578 | "question": "The correct statement among the following is____",
1579 | "A": "In the circular queue, let the unit pointed to by front not store queue elements, and the condition for judging that the queue is full is (rear+1)%MaxSize==front",
1580 | "B": "All right",
1581 | "C": "All wrong",
1582 | "D": "The operation of the stack is first in last out",
1583 | "category": 0,
1584 | "id": 175
1585 | },
1586 | {
1587 | "question": "The following statements are correct: ____",
1588 | "A": "All right",
1589 | "B": "Before performing stack operations, the stack should be judged to be empty",
1590 | "C": "All wrong",
1591 | "D": "The stack operation is first in and then out",
1592 | "category": 0,
1593 | "id": 176
1594 | },
1595 | {
1596 | "question": "The following statements are correct: ____",
1597 | "A": "All right",
1598 | "B": "All wrong",
1599 | "C": "Stack is a storage structure",
1600 | "D": "The operation of the stack is first in, second out",
1601 | "category": 0,
1602 | "id": 177
1603 | },
1604 | {
1605 | "question": "What is the impossible sequence of popping out for a stack with the push sequence of 1, 2, 3, 4?",
1606 | "A": "4 3 1 2",
1607 | "B": "1 4 3 2",
1608 | "C": "1 2 4 3",
1609 | "D": "2 1 4 3",
1610 | "category": 1,
1611 | "id": 178
1612 | },
1613 | {
1614 | "question": "By _____ method, it can be determined whether a directed graph has a cycle.",
1615 | "A": "Calculate the degree of nodes",
1616 | "B": "All wrong",
1617 | "C": "Calculate the critical path",
1618 | "D": "Topological sorting",
1619 | "category": 0,
1620 | "id": 179
1621 | },
1622 | {
1623 | "question": "By using the ______ method, it is possible to determine whether a directed graph has a cycle.",
1624 | "A": "Calculate the degrees of the nodes",
1625 | "B": "Perform depth-first search",
1626 | "C": "Calculate the critical path",
1627 | "D": "All wrong",
1628 | "category": 0,
1629 | "id": 180
1630 | },
1631 | {
1632 | "question": "For a directed graph, if a vertex has an in-degree of K1 and an out-degree of K2, the number of nodes in the linked list corresponding to that vertex in the adjacency list is ____.",
1633 | "A": "K1+K2",
1634 | "B": "K2",
1635 | "C": "fabs(K1-K2)",
1636 | "D": "K1",
1637 | "category": 1,
1638 | "id": 181
1639 | },
1640 | {
1641 | "question": "Which of the following arrays can correctly represent the result after deleting the root element twice from the given array-based max heap: {75, 72, 59, 63, 48, 15, 43, 61}?",
1642 | "A": "63, 59, 61, 43, 48, 15",
1643 | "B": "63, 59, 48, 15, 43, 61",
1644 | "C": "63, 61, 59, 43, 48, 15",
1645 | "D": "63, 61, 59, 48, 43, 15",
1646 | "category": 1,
1647 | "id": 182
1648 | },
1649 | {
1650 | "question": "Given an ordered list {3, 7, 12, 21, 54, 57, 65, 76, 87, 90, 92, 94}, using binary search to find 90 in the list, what is the record of the third comparison?",
1651 | "A": "76",
1652 | "B": "87",
1653 | "C": "90",
1654 | "D": "92",
1655 | "category": 1,
1656 | "id": 183
1657 | },
1658 | {
1659 | "question": "The incorrect options in the statement are:",
1660 | "A": "All wrong",
1661 | "B": "Radix sort is a stable sorting method.",
1662 | "C": "Huffman tree is the tree with the shortest weighted path length, and nodes with higher weights are closer to the root.",
1663 | "D": "When deleting an element from a min heap, the last element of the heap needs to be filled into the top position, and then it needs to be adjusted upwards layer by layer according to the condition.",
1664 | "category": 0,
1665 | "id": 184
1666 | },
1667 | {
1668 | "question": "Which of the following options are incorrect in the description below?",
1669 | "A": "Topological sorting refers to sorting the nodes in a certain order.",
1670 | "B": "Radix sort is a stable sorting method.",
1671 | "C": "Huffman tree is a tree with the shortest weighted path length, and nodes with larger weights are closer to the root.",
1672 | "D": "All wrong",
1673 | "category": 0,
1674 | "id": 185
1675 | },
1676 | {
1677 | "question": "The time complexity that is not affected by the initial state of the data and remains constant as O(nlogn) is____",
1678 | "A": "Bubble sort",
1679 | "B": "Heap sort",
1680 | "C": "Shell sort",
1681 | "D": "Quick sort",
1682 | "category": 0,
1683 | "id": 186
1684 | },
1685 | {
1686 | "question": "What is the best choice to find the top 50 largest numbers in the fastest way among 1000 unordered integers?",
1687 | "A": "Radix sort",
1688 | "B": "Bubble sort",
1689 | "C": "Heap sort",
1690 | "D": "Quick sort",
1691 | "category": 0,
1692 | "id": 187
1693 | },
1694 | {
1695 | "question": "The efficiency of searching in a binary search tree is related to ______.",
1696 | "A": "the degree of the node being searched",
1697 | "B": "the depth of the binary search tree",
1698 | "C": "the number of nodes in the binary search tree",
1699 | "D": "the storage structure of the binary search tree",
1700 | "category": 0,
1701 | "id": 188
1702 | },
1703 | {
1704 | "question": "The correct description about traversal is ______",
1705 | "A": "All wrong",
1706 | "B": "The result generated by a certain traversal method of a binary tree is a linear sequence.",
1707 | "C": "Given a certain traversal result of a binary tree, it cannot uniquely determine the tree, but two different traversal results can deduce the binary tree.",
1708 | "D": "The tree can be uniquely determined by its preorder traversal and postorder traversal.",
1709 | "category": 0,
1710 | "id": 189
1711 | },
1712 | {
1713 | "question": "The correct description about traversal is:",
1714 | "A": "Traversal has both recursive and non-recursive algorithms.",
1715 | "B": "All wrong",
1716 | "C": "Given a certain traversal result of a binary tree, it cannot uniquely determine the tree, but two different traversal results of the binary tree can deduce the tree.",
1717 | "D": "The tree can be uniquely determined by its preorder traversal and postorder traversal.",
1718 | "category": 0,
1719 | "id": 190
1720 | },
1721 | {
1722 | "question": "When performing binary search on a linear table, it is required that the linear table must be stored in ________.",
1723 | "A": "sequential manner and the nodes are stored in sorted order by key",
1724 | "B": "sequential manner",
1725 | "C": "linked manner and the nodes are stored in sorted order by key",
1726 | "D": "linked manner",
1727 | "category": 0,
1728 | "id": 191
1729 | },
1730 | {
1731 | "question": "Which of the following statements about graphs is correct?",
1732 | "A": "In a strongly connected directed graph, every vertex has an arc to every other vertex.",
1733 | "B": "The in-degree of any vertex in a graph is equal to its out-degree.",
1734 | "C": "A subset of the edge set and a subset of the vertex set of a directed graph can form a subgraph of the original directed graph.",
1735 | "D": "A directed complete graph is always a strongly connected directed graph.",
1736 | "category": 0,
1737 | "id": 192
1738 | },
1739 | {
1740 | "question": "Given two doubly linked lists of lengths m and n, merging the list of length n into the end of the list of length m using the existing node space of the lists, the required time complexity is____",
1741 | "A": "O(m+n)",
1742 | "B": "O(m)",
1743 | "C": "O(1)",
1744 | "D": "O(n)",
1745 | "category": 1,
1746 | "id": 193
1747 | },
1748 | {
1749 | "question": "The correct statements about hash tables are____. I. It is best for the length of the array to be a prime number when using the division remainder method. II. No key comparisons are needed in hash table search. III. The average search length in a successful search in a hash table is related to the table length. IV. If an element is deleted in a hash table, it cannot simply be removed.\n",
1750 | "A": "I and IV",
1751 | "B": "III",
1752 | "C": "IV",
1753 | "D": "II",
1754 | "category": 1,
1755 | "id": 194
1756 | },
1757 | {
1758 | "question": "The value of the postfix expression 9 2 3 * + 10 2 / - is ______",
1759 | "A": "23",
1760 | "B": "17",
1761 | "C": "10",
1762 | "D": "20",
1763 | "category": 1,
1764 | "id": 195
1765 | },
1766 | {
1767 | "question": "What is the average number of elements that need to be moved when inserting an element into a sequential list of 100 elements while maintaining the original order, assuming an equal probability distribution for the insertion position?",
1768 | "A": "50",
1769 | "B": "50.5",
1770 | "C": "49.5",
1771 | "D": "1",
1772 | "category": 1,
1773 | "id": 196
1774 | },
1775 | {
1776 | "question": "Which of the following statements about the characteristics of an undirected connected graph is correct? I. The sum of the degrees of all vertices is even. II. The number of edges is greater than the number of vertices minus 1. III. At least one vertex has a degree of 1.",
1777 | "A": "Only II",
1778 | "B": "I and II",
1779 | "C": "Only I",
1780 | "D": "I and III",
1781 | "category": 0,
1782 | "id": 197
1783 | },
1784 | {
1785 | "question": "The incorrect statement among the following descriptions about B-trees and B+ trees is____",
1786 | "A": "Both B-trees and B+ trees can be used for file indexing structures.",
1787 | "B": "Both B-trees and B+ trees are balanced multiway trees.",
1788 | "C": "Both B-trees and B+ trees can efficiently support random access.",
1789 | "D": "Both B-trees and B+ trees can efficiently support sequential access.",
1790 | "category": 0,
1791 | "id": 198
1792 | },
1793 | {
1794 | "question": "The correct statement among the following is____",
1795 | "A": "The logical structure of data uniquely determines its storage structure.",
1796 | "B": "The logical structure of data is independent of its storage structure.",
1797 | "C": "Data structure is determined solely by its logical structure and storage structure.",
1798 | "D": "All wrong",
1799 | "category": 0,
1800 | "id": 199
1801 | },
1802 | {
1803 | "question": "Translate the following question into English, do not answer the question, only output the translated text.\n\nInsert the numbers 7, 8, 9, 2, 3, 5, 6, 4 in order into an initially empty AVL tree. Which of the following sentences is incorrect____",
1804 | "A": "The balance factor of a node with 2 children is -1.",
1805 | "B": "2 and 5 are siblings.",
1806 | "C": "3 is the root node of 4",
1807 | "D": "7 is the root node",
1808 | "category": 0,
1809 | "id": 200
1810 | },
1811 | {
1812 | "question": "From a binary Huffman tree to a ternary Huffman tree, the weights of characters A, B, C, D, E, F, G are 3, 12, 7, 4, 2, 8, 11 respectively. What is the level of character A in the Huffman tree (assuming the root node is at level 1)?",
1813 | "A": "3",
1814 | "B": "2",
1815 | "C": "4",
1816 | "D": "5",
1817 | "category": 1,
1818 | "id": 201
1819 | },
1820 | {
1821 | "question": "If it is possible to visit all vertices by performing a depth-first search from any vertex in a directed acyclic graph, then the graph must be ____",
1822 | "A": "strongly connected",
1823 | "B": "cyclic",
1824 | "C": "a tree",
1825 | "D": "connected",
1826 | "category": 1,
1827 | "id": 202
1828 | },
1829 | {
1830 | "question": "The time complexity of an algorithm is (n^3 + n^2*(log(n)/log(2)) + 8n)/n^2. The representation in big O notation is____",
1831 | "A": "O(logn)",
1832 | "B": "O(n^3)",
1833 | "C": "O(n+logn+8/n)",
1834 | "D": "O(n)",
1835 | "category": 2,
1836 | "id": 203
1837 | },
1838 | {
1839 | "question": "Traversing the tree by ____ yields an ordered sequence",
1840 | "A": "Pre order",
1841 | "B": "Hierarchical order",
1842 | "C": "Mid order",
1843 | "D": "Post order",
1844 | "category": 0,
1845 | "id": 204
1846 | },
1847 | {
1848 | "question": "The maximum number of elements that need to be moved to delete a node in a sequential list of length N is ______",
1849 | "A": "N-1",
1850 | "B": "N/2",
1851 | "C": "N",
1852 | "D": "1",
1853 | "category": 1,
1854 | "id": 205
1855 | },
1856 | {
1857 | "question": "The incorrect statement among the following descriptions is____",
1858 | "A": "The time complexity of heap sort is O(nlogn).",
1859 | "B": "The space complexity of heap sort is O(1).",
1860 | "C": "Heap sort is a stable sorting algorithm.",
1861 | "D": "The time complexity of the entire heap construction is O(n).",
1862 | "category": 0,
1863 | "id": 206
1864 | },
1865 | {
1866 | "question": "If the length of Huffman coding does not exceed 4, and it is known that the encoding of two characters is 0 and 100, the maximum number of characters that can still be encoded is ____.",
1867 | "A": "7",
1868 | "B": "3",
1869 | "C": "5",
1870 | "D": "6",
1871 | "category": 1,
1872 | "id": 207
1873 | },
1874 | {
1875 | "question": "The relative order of these nodes in the post-order traversal is ______",
1876 | "A": "ABCFED",
1877 | "B": "Cannot be determined",
1878 | "C": "FEDCBA",
1879 | "D": "ABCDEF",
1880 | "category": 1,
1881 | "id": 208
1882 | },
1883 | {
1884 | "question": "The insertion and deletion operations of a stack are at the ____.",
1885 | "A": "top of the stack",
1886 | "B": "middle of the stack",
1887 | "C": "bottom of the stack",
1888 | "D": "any position",
1889 | "category": 0,
1890 | "id": 209
1891 | },
1892 | {
1893 | "question": "The initial state of stack S and queue Q is empty. Elements e1, e2, e3, e4, e5, and e6 are passed through stack S in order. After an element is popped from the stack, it is enqueued into queue Q. If the sequence of elements dequeued is e2, e4, e3, e6, e5, e1, then the minimum capacity of stack S should be ____.",
1894 | "A": "5",
1895 | "B": "3",
1896 | "C": "2",
1897 | "D": "4",
1898 | "category": 1,
1899 | "id": 210
1900 | },
1901 | {
1902 | "question": "Given the initial unsorted sequence { 15, 9, 7, 8, 20, -1, 4 }. If the sequence after the first pass of Shell sort is { 15, -1, 4, 8, 20, 9, 7 }, then the increment for that pass is____",
1903 | "A": "2",
1904 | "B": "4",
1905 | "C": "3",
1906 | "D": "1",
1907 | "category": 1,
1908 | "id": 211
1909 | },
1910 | {
1911 | "question": "In the inorder traversal sequence of a non-empty binary tree, it is not possible for a node to have its adjacent node as:",
1912 | "A": "The leftmost node on its right subtree",
1913 | "B": "The rightmost node on its left subtree",
1914 | "C": "Its sibling node",
1915 | "D": "Its parent node",
1916 | "category": 0,
1917 | "id": 212
1918 | },
1919 | {
1920 | "question": "What is the number of nodes in the first tree of forest F, where the corresponding binary tree B has m+1 nodes, the root of B is p, and the number of nodes in the right subtree of p is n?",
1921 | "A": "m-n",
1922 | "B": "Insufficient information to determine",
1923 | "C": "m-n+1",
1924 | "D": "n+1",
1925 | "category": 1,
1926 | "id": 213
1927 | },
1928 | {
1929 | "question": "The advantages of a doubly linked list over a singly linked list are:",
1930 | "A": "All wrong",
1931 | "B": "It allows direct access to the immediate predecessor of a specified node in the linked list.",
1932 | "C": "It has better space complexity.",
1933 | "D": "It allows direct access to the immediate successor of a specified node in the linked list.",
1934 | "category": 0,
1935 | "id": 214
1936 | },
1937 | {
1938 | "question": "The advantages of a doubly linked list over a singly linked list are:",
1939 | "A": "Faster reverse traversal from the terminal node to the starting node",
1940 | "B": "All wrong",
1941 | "C": "Better space complexity",
1942 | "D": "Direct access to the immediate successor of a specific node in the linked list",
1943 | "category": 0,
1944 | "id": 215
1945 | },
1946 | {
1947 | "question": "The tail node of the non-empty circular linked list head satisfies the following condition____",
1948 | "A": "tail==NULL;",
1949 | "B": "tail->next==head;",
1950 | "C": "tail->next==NULL;",
1951 | "D": "head->next==tail;",
1952 | "category": 2,
1953 | "id": 216
1954 | },
1955 | {
1956 | "question": "Which of the following tree's inorder traversal sequence is ordered?",
1957 | "A": "AVL tree",
1958 | "B": "Binary tree",
1959 | "C": "Heap",
1960 | "D": "Huffman tree",
1961 | "category": 0,
1962 | "id": 217
1963 | },
1964 | {
1965 | "question": "Which of the following trees has an ordered inorder traversal sequence?",
1966 | "A": "All wrong",
1967 | "B": "Binary search tree",
1968 | "C": "Heap",
1969 | "D": "Huffman tree",
1970 | "category": 0,
1971 | "id": 218
1972 | },
1973 | {
1974 | "question": "What is the algorithm complexity of the following code?\ncount=0;for(k=1; k<=n; k*=2)for(j=1; j<=n; j++)count++;",
1975 | "A": "O(n^2)",
1976 | "B": "O(nlogn)",
1977 | "C": "O(n^3)",
1978 | "D": "O(log(n)/LOG(2))",
1979 | "category": 2,
1980 | "id": 219
1981 | },
1982 | {
1983 | "question": "In the commonly used storage structure of a binary search tree, the node with the maximum key value____",
1984 | "A": "The left pointer is always empty",
1985 | "B": "The right pointer is always empty",
1986 | "C": "Both the left and right pointers are not empty",
1987 | "D": "Both the left and right pointers are empty",
1988 | "category": 0,
1989 | "id": 220
1990 | },
1991 | {
1992 | "question": "When using block search, the organization of data requires that:",
1993 | "A": "The data is divided into several blocks, with each block having ordered data, and the blocks themselves must also be ordered.",
1994 | "B": "The data is divided into several blocks, with an equal number of data in each block.",
1995 | "C": "The data is divided into several blocks, with each block having ordered data, but the blocks themselves do not have to be ordered.",
1996 | "D": "The data is divided into several blocks, and the data within each block does not need to be orderly, but the blocks must be orderly",
1997 | "category": 0,
1998 | "id": 221
1999 | },
2000 | {
2001 | "question": "The number of stack sequences that start with CD, given a sufficiently large empty stack, with the order of pushing 4 elements being A, B, C, D, is ______.",
2002 | "A": "1",
2003 | "B": "3",
2004 | "C": "2",
2005 | "D": "4",
2006 | "category": 1,
2007 | "id": 222
2008 | },
2009 | {
2010 | "question": "Consider a min heap whose elements of all nodes are sorted as {1, 2, ..., 1024}. Let the depth of the root node be 1. What is the maximum depth that the integer 9 can have in the heap?",
2011 | "A": "9",
2012 | "B": "10",
2013 | "C": "4",
2014 | "D": "2",
2015 | "category": 1,
2016 | "id": 223
2017 | },
2018 | {
2019 | "question": "The forest corresponding to the binary tree, with the preorder traversal sequence of ABDCEF and the inorder traversal sequence of BDAECF, includes ____ trees.",
2020 | "A": "3",
2021 | "B": "2",
2022 | "C": "4",
2023 | "D": "1",
2024 | "category": 1,
2025 | "id": 224
2026 | },
2027 | {
2028 | "question": "Among the following four sorting algorithms, ____ is stable.",
2029 | "A": "Bubble sort",
2030 | "B": "All wrong",
2031 | "C": "Quick sort",
2032 | "D": "Merge sort",
2033 | "category": 0,
2034 | "id": 225
2035 | },
2036 | {
2037 | "question": "Among the following four sorting algorithms, ____ is stable.",
2038 | "A": "All wrong",
2039 | "B": "Shell Sort",
2040 | "C": "Quick sort",
2041 | "D": "Merge sort",
2042 | "category": 0,
2043 | "id": 226
2044 | },
2045 | {
2046 | "question": "Starting from an empty tree, after inserting elements 52, 26, 14, 32, 71, 60, 93, 58, 24, and 41, a binary search tree is formed. The number of comparisons required to find 60 in this tree is ____.",
2047 | "A": "4",
2048 | "B": "5",
2049 | "C": "3",
2050 | "D": "6",
2051 | "category": 1,
2052 | "id": 227
2053 | },
2054 | {
2055 | "question": "In the following statements about m-order B-trees, the incorrect one is ____ ",
2056 | "A": "All leaf nodes are on the same level ",
2057 | "B": "There are few m/2 (m is even) or (m+1)/2 (m is odd) trees in the leaf nodes",
2058 | "C": "The data in the root node is ordered",
2059 | "D": "There are many m trees in the root node",
2060 | "category": 1,
2061 | "id": 228
2062 | },
2063 | {
2064 | "question": "If the time complexity of an algorithm is O(n), where n means ____",
2065 | "A": "problem size",
2066 | "B": "number of loops",
2067 | "C": "number of statements",
2068 | "D": "number of functions",
2069 | "category": 0,
2070 | "id": 229
2071 | },
2072 | {
2073 | "question": "If a queue is known to be represented by a single linked list, the current state of the single linked list (including 3 elements) is: 1->2->3, where x ->y indicates that the next node of x is y. At this time, if element 4 is queued and then queued out, the state of the single linked list is ____",
2074 | "A": "2->3->4",
2075 | "B": "The answer is not unique",
2076 | "C": "1->2->3",
2077 | "D": "4->2->1",
2078 | "category": 1,
2079 | "id": 230
2080 | },
2081 | {
2082 | "question": "The incorrect description about a doubly linked list is ____",
2083 | "A": "Doubly linked lists are convenient for insertion and deletion.",
2084 | "B": "Pointers in a doubly linked list can move in both forward and backward directions.",
2085 | "C": "Doubly linked lists and singly linked lists occupy the same amount of storage space.",
2086 | "D": "Doubly linked lists do not need to occupy contiguous storage space.",
2087 | "category": 0,
2088 | "id": 231
2089 | },
2090 | {
2091 | "question": "The number of different binary trees with a preorder traversal sequence of 1, 2, 3 is ______.",
2092 | "A": "5",
2093 | "B": "3",
2094 | "C": "4",
2095 | "D": "6",
2096 | "category": 1,
2097 | "id": 232
2098 | },
2099 | {
2100 | "question": "Which one of the following codes is not a prefix code?",
2101 | "A": "(0, 10, 110, 111)",
2102 | "B": "(0, 1, 00, 11)",
2103 | "C": "(00, 01, 10, 11)",
2104 | "D": "(1, 01, 000, 001)",
2105 | "category": 0,
2106 | "id": 233
2107 | },
2108 | {
2109 | "question": "The height of a breadth-first search tree compared to the height of a depth-first search tree is ______.",
2110 | "A": "Smaller",
2111 | "B": "Smaller or equal",
2112 | "C": "Larger",
2113 | "D": "Larger or equal",
2114 | "category": 0,
2115 | "id": 234
2116 | },
2117 | {
2118 | "question": "The number of zero elements in the adjacency matrix of an undirected graph with n vertices and e edges is ____",
2119 | "A": "2e",
2120 | "B": "n^2-e",
2121 | "C": "n^2-2e",
2122 | "D": "e",
2123 | "category": 1,
2124 | "id": 235
2125 | },
2126 | {
2127 | "question": "A balanced binary tree with a depth of k in which every internal node has a balance factor of 0 has a total of ____ nodes.",
2128 | "A": "2^(k-1)-1",
2129 | "B": "2^k-1",
2130 | "C": "2^k",
2131 | "D": "2^(k-1)+1",
2132 | "category": 1,
2133 | "id": 236
2134 | },
2135 | {
2136 | "question": "The correct statement among the following is _____.",
2137 | "A": "The shortest path from the source point to the destination point is unique.",
2138 | "B": "For a directed graph G, if starting from any vertex and performing a depth-first or breadth-first search can visit every vertex, then the graph must be a complete graph.",
2139 | "C": "Topological sorting is a sorting of nodes based on the earliest occurrence time of each node event in the AOE network.",
2140 | "D": "If vertex a is before vertex b in the topological sequence of directed graphs, there must be arcsin the graph.",
2141 | "category": 0,
2142 | "id": 237
2143 | },
2144 | {
2145 | "question": "Given that there are 375,000 records stored on a disk and a 5-way balanced merge sort is being performed with a working area in memory that can hold 600 records, how many rounds of balanced merging are needed to sort all the records?",
2146 | "A": "3",
2147 | "B": "4",
2148 | "C": "5",
2149 | "D": "6",
2150 | "category": 1,
2151 | "id": 238
2152 | },
2153 | {
2154 | "question": "AVL tree is a balanced binary search tree, in which any node in the tree has the following characteristic ____",
2155 | "A": "The degree of the left and right trees is the same",
2156 | "B": "The absolute value of the degree difference between the left and right trees does not exceed 1%",
2157 | "C": "The degree of the left and right trees is equal to the degree of the right tree",
2158 | "D": "The degree of the left tree is equal to the degree of the right tree",
2159 | "category": 0,
2160 | "id": 239
2161 | },
2162 | {
2163 | "question": "A binary tree has n nodes. In the binary linked list representation of this tree, the number of null pointer fields is ____",
2164 | "A": "n-1",
2165 | "B": "n+1",
2166 | "C": "n",
2167 | "D": "2n",
2168 | "category": 1,
2169 | "id": 240
2170 | },
2171 | {
2172 | "question": "Among the following four sorting algorithms, which one has the highest space complexity?",
2173 | "A": "Heap sort",
2174 | "B": "Merge sort",
2175 | "C": "Bubble sort",
2176 | "D": "Insertion sort",
2177 | "category": 0,
2178 | "id": 241
2179 | },
2180 | {
2181 | "question": "When storing data, not only the values of each element need to be stored, but also the ______.",
2182 | "A": "data element type",
2183 | "B": "data manipulation methods",
2184 | "C": "relationships between data elements",
2185 | "D": "All wrong",
2186 | "category": 0,
2187 | "id": 242
2188 | },
2189 | {
2190 | "question": "One of the characteristics that differentiates B+ tree from B tree is ____",
2191 | "A": "The nodes contain key values",
2192 | "B": "The root node has at least two branches",
2193 | "C": "All leaf nodes are on the same level",
2194 | "D": "It supports sequential search",
2195 | "category": 0,
2196 | "id": 243
2197 | },
2198 | {
2199 | "question": "Sorting 5 data requires a maximum of ____ comparisons.",
2200 | "A": "5",
2201 | "B": "10",
2202 | "C": "20",
2203 | "D": "25",
2204 | "category": 1,
2205 | "id": 244
2206 | },
2207 | {
2208 | "question": "After the end of each sort, it is uncertain which element can be selected and placed in its final position is ____",
2209 | "A": "heap sort",
2210 | "B": "bubble sort",
2211 | "C": "Hill sort",
2212 | "D": "quick sort",
2213 | "category": 0,
2214 | "id": 245
2215 | },
2216 | {
2217 | "question": "Which of the following situations would result in the most number of comparisons in bubble sort when sorting n different numbers in ascending order?",
2218 | "A": "Already sorted in descending order ",
2219 | "B": "Already sorted in ascending order",
2220 | "C": "Elements are in random order",
2221 | "D": "Elements are nearly sorted",
2222 | "category": 0,
2223 | "id": 246
2224 | },
2225 | {
2226 | "question": "The incorrect statement about graph traversal is ____.",
2227 | "A": "All wrong",
2228 | "B": "If a depth-first traversal is performed starting from any vertex in an undirected graph, all vertices in the graph can be visited, so the graph must be connected.",
2229 | "C": "Breadth-first traversal of a graph is a recursive process.",
2230 | "D": "In depth-first search of a graph, a queue is generally used to temporarily store the recently visited vertices.",
2231 | "category": 0,
2232 | "id": 247
2233 | },
2234 | {
2235 | "question": "The incorrect statement about graph traversal is ____.",
2236 | "A": "The breadth-first search tree of a graph is unique.",
2237 | "B": "If a depth-first traversal is performed starting from any vertex in an undirected graph, all vertices in the graph can be visited, so the graph must be connected.",
2238 | "C": "All wrong",
2239 | "D": "In depth-first search of a graph, a queue is generally used to temporarily store the recently visited vertices.",
2240 | "category": 0,
2241 | "id": 248
2242 | },
2243 | {
2244 | "question": "If the initial record key sequence is (345, 53, 67, 9, 62), how many rounds of allocation and collection are needed to make the initial key sequence into an ordered sequence using radix sort?",
2245 | "A": "1",
2246 | "B": "4",
2247 | "C": "3",
2248 | "D": "2",
2249 | "category": 1,
2250 | "id": 249
2251 | }
2252 | ]
--------------------------------------------------------------------------------