Xem thảo luận Nội dung chính
Cải thiện bài viết Lưu bài viết Xem thảo luận Cải thiện bài viết Lưu bài viết Đọc Bàn luận xyz==>95 100==>abc 11==>100 abc==>pqr3 Bàn luậnHere array() function is used to create associative array. Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 982 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 983 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 984 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 985 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 986 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 982 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 988 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 989 Mảng liên kết được sử dụng để lưu trữ các cặp giá trị chính. Ví dụ, để lưu trữ các dấu hiệu của một môn học khác nhau của một học sinh trong một mảng, một mảng được lập chỉ mục bằng số sẽ không phải là lựa chọn tốt nhất. Thay vào đó, chúng tôi có thể sử dụng các tên chủ đề tương ứng làm các khóa trong mảng kết hợp của chúng tôi và giá trị sẽ là điểm tương ứng của chúng. Ví dụ: Hàm mảng () ở đây được sử dụng để tạo mảng kết hợp.xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 980 xyz==>95 100==>abc 11==>100 abc==>pqr7 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 983 xyz==>95 100==>abc 11==>100 abc==>pqr31 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 985 xyz==>95 100==>abc 11==>100 abc==>pqr35 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 988 xyz==>95 100==>abc 11==>100 abc==>pqr39 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 980____11 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 xyz==>95 100==>abc 11==>100 abc==>pqr1 xyz==>95 100==>abc 11==>100 abc==>pqr3 xyz==>95 100==>abc 11==>100 abc==>pqr7 xyz==>95 100==>abc 11==>100 abc==>pqr8 xyz==>95 100==>abc 11==>100 abc==>pqr9 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 xyz==>95 100==>abc 11==>100 abc==>pqr2 xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr71 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1_______ xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr74 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 980 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr83 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 983 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr18 Output: Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 983
xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr01 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr71 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 985 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72 We can traverse associative arrays using loops. We can loop through the associative array in two ways. First by using for loop and secondly by using foreach. Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9841 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 985 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72We can traverse associative arrays using loops. We can loop through the associative array in two ways. First by using for loop and secondly by using foreach. xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr10 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr7 Here array_keys() function is used to find indices names given to them and count() function is used to count number of indices in associative arrays. xyz==>95 100==>abc 11==>100 abc==>pqr19 Bàn luậnHere array() function is used to create associative array. Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 982 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 983 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 984 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 985 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 986 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 982 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 988 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 989 Mảng liên kết được sử dụng để lưu trữ các cặp giá trị chính. Ví dụ, để lưu trữ các dấu hiệu của một môn học khác nhau của một học sinh trong một mảng, một mảng được lập chỉ mục bằng số sẽ không phải là lựa chọn tốt nhất. Thay vào đó, chúng tôi có thể sử dụng các tên chủ đề tương ứng làm các khóa trong mảng kết hợp của chúng tôi và giá trị sẽ là điểm tương ứng của chúng. xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 980 xyz==>95 100==>abc 11==>100 abc==>pqr7 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 983 xyz==>95 100==>abc 11==>100 abc==>pqr31 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 985 xyz==>95 100==>abc 11==>100 abc==>pqr35 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 988 xyz==>95 100==>abc 11==>100 abc==>pqr39 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 980____11 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 xyz==>95 100==>abc 11==>100 abc==>pqr1 xyz==>95 100==>abc 11==>100 abc==>pqr3 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9829 xyz==>95 100==>abc 11==>100 abc==>pqr7 xyz==>95 100==>abc 11==>100 abc==>pqr8 xyz==>95 100==>abc 11==>100 abc==>pqr9 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 xyz==>95 100==>abc 11==>100 abc==>pqr2 xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr71 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1_______ xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr74 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 980 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr83 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr0 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 983 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr92 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 985 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9829 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9872 Output: xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr01 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr7
Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9841 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 988 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr721 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 988 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr3 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9874 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9876 xyz==>95 100==>abc 11==>100 abc==>pqr3 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9874 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9879 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9880 xyz==>95 100==>abc 11==>100 abc==>pqr72 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9874 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9883 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9874 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9880 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9887 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9888 xyz==>95 100==>abc 11==>100 abc==>pqr72 xyz==>95 100==>abc 11==>100 abc==>pqr70 xyz==>95 100==>abc 11==>100 abc==>pqr10 xyz==>95 100==>abc 11==>100 abc==>pqr75 xyz==>95 100==>abc 11==>100 abc==>pqr7 xyz==>95 100==>abc 11==>100 abc==>pqr1 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 988 xyz==>95 100==>abc 11==>100 abc==>pqr79 xyz==>95 100==>abc 11==>100 abc==>pqr80 xyz==>95 100==>abc 11==>100 abc==>pqr72Here array_keys() function is used to find indices names given to them and count() function is used to count number of indices in associative arrays. xyz==>95 100==>abc 11==>100 abc==>pqr08 xyz==>95 100==>abc 11==>100 abc==>pqr18 Output: xyz==>95 100==>abc 11==>100 abc==>pqr Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 98 Looping using foreach: Student one got 95 in Maths Student one got 90 in Physics Student one got 96 in Chemistry Student one got 93 in English Student one got 98 in Computer Looping using for: Maths 95 Physics 90 Chemistry 96 English 93 Computer 9807 xyz==>95 100==>abc 11==>100 abc==>pqr72 PHP // Ví dụ về mảng kết hợp $ family = mảng ("cha" => "mohan", "mẹ" => "sita", "con trai" => "raj", "con gái" => "mona"); // Phương thức đầu tiên để đi qua mảng kết hợp foreach ($ family as $ key => $ value) {echo $ key. ' là '. $ giá trị; echo ''; }?>foreach($family as $key=>$value) { echo $key .' is '.$value; echo ''; } ?>foreach($family as $key=>$value) { echo $key . ' is '. $value; echo ' Mảng số - một mảng có chỉ số số.Các giá trị được lưu trữ và truy cập theo kiểu tuyến tính.Mảng liên kết - một mảng có chuỗi là chỉ mục.Điều này lưu trữ các giá trị phần tử kết hợp với các giá trị chính thay vì theo thứ tự chỉ mục tuyến tính nghiêm ngặt. Mảng liên kết được sử dụng để lưu trữ các cặp giá trị chính.Ví dụ, để lưu trữ các dấu hiệu của một môn học khác nhau của một học sinh trong một mảng, một mảng được lập chỉ mục bằng số sẽ không phải là lựa chọn tốt nhất.to store the marks of different subject of a student in an array, a numerically indexed array would not be the best choice.to store the marks of different subject of a student in an array, a numerically indexed array would not be the best choice. Trong khoa học máy tính, một mảng kết hợp, bản đồ, bảng ký hiệu hoặc từ điển là một loại dữ liệu trừu tượng lưu trữ một bộ sưu tập các cặp (khóa, giá trị), sao cho mỗi khóa có thể xuất hiện nhiều nhất một lần trong bộ sưu tập.an abstract data type that stores a collection of (key, value) pairs, such that each possible key appears at most once in the collection.an abstract data type that stores a collection of (key, value) pairs, such that each possible key appears at most once in the collection. |