Skip to content

Instantly share code, notes, and snippets.

@KevinKu
Last active February 12, 2016 06:58
Show Gist options
  • Save KevinKu/fe7b0c0a9b8d8f133986 to your computer and use it in GitHub Desktop.
Save KevinKu/fe7b0c0a9b8d8f133986 to your computer and use it in GitHub Desktop.
第一行是用來給list的長度 例如6 就會去create一個有6個node的list
然後測試資料是每三行讀一組
第一行空格
第二行與第三行為要交換的node
要交換的node必須以$head->...->next來表示
例如 $head->next就代表第二個node
$head->next->next為第三個node
https://github.com/KevinKu/2016-winter-course/blob/master/test1/test_simple_data
為例子
4 -------------->要測試的list的大小
$head->next -------------->第一筆測試資料要交換的其中一個node 這邊是要交換第二個node與第三個
$head->next->next -------------->
-------------->每筆測試資料中間都要有空行 測資是以三行為一個單位執行的
$head -------------->
$head->next -------------->這邊是交換第一個和第二個node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment