I need to find the smallest value in stack but in constant time, so beacuse of that I can not use "for" loop or "while". I will provide you the code now,