![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
FeoniXCeb
这个作者很懒,什么都没留下…
展开
-
剑指offer 67.把字符串转换为整数
【C++】剑指offer 67. 把字符串转换成整数算法流程:先将字符串中最开始满足要求的数字字符串提取出至 tmp(提取过程判断正负号,提取出的字符串不带符号,有前缀0)在循环外去除前缀0然后根据位数判断是否有匹配或越界当 位数 == 0,说明无匹配情况,返回0当 位数 > 10,再根据符号返回INT_MAX或INT_MIN;若 位数 == 10,根据string类自带的 > 比较(字典序)先判断符号正号,tmp与字符串类型的INT_MAX("214原创 2022-03-19 12:38:53 · 982 阅读 · 0 评论 -
双链表的创建、遍历、插入、删除
双链表相关操作//双链表的创建,遍历,插入,删除#include<cstdio>#include<cstdlib>typedef int Elemtype;typedef struct DoubleNode { int val; struct DoubleNode *prior, *rear;} DNode;//尾插法创建void Create_tail(DNode* &head, int *arr, int n) { head =原创 2021-11-17 20:59:07 · 204 阅读 · 0 评论