Uploaded by zelalemhab15

lab 02 array

advertisement
Addis Ababa institute of Technology
School of Information Technology and Engineering
Lab 2 (Array)
1. Write your own implementation of the array data structure using python list.
(Hint object-oriented implementation would make things easier for you)
2. Write a Python program to create an array of 5 integers and display the array items. Access
individual element through indexes
3. Write a Python program to append a new item to the end of the array
4. Write a Python program to reverse the order of the items in the array.
5. Write a Python program to get the length in bytes of one array item in the internal
representation
6. Build a vector (the 1D matrix if you have forgotten) manipulation on top of your array
implementation. Your vector class should be able to compute scalar vector multiplication, dot
product, and angle between two vectors.
Download