📄 tr_ll_stack_1.cc
字号:
// file: tr_ll_stack_1.cc//// isip include files//#include "train_link_list.h"#include "train_link_list_constants.h"// method: pop_cc//// arguments: none//// return: a Train_Link_node* containing the head of the list//// this method removes and returns the node at the head of the linked// list and connects the list accordingly//Train_Link_node* Train_Link_list::pop_cc() { // dummy variable // Train_Link_node* node = head_d; // remove the head node and move the links up // if (head_d != (Train_Link_node*)NULL) { head_d = head_d->get_next_cc(); node->set_next_cc((Train_Link_node*)NULL); } // check if there are any nodes left // if (head_d != (Train_Link_node*)NULL) { head_d->set_prev_cc((Train_Link_node*)NULL); } else { curr_d = head_d; } // return node and exit gracefully // return node;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -