Stack Push And Pop Algorithm