top function implemented
top function returns the top most element of the array
Please enter the commit message for your changes. Lines starting