官术网_书友最值得收藏!

Summary

We covered a few basic data structures and the algorithms for manipulating them. In addition to this, we also found out their running time complexities. To summarize this, an array provides you with the fastest random access there is with this time complexity: O(1). But arrays cannot change size; the only modification they allow is to change the value of an element. A linked list allows fast append at the end and insertion at the beginning at O(1) time. However, O(1) removal is only available for removing the first element. This is resolved by a doubly linked list that also allows O(1) removal from the end. A circular linked list holds a reference to the first element in the next reference of the last element. This makes the list a circular structure that allows one to loop indefinitely.

In the upcoming chapters, we will discuss the abstraction of data structures called abstract data types. We will use the data structures we have seen in this chapter to implement the abstract data types, which in turn will be used in later chapters.

主站蜘蛛池模板: 莲花县| 句容市| 当雄县| 肥乡县| 石泉县| 平罗县| 迭部县| 宣城市| 明水县| 海南省| 方正县| 马尔康县| 墨脱县| 南京市| 黔西县| 固始县| 巧家县| 宁安市| 巴南区| 望奎县| 将乐县| 永登县| 黄骅市| 无极县| 钟祥市| 柳江县| 秦安县| 油尖旺区| 隆安县| 那坡县| 西安市| 西吉县| 施秉县| 汉川市| 长汀县| 潞城市| 合水县| 永顺县| 中阳县| 贡山| 陇西县|