In this post, we will see Associative Array | PPL | Sebesta | Elementary Data Types in Programming Language | array types, data types in ppl, data types ppl, elementary data types in programming language, ppl, sebesta,associative array
6. Associative Arrays
An associative array is an unordered collection of data
elements that are indexed by an equal number of values called keys. (Key-Value Pairs)
Associative arrays are supported directly by Perl,
Python, Ruby, and Lua and by the standard class libraries of Java,
C++, C#, and F#.
e.g.
1. Java
In Java, Associative Arrays are implemented by Map
interface and its classes HashMap, LinkedHashMap, TreeMap.
2. Perl
In Perl, associative arrays are called hashes.
%salaries = ("Gary"
=> 75000, "Perry" => 57000,
"Mary" => 55750,
"Cedric" => 47850);
3. Python
Python’s associative arrays, which are called dictionaries.
statecapital = {
"Maharashtra": "Mumbai",
"Karnataka": "Bangalore",
"Telangana": "Hyderabad"
}
Watch following video:
Watch on YouTube: https://www.youtube.com/watch?v=esvDi1YSERY
No comments:
Post a Comment