随笔分类 - Algorithm
摘要:238. Product of Array Except Self Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product o
阅读全文
摘要:104. Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from th
阅读全文
摘要:3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example,
阅读全文
摘要:2. Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their node
阅读全文
摘要:338. Counting Bits Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary r
阅读全文
摘要:258. Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the
阅读全文
摘要:136. Single Number Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a li
阅读全文
摘要:1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input wo
阅读全文
摘要:1、debug下手写快排效率为sort的10倍 2、release下sort略快于手写快排(相比debug均有极大提高) 3、stable_sort 在debug下比sort快 release下比sort慢 原因不明。 1 #pragma once 2 #include "stdafx.h" 3 #
阅读全文

浙公网安备 33010602011771号