c
-
Single Number详解编程语言
Problem 「找单数」系列题,技巧性较强,需要灵活运用位运算的特性。 Given 2*n + 1 numbers, every numbers occurs twice exc…
-
Single Number II详解编程语言
Source Given 3*n + 1 numbers, every numbers occurs triple times except one, find it. Examp…
-
O(1) Check Power of 2详解编程语言
Source Using O(1) time to check whether an integer n is a power of 2. Example For n=4, ret…
-
Convert Integer A to Integer B详解编程语言
Source Determine the number of bits required to convert integer A to integer B Example Giv…
-
Factorial Trailing Zeroes详解编程语言
Source Write an algorithm which computes the number of trailing zeros in n factorial. Exam…
-
Unique Binary Search Trees详解编程语言
Source Given n, how many structurally unique BSTs (binary search trees) that store values …
-
Update Bits详解编程语言
Source Given two 32-bit numbers, N and M, and two bit positions, i and j. Write a method t…
-
Fast Power详解编程语言
Source 计算 a^n % b,其中a,b和n都是32位的非负整数 题解 数学题,考察整数求模的一些特性,不知道这个特性的话此题一时半会解不出来,本题中利用的关键特性为: (a…
-
C/C++内存对齐详解编程语言
前言 C语言中,结构体内存对齐问题算是比较常见的问题,虽然理解起来不难,但很多时候一不小心就会算错。比如给你一个 struct,让你 sizeof 计算一下需要占用多少字节,往往得…
-
java servlet 生命周期详解编程语言
Life Cycle in Detail:-1-When a server loads a servlet, it runs the servlet’s init me…