Data Structure and Algorithms Analysis in C Note (II) WIP

No routine should exceed a page.

Modularity' s advantages:

  • Much easier to debug small routines than big ones
  • Work simultaneously
  • Places certain dependencies in only one routine, making changes easier

An ADT is a set of operations; ADTs are mathematical abstractions; nowhere in an ADT's definition is there any mention of how the set of operations is implemented.

Operations for the set ADT:

  • Union
  • Intersection
  • Size
  • Complement

The List ADT

Empty list—the special list of size 0.

Operations:

    Find—returns the position of the 1st occurrence of a key;

    Insert and Delete—insert and delete some key from some position in the list

    Find kth—returns the element in some position (specified as argument)

    Next and Previous—take a position as argument and return the position of the successor and predecessor, rsp.

猜你喜欢

转载自www.cnblogs.com/Hu-Yan/p/8908927.html
今日推荐