2.25数据结构作业

cs 复制代码
//1
seqn[tail] = data;
tail = (tail+1)%SEQLEN;

//2
data = seqn[head];
head = (head+1)%SEQLEN;

//3
head = tail;

//4
(tail+1)%SEQLEN == head;

//5
while(head != tail)
{
    tail--;
}

//6
(tail-head+SEQLEN)%SEQLEN;

//7
SEQLEN-1
cs 复制代码
//1
new->next = next;
prev->next = new;

//2
struct list_head* new = prev->next;
prev->next = new->next;
free(new);  new=NULL;

//3
struct list_head* p=head;
while(p->next != NULL)
{
    p=p->next;
}
new->next = p->Next;
p->next = new;

//4
struct list_head* p = head;
while(p->next != entry && p->next != NULL)
{
    p=p->next;
}
p->next = p->next->next;
free(entry); entry=NULL;

//5
if(head->next == NULL)
{
    printf("队列为空\n");
    return 1;
}
else
{
    return 0;
}
相关推荐
小妖6662 小时前
js 实现快速排序算法
数据结构·算法·排序算法
独好紫罗兰5 小时前
对python的再认识-基于数据结构进行-a003-列表-排序
开发语言·数据结构·python
wuhen_n5 小时前
JavaScript内置数据结构
开发语言·前端·javascript·数据结构
2401_841495645 小时前
【LeetCode刷题】二叉树的层序遍历
数据结构·python·算法·leetcode·二叉树··队列
独好紫罗兰5 小时前
对python的再认识-基于数据结构进行-a002-列表-列表推导式
开发语言·数据结构·python
2401_841495646 小时前
【LeetCode刷题】二叉树的直径
数据结构·python·算法·leetcode·二叉树··递归
数智工坊6 小时前
【数据结构-树与二叉树】4.5 线索二叉树
数据结构
数智工坊6 小时前
【数据结构-树与二叉树】4.3 二叉树的存储结构
数据结构
独好紫罗兰7 小时前
对python的再认识-基于数据结构进行-a004-列表-实用事务
开发语言·数据结构·python
铉铉这波能秀7 小时前
LeetCode Hot100数据结构背景知识之列表(List)Python2026新版
数据结构·leetcode·list