contributed by < cyrong >
實作過程
為了讓 q_size 以及 q_insert_tail 時間複雜度為 $O(1)$
修改 queue.h
新增 size 以及 tail 兩個元素
/* Queue structure */
typedef struct {
list_ele_t *head; /* Linked list of elements */
Are you sure to leave this team?
Once you delete your team, all team notes will be deleted and cannot be recovered. Please ensure you've exported or transfered these notes.
Enter team name before deleting it:
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up