Lab 5

  1. Write a Python class that simulates a Stack. The class should implement methods like push, pop, peek (the last two methods should return None if no element is present in the stack).

  2. Write a Python class that simulates a Queue. The class should implement methods like push, pop, peek (the last two methods should return None if no element is present in the queue).

  3. Write a Python class that simulates a matrix of size NxM, with N and M provided at initialization. The class should provide methods to access elements (get and set methods) and some mathematical functions such as transpose, matrix multiplication and a method that allows iterating through all elements from a matrix an apply a transformation over them (via a lambda function).