Tai-e-assignments icon indicating copy to clipboard operation
Tai-e-assignments copied to clipboard

Question about A3(DeadCodeDetection)

Open RacerZ-fighting opened this issue 2 years ago • 0 comments

When doing graph traversal, I first chose a LinkedList to maintain all visited nodes. But I can't figure out why there would be a false negative test case.

        List<Stmt> isVisited = new LinkedList<>();
        ArrayDeque<Stmt> queue = new ArrayDeque<>();    // BFS queue
        queue.add(cfg.getEntry());
Snipaste_2023-11-15_13-14-47

Then, if I change to use a HashSet, all test cases will pass.

RacerZ-fighting avatar Nov 15 '23 05:11 RacerZ-fighting