Fujitsu Interview Question

Time complexity of Stack vs Heap