the correctness of the methods in the array-based implementation follows immediately from the definition of the methods themselves there isneverthelessa mildly interesting point here involving the implementation of the pop method note that we could have avoided resetting the old [tto null and we would still have correct method there is trade-off in being able to avoid this assignment should we be thinking about implementing these algorithms in javahowever the trade-off involves the java garbage collection mechanism that searches memory for objects that are no longer referenced by active objectsand reclaims their space for future use (for more detailssee section let [tbe the top element before the pop method is called by making [ta null reference