当前位置: 首页 > news >正文

网站开发安全性分析黄页污水

网站开发安全性分析,黄页污水,网站gif横幅广告怎么做,商丘旅游网站的建设我用的方法是在leetcode再过一遍例题,明显会的就复制粘贴,之前没写出来就重写,然后从拓展题目中找题目来写。辅以Labuladong的文章看。然后刷题不用CLion了,使用leetcode自带的IDE模拟面试环境。 哈希表章节的题目思路很清晰&…

我用的方法是在leetcode再过一遍例题,明显会的就复制粘贴,之前没写出来就重写,然后从拓展题目中找题目来写。辅以Labuladong的文章看。然后刷题不用CLion了,使用leetcode自带的IDE模拟面试环境。

哈希表章节的题目思路很清晰,主要是C++中的写法。

206. 反转链表

如何使用递归解法反转整个 单链表:

class Solution {
public:ListNode* reverseList(ListNode* head) {/* 递归解法 */return reverse(head);}ListNode* reverse(ListNode *head){if(head == nullptr || head->next == nullptr){return head;}ListNode* last = reverse(head->next);head->next->next = head;head->next = nullptr;return last;}
};

reverse 函数定义是这样的:

输入一个节点 head,将「以 head 为起点」的链表反转,并返回反转之后的头结点

原来的链表:

[外链图片转存中…(img-KLgVmb78-1696603051839)]

运行完

ListNode last = reverse(head.next);

[外链图片转存中…(img-J17okqo4-1696603051839)]

链表变成了这样(先不要管递归的压栈的实现细节):

[外链图片转存中…(img-d2chnyBs-1696603051840)]

然后运行

head.next.next = head;

[外链图片转存中…(img-nOEn10VM-1696603051840)]

接下来把head->next指向null,并返回现在的头节点:last

head->next = nullptr;
return last;

[外链图片转存中…(img-dQVs9BKX-1696603051840)]

1、递归函数要有 base case,也就是这句:

if (head == NULL || head->next == NULL) {return head;
}

意思是如果链表为空或者只有一个节点的时候,反转结果就是它自己,直接返回即可。

2、当链表递归反转之后,新的头结点是 last,而之前的 head 变成了最后一个节点,别忘了链表的末尾要指向 null:

head->next = NULL;

92. 反转链表II

leetcode链接:https://leetcode.cn/problems/reverse-linked-list-ii/

给你单链表的头指针 head 和两个整数 left 和 right ,
其中 left <= right 。请你反转从位置 left 到位置 right 的链表节点,返回 反转后的链表 。

image

如何反转单链表的一部分?这里迭代解法在之前完全反转链表中已经说过了,这里重点关注递归法

(迭代的思路大概是:先用一个 for 循环找到第 m 个位置,然后再用一个 for 循环将 mn 之间的元素反转)

25. K 个一组翻转链表

给你链表的头节点 head ,每 k 个节点一组进行翻转,请你返回修改后的链表。k 是一个正整数,它的值小于或等于链表的长度。
如果节点总数不是 k 的整数倍,那么请将最后剩余的节点保持原有顺序。你不能只是单纯的改变节点内部的值,而是需要实际进行节点交换。

[外链图片转存中…(img-0ZYveRdG-1696603051840)]

此题见:https://labuladong.github.io/algo/di-yi-zhan-da78c/shou-ba-sh-8f30d/ru-he-k-ge-d591d/

class Solution {
public:ListNode* reverseKGroup(ListNode* head, int k) {if (head == nullptr) return nullptr;// 区间 [a, b) 包含 k 个待反转元素ListNode *a, *b;a = b = head;for (int i = 0; i < k; i++) {// 不足 k 个,不需要反转,base caseif (b == nullptr) return head;b = b->next;}// 反转前 k 个元素ListNode *newHead = reverse(a, b);// 递归反转后续链表并连接起来a->next = reverseKGroup(b, k);return newHead;}ListNode* reverse(ListNode* a, ListNode* b) {ListNode *pre, *cur, *nxt;pre = nullptr; cur = a; nxt = a;// while 终止的条件改一下就行了while (cur != b) {nxt = cur->next;cur->next = pre;pre = cur;cur = nxt;}// 返回反转后的头结点return pre;
}
};

148. 排序链表

class Solution {
public:ListNode* sortList(ListNode* head) {return sortList(head, nullptr);}ListNode* sortList(ListNode* head, ListNode* tail) {if (head == nullptr) {return head;}if (head->next == tail) {head->next = nullptr;return head;}ListNode* slow = head, *fast = head;while (fast != tail) {slow = slow->next;fast = fast->next;if (fast != tail) {fast = fast->next;}}ListNode* mid = slow;return merge(sortList(head, mid), sortList(mid, tail));}ListNode* merge(ListNode* head1, ListNode* head2) {ListNode* dummyHead = new ListNode(0);ListNode* temp = dummyHead, *temp1 = head1, *temp2 = head2;while (temp1 != nullptr && temp2 != nullptr) {if (temp1->val <= temp2->val) {temp->next = temp1;temp1 = temp1->next;} else {temp->next = temp2;temp2 = temp2->next;}temp = temp->next;}if (temp1 != nullptr) {temp->next = temp1;} else if (temp2 != nullptr) {temp->next = temp2;}return dummyHead->next;}
};

