Write a program implementing a stack data structure, implement your solutions using approaches below
a) the pythonds package(stack)
b)the numpy package(arrays)
C)(queue.Queue and or collections.deque
1 insert the names of big five animals (arrange them in order of size=>as follows Elephant (approximately 5tonnes+) rhinoceros (approximately 2tonnes) buffalo (650kg),lion(225kg),and leopard (96kg)
2) return the name elephant
3)return the name leopard infinitely
4) display the index of the animal elephant and lion after searching
5) return the first and last element (name of animal) when the elements are sorted in ascending order
Comments
Leave a comment