摘要: 1.明确在第几个结点后插入 2.找到插入位置的前一个结点 3.交换指针:设插入位置的前一个结点为结点A , 插入的结点为结点B , 插入结点后面的一个节点为结点C (1)结点B指向结点C (2)结点A指向结点B 代码如下: #include<stdio.h> #include<stdlib.h> t 阅读全文
posted @ 2020-07-13 17:02 益生李佳菌 阅读(1849) 评论(0) 推荐(0)
摘要: 链表的知识点,我就不多说了 写这篇文章也是作为一种学习笔记,为了以后复习好用 所以我就简单说一下,我在这边遇到的一些问题和解决方案 1.创建一个链表就是:头指针-->结点1-->结点2-->结点3-->............ 2.新创建一个结点,比如叫它New_node,其实就是在一个地方申请了一 阅读全文
posted @ 2020-07-13 15:11 益生李佳菌 阅读(1534) 评论(1) 推荐(1)
摘要: 问题描述 练习 3-5 编写函数 itob(n, s, b),将整数n转换为以b为底的数,并将转换结果以字符的形式保存到字符串s中。例如,itob(n, s, 16)把整数n格式化成十六进制整数保存在s中。 Write the function itob(n,s,b) that converts t 阅读全文
posted @ 2020-05-21 20:51 益生李佳菌 阅读(518) 评论(0) 推荐(0)
摘要: 问题描述 编写expand(s1,s2),将字符串s1中类似于a-z类的速记符号在字符串s2中扩展为等价的完整列表abc.....xyz。该函数可以处理大小写字母和数字,并可以处理a-b-c,a-z0-9和-a-z等类似的情况。作为前导和尾随的-字符原样排印。 Write a function ex 阅读全文
posted @ 2020-05-17 22:00 益生李佳菌 阅读(712) 评论(0) 推荐(0)
摘要: 问题描述 练习 2-8 编写一个函数rightrot(x, n),该函数返回将x循环右移(即从最右端移出的位将从最左端移入)n(二进制)位后所得到的值。 Write a function rightrot(x,n) that returns the value of the integer x ro 阅读全文
posted @ 2020-05-15 19:30 益生李佳菌 阅读(600) 评论(0) 推荐(0)
摘要: 问题描述 2.6 编写一个函数setbits(x, p ,n, y),该函数返回对x执行下列操作后的结果值: 将x中从第p位开始的n个(二进制)位设置为y中最右边n位的值,x的其余各位保持不变。 Write a function setbits(x,p,n,y) that returns x wit 阅读全文
posted @ 2020-05-11 22:49 益生李佳菌 阅读(632) 评论(0) 推荐(0)
摘要: 问题描述 重新编写函数squeeze(s1,s2),将字符串s1中任何与字符串s2中字符匹配的字符都删除。 Write an alternate version of squeeze(s1,s2) that deletes each character in the string s1 that m 阅读全文
posted @ 2020-05-10 15:52 益生李佳菌 阅读(478) 评论(2) 推荐(1)
摘要: 问题描述 练习2-3 编写函数htoi(s),把由16进制数字组成的字符串(包含可选的前缀0X或0x)转换成与之等价的整形值。字符串中允许包含的数字包括:0 ~ 9, a ~ f,A ~ F。 Write the function htoi(s) , which converts a string 阅读全文
posted @ 2020-05-09 16:36 益生李佳菌 阅读(470) 评论(0) 推荐(0)
摘要: 问题描述 编写一个程序以确定分别由signed及unsigned限定的char、short、int及long类型变量的取值范围。采用打印标准头文件中的相应值以及直接计算两种方式实现 Write a program to determine the ranges of char , short , i 阅读全文
posted @ 2020-05-07 13:15 益生李佳菌 阅读(457) 评论(0) 推荐(1)
摘要: 问题描述 编写一个删除C语言程序中所有的注释语句。要正确处理带引号的字符串与字符常量。在C语言中,注释不允许嵌套。 Write a program to remove all comments from a C program. Don't forget to handle quoted strin 阅读全文
posted @ 2020-05-05 12:40 益生李佳菌 阅读(363) 评论(0) 推荐(0)