3 F
Node constructor is running...
Linklist constructor is running...
Node constructor is running...
Node constructor is running...
After Insert
3 F
2 B
1 C
Node Allocation:3
Node constructor is running...
An independent node created
Node Allocation:4
Node destructor is running...
Linklist destructor is running...
Node destructor is running...
Node destructor is running...
Node destructor is running...
可以看到,程序的运行结果和程序16.1的结果一样,但是链表结点类没有程序16.1中那么繁琐。并且在链表类中完全都是直接访问链表结点类的成员数据,大大减少了调用函数产生的开销,这样执行程序的效率也就得以提高了。










