Khai báo nào sau đây là đúng để tạo một map lưu tên (string) và điểm số (int)?
Map 1

Quiz
•
Computers
•
6th Grade
•
Hard
Edu TSmart
Used 1+ times
FREE Resource
31 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
map<string, int> m;
map<int, string> m;
unordered_map<string, int> m;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Giá trị mặc định khi truy cập map["abc"] mà chưa có key "abc" là gì?
Gây lỗi
Chèn "abc" với giá trị mặc định (0 nếu kiểu int)
Bỏ qua không làm gì
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Để đếm tần suất xuất hiện của từng số nguyên trong một mảng, ta nên dùng:
map<int, int>
vector<int>
set<int>
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tính chất nào đúng với map trong C++?
Duy trì thứ tự theo thời gian thêm phần tử
Tự động sắp xếp theo key tăng dần
Không sắp xếp các phần tử
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Giả sử có map
Gán giá trị "abc" cho key 3
Xóa key 3 khỏi map
Gây lỗi vì chưa khởi tạo map
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Cách tốt nhất để kiểm tra một key tồn tại trong map là?
Dùng m[key]
Dùng m.find(key) != m.end()
Dùng m.count(key) > 1
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Câu nào đúng để duyệt qua toàn bộ phần tử trong map
for(auto x : m)
for(int i = 0; i < m.size(); i++)
while(!m.empty())
Create a free account and access millions of resources
Similar Resources on Quizizz
32 questions
TTTHNN_TestLiThuyet

Quiz
•
University
30 questions
Map 2

Quiz
•
6th Grade
30 questions
Lập trình hướng đối tượng

Quiz
•
University
29 questions
TIN HỌC KTRA 15P

Quiz
•
10th Grade - University
30 questions
Tin 10_ ôn tập giữa kì 2

Quiz
•
10th Grade
31 questions
java collections

Quiz
•
University
26 questions
Ôn tập HK2

Quiz
•
10th Grade
26 questions
B13. THUẬT TOÁN TÌM KIẾM

Quiz
•
7th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
20 questions
Final Exam Vocabulary

Quiz
•
6th Grade
11 questions
Decimal/fraction conversions quick check

Quiz
•
5th - 7th Grade
10 questions
Identifying equations

Quiz
•
KG - University
49 questions
How Well Do You Know Your 6th Grade Teachers?

Quiz
•
6th Grade
5 questions
Multiply Decimals

Lesson
•
5th - 6th Grade
10 questions
Adding and Subtracting Decimals

Quiz
•
6th Grade
33 questions
Mechanical Energy Transfer

Quiz
•
6th Grade