HTTP协议备忘

超文本传输协议HTTP

1.面相事务的应用层协议,端口号80。

Leer más

C++语法点

类和对象的特性

1.结构体中也可以包含成员函数,C++允许用struct来声明一个类。结构体与类的区别是对于默认不加修饰的成员函数,结构体为public,类为private。

Leer más

开发编码经验之谈

1.二分查找时(lower + upper) / 2 可以使用lower + (upper - lower) / 2 来替代可以避免整型溢出的风险。

Leer más

LeetCode典型技巧题编汇

268. Missing Number

Description

Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.

Leer más

LeetCode 226. Invert Binary Tree

Description

Invert a binary tree.

Leer más

LeetCode 229. Majority Element II

Description

Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.

Leer más

LeetCode 160. Intersection of Two Linked Lists

Description

Write a program to find the node at which the intersection of two singly linked lists begins.

Leer más

LeetCode 155. Min Stack

Description

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

Leer más

LeetCode 141. Linked List Cycle

Description

Given a linked list, determine if it has a cycle in it.

Leer más

LeetCode 91. Decode Ways

Description

A message containing letters from A-Z is being encoded to numbers using the following mapping:

Leer más