[問題] Singly Linked List反轉
開發平台(Platform): (Ex: Win10, Linux, ...)
Win10
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
Dev-C++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
無
問題(Question):
最近在學習Linked List,想實作反轉Linked List,debug許久找不出為何無法印出反轉後的Linked List
餵入的資料(Input):
無
預期的正確結果(Expected Output):
21 -> 15 -> 7 -> 2 -> NULL
2 -> 7 -> 15 ->21-> NULL
錯誤結果(Wrong Output):
21 -> 15 -> 7 -> 2 -> NULL
2 -> NULL
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
https://ideone.com/eWq4t5
補充說明(Supplement):
-----
Sent from JPTT on my iPad
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 119.14.9.131 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1582126120.A.6A5.html
→
02/19 23:32,
5年前
, 1F
02/19 23:32, 1F
→
02/19 23:51,
5年前
, 2F
02/19 23:51, 2F
→
02/19 23:52,
5年前
, 3F
02/19 23:52, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章