摘要
在数据结构中,两结点的位置交换是常用到的一种操作,常规方法是交换两结点的指针域中指针所指向的位置,如用部分代替整体的原则,只交换结点的数据域,效果将会更加理想。本文对两种不同的交换方式从时间复杂度、空间复杂度进行了比较,得出运用部分代替整体的原则来进行两结点的数据域交换具有强大的优势的结论——大大节约了运行时间,减少了辅助空间,并且与分布式传感器网络结合起来,从而提高了整个DW SN的效率。
In data structure, it is a common operation to exchange the position of two nodes, which is practiced by exchanging the places of the two nodes in the Pointer-field. But it would be much better if the datafield of the nodes is just exchanged under the guidance of the principle of part for whole. This article compares the two kinds of different methods from Time-complexity and Space-complexity and concludes that to exchange the data-field of two nodes under the principle of part for whole has great advantage, which can save operating time and auxiliary space greatly.
出处
《现代计算机》
2007年第3期9-11,共3页
Modern Computer
关键词
结点
指针
指针域
分布式传感器网络
Node
Pointer
Pointer-Field
Distributed Sensor Network