玩轉數據結構(五)數組棧和鏈表棧性能對比

在以前的博客中,分別實現了基於數組的棧和基於鏈表的棧。java 下面來使用代碼對比咱們本身實現的棧的性能差別:數組 private static double testStack(Stack<Integer> s, int opCnt) { long startTime = System.nanoTime(); for (int i = 0; i < opCnt;
相關文章
相關標籤/搜索