使用C++實現鏈表的基本操做

#include <stdio.h> #include <iostream> using namespace std; typedef class List { public: int data; List *next; }node; /* 單鏈表的建立 無參數,輸入任意非0數字建立鏈表,輸入0結束建立 返回head頭指針 存在BUG:第一次輸入0時,內存發生錯誤(已解決,沒法打印
相關文章
相關標籤/搜索