1.面相事务的应用层协议,端口号80。
Leer más
1.结构体中也可以包含成员函数,C++允许用struct来声明一个类。结构体与类的区别是对于默认不加修饰的成员函数,结构体为public,类为private。
1.二分查找时(lower + upper) / 2 可以使用lower + (upper - lower) / 2 来替代可以避免整型溢出的风险。
(lower + upper) / 2
lower + (upper - lower) / 2
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.
0, 1, 2, ..., n
Invert a binary tree.
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.
⌊ n/3 ⌋
Write a program to find the node at which the intersection of two singly linked lists begins.
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
Given a linked list, determine if it has a cycle in it.
A message containing letters from A-Z is being encoded to numbers using the following mapping:
A-Z