DS2数据结构课件.pptVIP

  • 9
  • 0
  • 约1.04万字
  • 约 51页
  • 2017-06-21 发布于湖北
  • 举报
DS2数据结构课件

Deleting from the front of the list is a special case, because it changes the start of the list; careless coding will lose the list; The wrong code: free(L); The right one: p=L; L=L-next; free(p); A1 A2 A3 A4 ^ L × p A1 A2 A3 A4 ^ p q A third problem concerns deletion in general. Although the pointers moves above are simple, the deletion algorithm requires us to keep track of the cell before the one that we want to delete. Improve our linked list It turns out that one simple change solves all problems. We will keep a sentinel node, which is sometimes referr

文档评论(0)

1亿VIP精品文档

相关文档