<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Sets and Maps
In this chapter we will look at the implementations of some of the Python's built-in abstract data types, sets and dictionaries, like we did in previous chapters. 
Sets
Unlike Bag ADT we defined in chapter 1, Set ADT -container- stores unique values and represents the same structure found in mathematics. 
The Set Abstract Data Type
We will implement the Set abstract data type using list for this chapter, later chapters will provide more implementations and we will evaluate them. 
You can see the implemented Set ADT in linearset.py
Now let's try our implementation, if it's working or not.
Step1:  Maps
Searching for data items based on unique key values is a very common application in computer science. ADT for this is often called Map or Dictionaries. It's is like database entities we store id/key for every value.
In this section we define our own Map ADT and then provide an implementation using a list, later we will implement and evaluate the map using a variety of data structures. 
Map ADT implementation can be found linearmap.py.
Multi-Dimensional Arrays
Multi-dimensional arrays are with more than 2 dimensional arrays. In fact we can build as many dimensionsion as we want. 
Data Organization
Array Storage
<ASSISTANT_TASK:>
Python Code:
from linearset import Set
smith = Set()
smith.add("CSCI-112")
smith.add("MATH-121")
smith.add("HIST-340")
smith.add("ECON-101")
robert = Set()
robert.add('POL-101')
robert.add('ANTH-230')
robert.add('CSCI-112')
robert.add('ECON-101')
if smith == robert:
    print("Smith and Robert are taking the same courses.")
else:
    sameCourses = smith.intersect(robert)
    if sameCourses.isEmpty():
        print("Smith and Robert are not taking any of classes together.")
    else:
        print("Smith and Robert are taking some of the same courses")
        for course in sameCourses:
            print(course)
Explanation: Sets and Maps
In this chapter we will look at the implementations of some of the Python's built-in abstract data types, sets and dictionaries, like we did in previous chapters. 
Sets
Unlike Bag ADT we defined in chapter 1, Set ADT -container- stores unique values and represents the same structure found in mathematics. 
The Set Abstract Data Type
We will implement the Set abstract data type using list for this chapter, later chapters will provide more implementations and we will evaluate them. 
You can see the implemented Set ADT in linearset.py
Now let's try our implementation, if it's working or not.
End of explanation
def func( *args):
    print("number of arguments: ", len(args))
    _sum = 0
    for value in args:
        _sum += value
        
    print ("Sum of the arguments: ", _sum)
func(12)
func(5,8,2)
Explanation: Maps
Searching for data items based on unique key values is a very common application in computer science. ADT for this is often called Map or Dictionaries. It's is like database entities we store id/key for every value.
In this section we define our own Map ADT and then provide an implementation using a list, later we will implement and evaluate the map using a variety of data structures. 
Map ADT implementation can be found linearmap.py.
Multi-Dimensional Arrays
Multi-dimensional arrays are with more than 2 dimensional arrays. In fact we can build as many dimensionsion as we want. 
Data Organization
Array Storage:
A one-dimensional array is commonly used  to physically store arrays of higher dimensions. How can the individual elements of the 2D table be stored in the one-dimensional structure while maintaining direct access to the individual table elements?
row-major order
column-major order
In row-major order, the individual rows are stored sequentially, on at a time. 
Index Computation:
Since multi-dimensional arrays are created and managed by instrictions in the programming language, accessing an individual element must also be handled by the language. Given a 2D array of size mxn and using row-major ordering, an equation can be derived to computer this offset.
index(i1, i2, .... , in) = i1 * f1 + i2 * f2 + ... + i(n-1) * f(n-1) + in * fn\
End of explanation
<END_TASK>