我正在阅读算法设计手册,在第 3 章中,出现了以下代码片段。它与从链表中删除项目有关。这个问题与数据结构无关,而仅与我认为声明了两个变量的一行代码有关。为简洁起见,我删除了代码中不相关的部分。
list *search_list(list *l, item_type x) {
// This function just searches the list x
}
list *predecessor_list(list *l, item_type x) {
// This function simply returns the predecessor of x or NULL
}
delete_list(list **l, item_type x) {
list *p; /* item pointer */
list *pred; /* predecessor pointer */
list *search_list(), *predecessor_list(); // What are these declarations?
p = search_list(*l,x);
// Code to delete the node if found is here
}
Run Code Online (Sandbox Code Playgroud)
我的问题是在delete_list function …