//nyoj511移動小球
#include
#include
typedef struct node
lnode;//結點
lnode *creat_list(lnode *head, int num)//建立不帶頭結點的雙迴圈鍊錶
current->data = i;
current->rear = current->pre = null;
phead->rear = current;
current->pre = phead;
phead = current;
}current->rear = head;//建立完成後將鍊錶的首和尾鏈結起來
head->pre = current;
return head;
}lnode *move_a_list(lnode *head, int x, int y)
lnode *move_b_list(lnode *head, int x, int y)
void print_q_list(lnode *head, int x, int y)
/*void print_list(lnode *head)
}*/int main()
head->data = 1;
head->rear = head->pre = null;//在主函式裡建立第乙個結點,注意這裡是賦為null
while(n--)
}// print_list(head);
return 0;
}
雙迴圈鍊錶
include include include include include include using namespace std typedef int elemtype typedef struct node linknode,linklist 鍊錶初始化 linklist initlink...
雙迴圈鍊錶的相關演算法
include include using namespace std typedef int elemtype typedef struct node nodetype nodetype create return head void dis nodetype head while p head ...
資料結構(C ) 雙迴圈鍊錶
include allhead.h templateclass dblist templateclass dblistnode dblistnode t x,dblistnode pt null,dblistnode nt null templateclass dblist dblist statu...