2023全国大学生软件测试大赛开发者测试练习题满分答案(PairingHeap2023)

news2024/11/19 6:16:31

2023全国大学生软件测试大赛开发者测试练习题满分答案(PairingHeap2023)

  • 题目详情
  • 题解代码(直接全部复制到test类中即可)


提示:该题只需要分支覆盖得分即可,不需要变异得分

题目详情

在这里插入图片描述
在这里插入图片描述




题解代码(直接全部复制到test类中即可)

package net.mooctest;

        import static org.junit.Assert.*;
        import java.lang.reflect.Method;
        import java.lang.reflect.InvocationTargetException;

        import org.junit.Before;
        import org.junit.Test;

public class Heap_ItemTest {


    @Test
    public void test() {
        Heap_Item<String> heap_Item0 = new Heap_Item<String>(",");
        Heap_Item<String> heap_Item1 = new Heap_Item<String>(",");
        heap_Item1.setLeftSon(heap_Item0);
        heap_Item0.setLeftSon(heap_Item1);
        heap_Item0.setRightSon(heap_Item1);
        heap_Item1.replaceChild("$", heap_Item0);
        heap_Item0.getSonByData(",");
        heap_Item0.getSonByData("");
        assertTrue(heap_Item0.hasLeftSon());
    }

    @Test
    public void test1() {
        Heap_Item<String> heap_Item0 = new Heap_Item<String>(",");
        Heap_Item<String> heap_Item1 = new Heap_Item<String>(",");
        heap_Item1.setLeftSon(heap_Item0);
        heap_Item0.setLeftSon(heap_Item1);
        heap_Item0.setRightSon(heap_Item1);
        heap_Item1.replaceChild(",", heap_Item0);
        heap_Item0.getSonByData(",");
        heap_Item0.getSonByData("");
        assertTrue(heap_Item0.hasLeftSon());
    }

    @Test
    public void test2() {
        Heap_Item<String> heap_Itema=new Heap_Item<String>("a");
        Heap_Item<String> heap_Itemb=new Heap_Item<String>("b");
        Heap_Item<String> heap_Itemc=new Heap_Item<String>("c");
        Heap_Item<String> heap_Itemd=new Heap_Item<String>("d");
        Heap_Item<String> heap_Iteme=new Heap_Item<String>("e");
        Heap_Item<String> heap_Itemk=new Heap_Item<String>("k");
        Heap_Item<String> heap_Itemp=new Heap_Item<String>("p");
        Heap_Item<String> heap_Itemq=new Heap_Item<String>("q");
        heap_Itema.setLeftSon(heap_Itemb);
        heap_Itema.setRightSon(heap_Itemc);
        heap_Itemb.setRightSon(heap_Itemd);
        heap_Itemb.setLeftSon(heap_Iteme);
        heap_Itemb.replaceChild("e", heap_Itemk);
        heap_Itemb.replaceChild("d", heap_Itemk);
        heap_Itemb.itIsLeftSon(heap_Itemk);
        heap_Iteme.setLeftSon(heap_Itemp);
        heap_Itemq.setLeftSon(heap_Itemq);
        heap_Iteme.removeLeftSon();
        heap_Iteme.removeRightSon();
        heap_Itemb.removeChild("k");
        heap_Itemb.removeChild("k");
        heap_Itemb.removeChild("a");
        Heap_Item <String> heap_Itema1= heap_Itema.getLeftSon();
        assertSame(heap_Itema1,heap_Itemb);
        heap_Itemb.setAncestor(heap_Itema);
        Heap_Item <String> heap_Itemn= heap_Itemb.getAncestor();
        assertSame(heap_Itema,heap_Itemb.getAncestor());
        assertEquals(heap_Itema,heap_Itemn);

        //设置节点c的祖先为a
        heap_Itemc.setAncestor(heap_Itema);

        //节点a无祖先,于是返回null
        Heap_Item <String> heap_Itemanull=heap_Itema.getMultiWayAncestor();
        assertNull(heap_Itemanull);

        //节点b有祖先a,同时又是它的左孩子,于是返回他的祖先a
        Heap_Item <String> heap_Itembnull=heap_Itemb.getMultiWayAncestor();
        assertNotNull(heap_Itembnull);
        assertSame(heap_Itema,heap_Itembnull);





    }

