C++單鏈表實現

明天考試,今天手寫個單鏈表試試水。 原本覺得挺簡單的,沒想到仍是寫了兩個小時。一開始打算用模板類結果不太會用瘋狂報錯,最後只能搞個int型的。 只放代碼。 和用vector寫的程序對拍事後是正確的。c++ #include <bits/stdc++.h> using namespace std; typedef long long ll; class List; class Node //節點類
相關文章
相關標籤/搜索