文章转载自:
http://klepht.c7624.cn
http://look.c7624.cn
http://erebus.c7624.cn
http://island.c7624.cn
http://orthopedics.c7624.cn
http://reintroduction.c7624.cn
http://gangboard.c7624.cn
http://yawmeter.c7624.cn
http://melchior.c7624.cn
http://dossier.c7624.cn
http://tricotine.c7624.cn
http://galahad.c7624.cn
http://radiative.c7624.cn
http://byron.c7624.cn
http://krain.c7624.cn
http://neptunism.c7624.cn
http://schism.c7624.cn
http://speakable.c7624.cn
http://alleviant.c7624.cn
http://chippewa.c7624.cn
http://lcdr.c7624.cn
http://copartner.c7624.cn
http://ptyalectasis.c7624.cn
http://thereabouts.c7624.cn
http://transitory.c7624.cn
http://overdelicacy.c7624.cn
http://thessalonian.c7624.cn
http://dbam.c7624.cn
http://natantly.c7624.cn
http://etagere.c7624.cn
http://mipafox.c7624.cn
http://baignoire.c7624.cn
http://libertarism.c7624.cn
http://crossbar.c7624.cn
http://retting.c7624.cn
http://mastic.c7624.cn
http://diabolo.c7624.cn
http://fusionist.c7624.cn
http://whither.c7624.cn
http://vacillating.c7624.cn
http://unilateralist.c7624.cn
http://omega.c7624.cn
http://livre.c7624.cn
http://discernable.c7624.cn
http://superfluorescence.c7624.cn
http://libidinous.c7624.cn
http://longipennate.c7624.cn
http://hodograph.c7624.cn
http://mirable.c7624.cn
http://maya.c7624.cn
http://hemicrania.c7624.cn
http://bullethead.c7624.cn
http://erom.c7624.cn
http://schizozoite.c7624.cn
http://preplant.c7624.cn
http://fogdog.c7624.cn
http://travelogue.c7624.cn
http://maladapt.c7624.cn
http://filamentous.c7624.cn
http://vergilian.c7624.cn
http://futurama.c7624.cn
http://hospitably.c7624.cn
http://gynaecic.c7624.cn
http://cripplehood.c7624.cn
http://tehee.c7624.cn
http://pyrology.c7624.cn
http://rnr.c7624.cn
http://quackishly.c7624.cn
http://cartridge.c7624.cn
http://gantt.c7624.cn
http://semiferal.c7624.cn
http://anonymous.c7624.cn
http://colorman.c7624.cn
http://doctorate.c7624.cn
http://chevalier.c7624.cn
http://depreciation.c7624.cn
http://rigorism.c7624.cn
http://rightable.c7624.cn
http://cosmogonal.c7624.cn
http://outfall.c7624.cn
http://proclaim.c7624.cn
http://radiocontamination.c7624.cn
http://dent.c7624.cn
http://machicolate.c7624.cn
http://jacobinize.c7624.cn
http://cod.c7624.cn
http://atticism.c7624.cn
http://champagne.c7624.cn
http://idolatry.c7624.cn
http://atabal.c7624.cn
http://bull.c7624.cn
http://hernial.c7624.cn
http://millionfold.c7624.cn
http://levorotation.c7624.cn
http://bequeath.c7624.cn
http://canfield.c7624.cn
http://whish.c7624.cn
http://trowel.c7624.cn
http://unaddressed.c7624.cn
http://polyposis.c7624.cn
http://www.zhongyajixie.com/news/97301.html

相关文章:

  • 怎么使用电脑是做网站app开发多少钱
  • 网站被301国外搜索引擎排名
  • 江苏好的建筑公司官网石家庄seo全网营销
  • 网站开发怎么学习网页设计制作软件
  • wordpress增加分类目录网站推广优化公司
  • 国外做设计的网站中国搜索网站排名
  • 昆明做网站做的好的公司aso优化{ }贴吧
  • 网站虚拟主机1g域名备案查询站长工具
  • 中国临朐门户网站google seo 优化
  • 怎么做网站优化排名微信营销的案例
  • 企业展厅设计公司案例欣赏南京百度seo公司
  • wap 网站 开发seo排名点击首页
  • 餐饮营销型网站建设百度直播间
  • 网站建设业务拓展网站服务器多少钱一年
  • 两学一做学习教育网站百度极速版app下载安装
  • 百度收录网站要多久百度置顶广告多少钱
  • 安徽省公路建设行业协会网站深圳网络推广公司
  • 网站开发的硬件环境要求类似火脉的推广平台
  • 宽屏wordpress主题seo科技网
  • 自建网站赚钱企业网站推广有哪些方式
  • 厦门网站做优化品牌宣传策略有哪些
  • 中企动力唐山网站建设重庆seo小潘大神
  • 网站开发项目组团队外链网址
  • 电子商务的网站的建设内容廊坊seo排名外包
  • 重新做网站站外推广渠道
  • 网站设计技术有哪些?外链的作用
  • 做爰全程的网站北京疫情又严重了
  • 动画网站模块2022年列入传销组织最新骗法
  • 网站数据做面板分析宁波seo公司排名榜
  • 遵义新蓝外国语学校网站建设站长工具域名查询社区