    @Test
    public void testMul() {
        Heap_Item<String> heap_Itema=new Heap_Item<String>("a");
        Heap_Item<String> heap_Itemb=new Heap_Item<String>("b");
        Heap_Item<String> heap_Itemc=new Heap_Item<String>("c");
        Heap_Item<String> heap_Itemd=new Heap_Item<String>("d");
        Heap_Item<String> heap_Iteme=new Heap_Item<String>("e");
        Heap_Item<String> heap_Itemk=new Heap_Item<String>("k");
        Heap_Item<String> heap_Itemp=new Heap_Item<String>("p");
        Heap_Item<String> heap_Itemq=new Heap_Item<String>("q");
        heap_Itema.setLeftSon(heap_Itemb);
        heap_Itema.setRightSon(heap_Itemc);
        heap_Itemb.setRightSon(heap_Itemd);
        heap_Itemb.setLeftSon(heap_Iteme);
        heap_Itemb.replaceChild("e", heap_Itemk);
        heap_Itemb.replaceChild("d", heap_Itemk);
        heap_Itemb.itIsLeftSon(heap_Itemk);
        heap_Iteme.setLeftSon(heap_Itemp);
        heap_Itemq.setLeftSon(heap_Itemq);
        heap_Iteme.removeLeftSon();
        heap_Iteme.removeRightSon();
        heap_Itemb.removeChild("k");
        heap_Itemb.removeChild("k");
        heap_Itemb.removeChild("a");
        Heap_Item <String> heap_Itema1= heap_Itema.getLeftSon();
        assertSame(heap_Itema1,heap_Itemb);
        heap_Itemb.setAncestor(heap_Itema);
        Heap_Item <String> heap_Itemn= heap_Itemb.getAncestor();
        assertSame(heap_Itema,heap_Itemb.getAncestor());
        assertEquals(heap_Itema,heap_Itemn);

        //设置节点c的祖先为a
        heap_Itemc.setAncestor(heap_Itema);

        //节点a无祖先,于是返回null
        Heap_Item <String> heap_Itemanull=heap_Itema.getMultiWayAncestor();
        assertNull(heap_Itemanull);

        //节点b有祖先a,同时又是它的左孩子,于是返回他的祖先a
        Heap_Item <String> heap_Itembnull=heap_Itemb.getMultiWayAncestor();
        assertNotNull(heap_Itembnull);
        assertSame(heap_Itema,heap_Itembnull);


        //先给a设置右祖先
        Heap_Item <String> heap_Items1 = new Heap_Item<String>("s1");
        heap_Itema.setAncestor(heap_Items1);
        heap_Items1.setLeftSon(heap_Itema);

        //检查a的祖先是否为s1
        assertSame(heap_Items1,heap_Itema.getAncestor());

        //检查c的祖先是否为a
        assertSame(heap_Itema,heap_Itemc.getAncestor());

        //给s1复制左孩子为s2
        Heap_Item <String> heap_Items2 = new Heap_Item<String>("s2");
        heap_Items2.setAncestor(heap_Items1);
        heap_Items1.setRightSon(heap_Items2);
        //节点c有祖先a,但是a的右孩子,于是返回a的最近的以a作为左子孙的祖先,即s1


        Heap_Item <String> heap_Itemcnull=heap_Itemc.getMultiWayAncestor();
        assertSame(heap_Itemcnull,heap_Items1);


    }

