## [LeetCode C++实现]124. Binary Tree Maximum Path

Given a non-empty binary tree, find the maximum path sum.

For this problem, a path is defined as any sequence of nodes ......

#include &......

## setjmp与longjmp

apue信号章节中引入setjmp和longjmp函数是为了解决例子sleep1.c中存在的第三个问题。

#include <signal.h>

#include <unistd......

## 段错误segment fault分析

1.数组(vector)越界

2.使用strcpy strcat 等不安全的字符串操作函数

3.多线程访问全局变量未加锁

4.多线程使用线程不安全函数

5.信号处......

## 日常开发笔记总结(六)

a)已知它们使用静态数据结构(如getpwnam函数）

b)它们调用malloc或free函数

c)标准I/O函数，标准I/O库的很多实现都以不可重入的方式使用全局数据结构。这里需要特别说明一点，书上或网上一些例子，信号处理函数中调用了printf，这里仅仅为了直观说明程序的运行，printf不能在信号处理函数中调用。

......

## EINTR信号介绍

man ps手册中关于进程状态的描述：

PROCESS STATE CODES

Here are......

## [LeetCode C++实现]78.Subsets

Given a set of distinct integers, nums, return all possible subsets (the power set).

Note: The solution set must not contain duplicate subsets.

Example:

Input: nums = [1,2,3]

Output:

[

[3],

[1],

[......

## [LeetCode C++实现]347. Top K Frequent Elements

Given a non-empty array of integers, return the k most frequent elements.

Example 1:

Input: nums = [1,1,1,2,2,3], k = 2

Output:

Example 2:

Input: nums = [1], k = 1

Output:

Note:

You may assume k is always valid, 1 ≤ k ≤ number of unique elements.

## [LeetCode C++实现]22.Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

For example, given n = 3, a solution set is:

[

"((()))",

"(()())",

"(())()",

"()(())",

"()()()"

]

## 从linux信号说起

D 不可中断 uninterruptible sleep (usually IO)

R 运行 runnable (on run queue)

S 中断 sleeping

T(t) 停止 traced or stopped

Z 僵死 a defunct ("zombie") process