I want to Find whether an array is subset of another array or not and one of the method i can think of doing it is using Hashtable but i want to implement it in python. Attached in the thread is the c++ implementation. I'm not looking for built in functions here like set etc..
Python only has concept of dictionary in terms of hashtables but not sure how to proceed from here. Any suggestions would help me solve it.
Below are couple of lists:
arr1[] = [11, 1, 13, 21, 3, 7]
arr2[] = [11, 3, 7, 1]
Method (c++ Use Hashing)
1) Create a Hash Table for all the elements of arr1[].
2) Traverse arr2[] and search for each element of arr2[] in the Hash Table. If element is not found then return 0.
3) If all elements are found then return 1.
Lists can be million of numbers as well so a scalable and efficiet solution is expected.