    @Test
    public void testpair() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException{
        Class<Pairing_Heap> c = Pairing_Heap.class;
        Heap_Item<String>  a1=new Heap_Item<>("a1");
        Heap_Item<String> a2=new Heap_Item<>("a2");
        Heap_Item<String> b1=new Heap_Item<>("b1");
        a1.setLeftSon(b1);
        b1.setAncestor(a1);

        Pairing_Heap<String> p1=new Pairing_Heap<>(a1);
        Pairing_Heap<String> p2=new Pairing_Heap<>(a2);

        Method pair = c.getDeclaredMethod("pair", Pairing_Heap.class, Pairing_Heap.class);
        pair.setAccessible(true);


        //情况3
        Pairing_Heap<String> k=new Pairing_Heap<>();
        Object invoke = pair.invoke(k, p1, p2);

        //情况1
        Pairing_Heap<String> null1=new Pairing_Heap<>();
        Object invoke1= pair.invoke(k, null1,p2);


        //情况2
        pair.invoke(k, p1,null1);

        //情况4
        Heap_Item<String>  d1=new Heap_Item<>("d1");
        Heap_Item<String> d2=new Heap_Item<>("d2");

        Pairing_Heap<String> pd1=new Pairing_Heap<>(d1);
        Pairing_Heap<String> pd2=new Pairing_Heap<>(d2);
        pair.invoke(k, pd1,pd2);

        //情况5
        Heap_Item<String>  e1=new Heap_Item<>("e1");
        Heap_Item<String> e2=new Heap_Item<>("e2");
        Heap_Item<String> be1=new Heap_Item<>("be1");
        e1.setLeftSon(be1);
        be1.setAncestor(e1);

        Pairing_Heap<String> pe1=new Pairing_Heap<>(e2);
        Pairing_Heap<String> pe2=new Pairing_Heap<>(e1);

        pair.invoke(k, pe1,pe2);

        //情况6
        Heap_Item<String>  f1=new Heap_Item<>("e1");
        Heap_Item<String> f2=new Heap_Item<>("e2");

        Pairing_Heap<String> pf1=new Pairing_Heap<>(f2);
        Pairing_Heap<String> pf2=new Pairing_Heap<>(f1);

        pair.invoke(k, pf1,pf2);
    }

    @Test
    public void testpop_heap_item() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        Class<Pairing_Heap> fun = Pairing_Heap.class;
        //情况1
        Pairing_Heap<String> null1=new Pairing_Heap<>();
        Method pair =fun.getDeclaredMethod("pop_heap_item");
        pair.setAccessible(true);

        pair.invoke(null1);

        //情况2
        Heap_Item<String> b=new Heap_Item<>("b");
        Pairing_Heap<String> pb=new Pairing_Heap<>(b);

        pair.invoke(pb);

        //情况3
        Heap_Item<String> c=new Heap_Item<>("c");
        Heap_Item<String> cb=new Heap_Item<>("cb");
        c.setLeftSon(cb);
        cb.setAncestor(c);
        Pairing_Heap<String> pc=new Pairing_Heap<>(c);
        pair.invoke(pc);

        //情况四
        Heap_Item<String> d=new Heap_Item<>("d");
        Heap_Item<String> db=new Heap_Item<>("db");
        Heap_Item<String> dbc=new Heap_Item<>("dbc");
        Heap_Item<String> dbc0=new Heap_Item<>("dbc0");
        d.setLeftSon(db);
        db.setAncestor(d);
        db.setRightSon(dbc);
        db.setLeftSon(dbc0);
        dbc0.setAncestor(db);
        dbc.setAncestor(dbc);

