Copy data structure

key point is

  1. need to use Hash Map table to store original, copy pair to avoid duplicate
  2. During copy, expand the node, and generate the neighbors( relationship)

HashMap 用于记录对应关系, 应用:

  1. deep copy link list with random pointer

results matching ""

    No results matching ""