Exercises 2
(1) the following exercises are only for your references
1-1 Describe the advantages and disadvantages of the sequence storage structure (顺序存储结构)
and the linked storage structure (链式存储结构); the difference among the head pointer, the first
node and the first element node. Outline the characteristics of an ordered list (有序表), and the
similarities and differences between a vector (向量 or 数组) and an ordered table, the functions (功
能)of the head pointer variables and the head node.
1-2 Design an algorithm to delete ith element in a vector, and estimate its time efficiency.
1-3 Try to design an algorithm for getting the node number and deleting the first node in a circular
linked list (循环链表).
1-4 Knowing that the elements in the linear list L= (a1, a2, …, an) is ordered increasingly, and using
a vector to store data, try to writing an algorithm to delete the elements between c and d (c≦d) in
the linear list L= (a1, a2, …, an).
1-5 Assuming that the length of a circular linked list is larger than 1, which has no head node or
head pointer, p is a pointer to some node in the circular linked list, try to write an algorithms to
delete the precursor node (直接前趋结点) of the node pointed by p.
1-6 In a double linked list (双向链表), implement the following basic operations for the double
linked list: ①Initialize; ②Locate; ③Insert; ④delete.
1-7 Knowing a linked list as shown in Fig.1.1, try to write an algorithm to make a backup for the
linked list.
cpp线性表
最新推荐文章于 2024-11-03 21:27:26 发布