摘要: to do 阅读全文
posted @ 2022-11-26 16:30 ImreW 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 一、题目 定义一个函数,输入一个链表的头节点,反转该链表并输出反转后链表的头节点。 二、思路 反转链表 三、代码 class Solution { public: ListNode* reverseList(ListNode* head) { ListNode *now = head, *pre = 阅读全文
posted @ 2022-11-26 16:22 ImreW 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 一、二进制信号量 struct binary_semaphore { enum(zero, one) value; queueType queue; } void waitB(binary_semaphore s) { if (s.value == 1) s.value = 0; else//为0阻 阅读全文
posted @ 2022-11-26 12:29 ImreW 阅读(143) 评论(0) 推荐(0) 编辑