自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 资源 (1)
  • 论坛 (1)
  • 收藏
  • 关注

转载 多线程之pthread_create()函数

总述:pthread_create是(Unix、Linux、Mac OS X)等操作系统的创建线程的函数。它的功能是创建线程(实际上就是确定调用该线程函数的入口点),在线程创建以后,就开始运行相关的线程函数。pthread_create的返回值表示成功,返回0;表示出错,返回表示-1。pthread_create函数如何创造线程函数原型声明:#include <pthread.h>int pthread_create( pthread_t *re

2020-12-31 11:20:07 267

原创 I/O复用 epoll

一直看书,没写,把这个例子程序敲一遍,很多部分都是通用的,先留着。#include<sys/types.h>#include<sys/socket.h>#include<netinet/in.h>#include<arpa/inet.h>#include<assert.h>#include<stdio.h>#include<unistd.h>#include<errno.h>#include

2020-12-30 17:04:33 39

原创 MinGWC++源码分布

2020-12-29 11:02:27 31

原创 445. Add Two Numbers II链表头插法

You are given twonon-emptylinked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.You may assume the two numbers do n..

2020-12-28 22:47:03 30

转载 红黑树的特性

红黑树的特性:(1)每个节点或者是黑色,或者是红色。(2)根节点是黑色。(3)每个叶子节点(NIL)是黑色。[注意:这里叶子节点,是指为空(NIL或NULL)的叶子节点!](4)如果一个节点是红色的,则它的子节点必须是黑色的。(5)从一个节点到该节点的子孙节点的所有路径上包含相同数目的黑节点。[这里指到叶子节点的路径]当新添加一个节点到树中后,将其颜色置为red,遵循以下原则对整个树进行调整:1、 当插入的节点的父节点为null,则将该节点颜色置为black。2、 当插入节...

2020-12-24 09:54:33 41

原创 leetcode报错==29==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete)

==29==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x602000000150 #3 0x7f10982fd0b2 (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) 0x602000000150 is located 0 bytes inside of 16-byte region [0x602000000150,0x602000000160) alloc

2020-12-21 20:43:59 324 1

原创 1022. Sum of Root To Leaf Binary Numbers

You are given therootof a binary tree where each node has a value0or1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if the path is0 -> 1 -> 1 -> 0 -> 1, then this could represent...

2020-12-17 20:16:01 38

原创 965. Univalued Binary Tree

A binary tree isunivaluedif every node in the tree has the same value.Returntrueif and only if the given tree is univalued.Example 1:Input: [1,1,1,1,1,null,1]Output: trueExample 2:Input: [2,2,2,5,2]Output: falseNote:The nu...

2020-12-16 20:32:50 28

原创 872. Leaf-Similar Trees

Consider all the leaves of a binary tree, fromleft to right order, the values of thoseleaves form aleaf value sequence.For example, in the given tree above, the leaf value sequence is(6, 7, 4, 9, 8).Two binary trees are consideredleaf-similarif...

2020-12-15 20:07:42 37

原创 700. Search in a Binary Search Tree

Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Return the subtree rooted with that node. If such node doesn't exist, you should return NULL.For example,.

2020-12-15 19:51:22 40

原创 589. N-ary Tree Preorder Traversal前序遍历

Given an n-ary tree, return thepreordertraversal of its nodes' values.Nary-Tree input serializationis represented in their level order traversal, each group of children is separated by the null value (See examples).Follow up:Recursive solution ...

2020-12-13 20:46:54 35

原创 559. Maximum Depth of N-ary Tree二叉树深度

Given a n-ary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Nary-Tree input serializationis represented in their level order traversal, each group of chil.

2020-12-11 23:00:34 27

原创 429. N-ary Tree Level Order Traversal层次遍历

Given an n-ary tree, return thelevel ordertraversal of its nodes' values.Nary-Tree input serializationis represented in their level order traversal, each group of children is separated by the null value (See examples).Example 1:Input: root =...