        Pairing_Heap<String> pd=new Pairing_Heap<>(d);
        pair.invoke(pd);


    }

    @Test
    public void testpush() {


        //根为空的情况

        Pairing_Heap<String> null1=new Pairing_Heap<>();
        Heap_Item<String> d=new Heap_Item<>("d");
        null1.push(d);


        //根不为空的情况
        Heap_Item<String> c=new Heap_Item<>("c");
        Pairing_Heap<String> pc=new Pairing_Heap<>(c);
        Heap_Item k=pc.push(d);


    }

    @Test
    public void testcheckPriority1_2() {
        //情况1,2
        Heap_Item<String> a=new Heap_Item<>("a");
        Heap_Item<String> b=new Heap_Item<>("b");
        Heap_Item<String> c=new Heap_Item<>("c");
        Heap_Item<String> k=new Heap_Item<>("k");

        Pairing_Heap<String> p=new Pairing_Heap<>();

        c.setLeftSon(a);
        a.setAncestor(c);
        a.setRightSon(b);
        b.setAncestor(a);
        b.setRightSon(k);
        k.setAncestor(b);
        p.checkPriority(b);
    }

    @Test
    public void testcheckPriority3() {

        //情况3
        Heap_Item<String> k=new Heap_Item<>("k");
        Heap_Item<String> b1=new Heap_Item<>("b1");
        Heap_Item<String> b2=new Heap_Item<>("b2");
        Pairing_Heap<String> p=new Pairing_Heap<>();

        k.setLeftSon(b1);
        k.setRightSon(b2);
        b1.setAncestor(k);
        b2.setAncestor(k);
        p.checkPriority(k);
    }

    @Test
    public void testcheckPriority4() {
        //情况4
        Heap_Item<String> a=new Heap_Item<>("a");
        Heap_Item<String> k=new Heap_Item<>("k");
        Heap_Item<String> b1=new Heap_Item<>("b1");
        Heap_Item<String> b2=new Heap_Item<>("b2");
        Pairing_Heap<String> p=new Pairing_Heap<>();

        a.setLeftSon(k);
        k.setAncestor(a);
        k.setLeftSon(b1);
        k.setRightSon(b2);
        b1.setAncestor(k);
        b2.setAncestor(k);
        p.checkPriority(k);
    }

    @Test
    public void testcheckPriority5() {
        //情况5

        Heap_Item<String> k=new Heap_Item<>("k");
        Heap_Item<String> z=new Heap_Item<>("z");
        k.setLeftSon(z);
        z.setAncestor(k);

        Pairing_Heap<String> p=new Pairing_Heap<>();


        p.checkPriority(k);
    }
    
    @Test
    public void testcheckPriority6() {
        //情况6

        Heap_Item<String> k=new Heap_Item<>("k");
        Heap_Item<String> z=new Heap_Item<>("z");
        z.setLeftSon(k);
        k.setAncestor(z);

        Pairing_Heap<String> p=new Pairing_Heap<>();


        p.checkPriority(k);
    }
    
    @Test
    public void testcheckPriority7() {
        //情况7
    	Heap_Item<String> k=new Heap_Item<>("k");
        Heap_Item<String> z=new Heap_Item<>("z");
        k.setLeftSon(z);
        z.setAncestor(k);

        Pairing_Heap<String> p=new Pairing_Heap<>();


        p.checkPriority(z);
        
    }
    
    @Test
    public void testcheckPriority8() {
        //情况8
    	Heap_Item<String> a=new Heap_Item<>("a");
        Heap_Item<String> z=new Heap_Item<>("z");
        Heap_Item<String> b=new Heap_Item<>("b");
        a.setLeftSon(z);
        z.setAncestor(a);
        z.setLeftSon(b);
        b.setAncestor(z);

        Pairing_Heap<String> p=new Pairing_Heap<>();


        p.checkPriority(z);
        
    }
    
    @Test
    public void testcheckPriority9() {
        //情况9
    	Heap_Item<String> a=new Heap_Item<>("a");
        Heap_Item<String> b=new Heap_Item<>("b");
        Heap_Item<String> c=new Heap_Item<>("c");
        Heap_Item<String> d=new Heap_Item<>("d");
        a.setLeftSon(b);
        b.setAncestor(a);
        b.setLeftSon(c);
        c.setAncestor(b);
        c.setRightSon(d);
        d.setAncestor(c);

        Pairing_Heap<String> p=new Pairing_Heap<>();


        p.checkPriority(b);
        
    }
    
    @Test
    public void testgetData() {
    	Heap_Item<String> null2=new Heap_Item<>();
    	null2.getData();
    	
    }
    @Test
    public void testgetSonByData() {
    	Heap_Item<String> k=new Heap_Item<>("k");
        Heap_Item<String> z=new Heap_Item<>("z");
        Heap_Item<String> z2=new Heap_Item<>("z2");
        Heap_Item<String> z1=new Heap_Item<>("z1");
        k.setLeftSon(z);
        k.setRightSon(z2);
        z2.setAncestor(k);
        z.setAncestor(k);
        k.removeChild("z1");
    }
    
    @Test
    public void testgetSonByData1() {
    	Heap_Item<String> k=new Heap_Item<>("k");
    	k.getSonByData(null);
    	Heap_Item<String> z2=new Heap_Item<>("z2");
    	k.setRightSon(z2);
        z2.setAncestor(k);
        k.getSonByData("z2");
    }
    
    
    @Test
    public void testreplaceChild1() {
    	Heap_Item<String> k=new Heap_Item<>("k");
    	Heap_Item<String> z2=new Heap_Item<>("z2");
    	k.setRightSon(z2);
        z2.setAncestor(k);
        k.replaceChild("z1", z2);
    }
    
    @Test
    public void testgetMultiWayAncestor2() {
    	Heap_Item<String> k=new Heap_Item<>("k");
    	Heap_Item<String> c=new Heap_Item<>("c");
    	Heap_Item<String> a=new Heap_Item<>("a");
    	Heap_Item<String> b=new Heap_Item<>("b");
    	c.setLeftSon(k);
    	k.setAncestor(c);
    	k.setRightSon(a);
    	a.setAncestor(k);
    	a.setRightSon(b);
    	b.setAncestor(a);
    	b.getMultiWayAncestor();
    }
    
    @Test
    public void testpop() {
    	Heap_Item<String> k=new Heap_Item<>("k");
        Heap_Item<String> z=new Heap_Item<>("z");
        k.setLeftSon(z);
        z.setAncestor(k);

        Pairing_Heap<String> p=new Pairing_Heap<>();
        Pairing_Heap<String> p1=new Pairing_Heap<>(k);


        p.pop();
        p1.pop();
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1081839.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Kubernetes使用OkHttp客户端进行网络负载均衡

在一次内部Java服务审计中&#xff0c;我们发现一些请求没有在Kubernetes&#xff08;K8s&#xff09;网络上正确地实现负载均衡。导致我们深入研究的问题是HTTP 5xx错误率的急剧上升&#xff0c;由于CPU使用率非常高&#xff0c;垃圾收集事件的数量很多以及超时&#xff0c;但…

linux开发环境下出现Segmentation fault问题排查一

一、检测代码中是否有数组越界情况 更改以上数组为128*60后&#xff0c;正常。确认是数组溢出导致越界。 二、分析&#xff1a;一般情况下打印的字符刚好在50以内&#xff0c;但是在其它状态下测试&#xff0c;数据字符数据增加从而导致溢出 打印命令如下&#xff1a; sprin…

2.线性表——数据结构学习

零个或多个数据元素的有限序列。 有序 &#xff08;每个元素有且只有一个前驱与后继&#xff09; -> 一对一的关系 前驱 &#xff08;第一个元素无前驱&#xff09;后继&#xff08;最后一个元素无后继&#xff09; 有限 线性表元素个数&#xff1a;n (n ≥ \geq ≥ 0)&a…

D1s芯片启动流程(BROM System)分析

1、D1S芯片介绍 2、BROM介绍 &#xff08;1&#xff09;BROM&#xff08;boot rom&#xff09;&#xff1a;存放启动代码的ROM&#xff0c;该ROM一般在芯片内部集成&#xff0c;是芯片上电执行的最开始代码&#xff1b; &#xff08;2&#xff09;BROM里存放的程序主要功能&…

【Java 进阶篇】JavaScript 介绍及其发展史

JavaScript是一门广泛应用于Web开发的编程语言。它是一种高级的、解释性的脚本语言&#xff0c;主要用于改善用户与Web页面的互动体验。本篇博客将为你详细介绍JavaScript的基础知识、历史背景和它在Web开发中的重要作用。我们还将讨论JavaScript的发展史&#xff0c;从它的起源…

9. 一个SpringBoot项目运行

新手如何运行一个SpringBoot项目 1.SpringBoot项目运行 新创建的SpringBoot项目如何运行 2.启动lombok注解 点击该按钮&#xff0c;启动lombok注解支持 3.展示说明

进阶JAVA篇-Object类与Objects类、包装类的常用API(一)

目录 API 1.0 API概念 2.0 Object类的常用API 2.1 Object 中的 tostring() 方法 表示返回对象的字符串表达形式 2.2 Object 中的 equals(Object o) 方法 &#xff0c;判断两个对象的是否相等 2.2.1深入了解如何重写Object 中的 equals(Object o) 方法 2.2.2 对重写Object 中的…

html css实战之学成在线项目

html css实战之学成在线项目 项目链接&#xff1a;https://download.csdn.net/download/weixin_39451323/88416213 效果图&#xff1a;

4年测试经验,面试却突破不了20K,真是太卷了····

先说一个插曲&#xff1a;上个月我有同学在深圳被裁员了&#xff0c;和我一样都是软件测试&#xff0c;不过他是平安外包&#xff0c;所以整个组都撤了&#xff0c;他工资和我差不多都是14K。 现在IT互联网已经比较寒冬&#xff0c;特别是软件测试&#xff0c;裁员先裁测试&am…

【技术追踪】SAM(Segment Anything Model)代码解析与结构绘制之Prompt Encoder

论文&#xff1a;Segment Anything   代码&#xff1a;https://github.com/facebookresearch/segment-anything 上一篇&#xff1a;【技术追踪】SAM&#xff08;Segment Anything Model&#xff09;代码解析与结构绘制之Image Encoder 本篇示例依然采用上一篇的狗狗图像运行代…

深度学习笔记之优化算法(八)Adam算法的简单认识

深度学习笔记之优化算法——Adam算法的简单认识 引言回顾&#xff1a;基于Nesterov动量的RMSProp算法Adam算法的简单认识一阶矩、二阶矩修正偏差的功能Adam的算法过程描述Adam示例代码 引言 上一节介绍了基于 Nesterov \text{Nesterov} Nesterov动量与 RMSProp \text{RMSProp}…

文字与视频结合效果

效果展示 CSS 知识点 mix-blend-mode 属性的运用 实现整体页面布局 <section class"sec"><video autoplay muted loop><source src"./video.mp4" type"video/mp4" /></video><h2>Run</h2><!-- 用于切…

【Java 进阶篇】JavaScript 与 HTML 的结合方式

JavaScript是一种广泛应用于Web开发中的脚本语言&#xff0c;它与HTML&#xff08;Hypertext Markup Language&#xff09;结合使用&#xff0c;使开发人员能够创建交互式和动态的网页。在这篇博客中&#xff0c;我们将深入探讨JavaScript与HTML的结合方式&#xff0c;包括如何…

Web知识:markupsafe.escape() 函数的作用

1、markupsafe.escape() 函数是 MarkupSafe 库中的一个函数&#xff0c;它的作用是对字符串进行 HTML 转义&#xff0c;以防止在 HTML 文档中引起意外的解析结果或安全漏洞。 2、在 Web 开发中&#xff0c;如果用户提供的数据直接插入到 HTML 页面中&#xff0c;而没有经过转义…

SpringBoot调用存储过程(入参,返参)(亲测有效!!!)

存储过程和函数是有区别的&#xff01;&#xff01;&#xff01; 创建函数&#xff0c;只是演示&#xff0c;以下函数不完整&#xff01;&#xff01;&#xff01;(只是看P_xxx参数) CREATE OR REPLACE PROCEDURE SP_TICKET_CHECKE_ONLINE_TEST (p_transcode IN OUT VA…

Java反射获取抽象类方法属性问题讲解

Java反射获取抽象类方法属性问题讲解 结论一、案例准备二、测试方法&#xff1a;使用反射获取抽象类私有方法和私有属性具体操作&#xff08;获取私有方法&#xff09;具体操作&#xff08;获取私有属性&#xff09; 结论 Java 通过反射可以获得抽象类的任何修饰符&#xff08…

Vue2 Watch的语法

Watch语法 一、监听普通数据类型&#xff08;1&#xff09;把要监听的msg值看作方法名&#xff0c;来进行监听。&#xff08;2&#xff09;把要监听的msg值看作对象&#xff0c;利用hanler方法来进行监听 二、监听对象&#xff1a;&#xff08;1&#xff09;监听对象需要用到深…

LeetCode【300】最长递增子序列

题目&#xff1a; 思路&#xff1a; 通常来说&#xff0c;子序列不要求连续&#xff0c;而子数组或子字符串必须连续&#xff1b;对于子序列问题&#xff0c;第一种动态规划方法是&#xff0c;定义 dp 数组&#xff0c;其中 dp[i] 表示以 i 结尾的子序列的性质。在处理好每个…

1808_ChibiOS基本的架构介绍

全部学习汇总&#xff1a; GreyZhang/g_ChibiOS: I found a new RTOS called ChibiOS and it seems interesting! (github.com) 简单看了一下ChibiOS的架构介绍&#xff0c;感觉这种OS以及组件非常适合快速构建一个应用。这里做一个简单的资料整理。。 1. 不同于其他的OS&#…

TCP/IP(九)TCP的连接管理(六)TIME_WAIT状态探究

一 TIME_WAIT探究 要明确TIME_WAIT状态在tcp四次挥手的阶段 ① 为什么 TIME_WAIT 等待的时间是 2MSL? 背景&#xff1a; 客户端在收到服务端第三次FIN挥手后,就会进入TIME_WAIT 状态,开启时长为2MSL的定时器1、MSL 是 Maximum Segment Lifetime 报文最大生存时间2、2MSL…