2020-12-10 19:40:51 35 1

原创 1094. 拼车

假设你是一位顺风车司机,车上最初有capacity个空座位可以用来载客。由于道路的限制,车只能向一个方向行驶(也就是说,不允许掉头或改变方向,你可以将其想象为一个向量)。这儿有一份乘客行程计划表trips[][],其中trips[i] = [num_passengers, start_location, end_location]包含了第 i 组乘客的行程信息:必须接送的乘客数量;乘客的上车地点;以及乘客的下车地点。这些给出的地点位置是从你的初始出发位置向前行驶到这些地点所需...

2020-12-09 19:46:13 43

原创 452. Minimum Number of Arrows to Burst Balloons pair<int,int>速度快很多

There are some spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coordinates don't matter, and hence the x-coordinates of start and end

2020-12-07 20:35:40 38

原创 435. Non-overlapping Intervals 排序内置cmp函数

Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Example 1:Input: [[1,2],[2,3],[3,4],[1,3]]Output: 1Explanation: [1,3] can be removed and the rest of interv.

2020-12-05 19:41:07 40

原创 C++(Qt)与Python混合编程

https://zhuanlan.zhihu.com/p/193101493?utm_source=qqQt5中使用C++调用Python

2020-12-04 22:00:38 250

原创 406. Queue Reconstruction by Height list和vector的区别

You are given an array of people,people, which are the attributes of some people in a queue (not necessarily in order). Eachpeople[i] = [hi, ki]represents theithperson of heighthiwithexactlykiother people in front who have a height greater than o...

2020-12-03 22:09:04 39

原创 openRT路由器操作手册log笔记

cd /etc/startup.shhelp netbondingipforward 1natsluahelp nathelp natwansroute add 192.168.1.1 192.168.1.10 123.0.0.1 126.0.0.1 INC DEF dev en1 add source ip from 192.168.1.1 ~ 192.168.1.10 dest 123.0.0.1 ~ 126.0.0.1 route to en1 as default ...

2020-12-03 10:27:07 21

原创 利用scapy发送带vlan标签的以太帧

from scapy.all import *data="helloworld33333"sendp(Ether()/Dot1Q(vlan=1)/IP(dst="192.168.4.2",ttl=23)/UDP(sport=12345,dport=23456)/data)wireshark抓包如下接收端如果没有开相应的socket,接收端是抓不到发送端发送过去的UDP包,只会回个icmp port unreachable报文参考链接:scapy安装以及构造数据包scapy学习笔...

2020-12-03 09:52:03 162

原创 870. Advantage Shuffle

Given two arraysAandBof equal size, theadvantage ofAwith respect toBis the number of indicesifor whichA[i] > B[i].Returnanypermutation ofAthat maximizes its advantage with respect toB.Example 1:Input: A = [2,7,11,15], B = [1,1...

2020-12-02 21:24:19 29

原创 392. Is Subsequence

Given a stringsand a stringt, check ifsis subsequence oft.A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining...

2020-12-02 20:04:36 19

转载 VLAN基础细节详解

这个博客的流程图不错,看流程图很清晰了解Access和trunk,以及hybrid。https://blog.csdn.net/qq_35733751/article/details/104115184

2020-12-02 15:32:26 76

原创 IP地址转换函数

2020-12-01 22:24:19 42

原创 670. Maximum Swap

Given a non-negative integer, you could swap two digitsat mostonce to get the maximum valued number. Return the maximum valued number you could get.Example 1:Input: 2736Output: 7236Explanation: Swap the number 2 and the number 7.Example 2:...

2020-12-01 21:36:45 32

wireshark抓包分析

wireshark抓包,选取其中一个报文,详细分析。

2018-12-07

Heisenberg-William的留言板

发表于 2020-01-02 最后回复 2020-01-02

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人 TA的粉丝

提示
确定要删除当前文章?
取消 删除