原创 golang 性能剖析pprof

golang 性能剖析pprof pprof 簡介 pprof 是用於可視化和分析性能分析數據的工具. 功能 CPU Profiling:CPU 分析, 按照一定的頻率採集所監聽的應用程序 CPU(含寄存器)的使用情況, 可確定

原创 linux系統調用

無論別人寫的程序(shell命令等),還是自己寫的程序,運行起來都是進程。進程的運行就需要系統調用。 進程管理 運行前先要創建進程,創建進程的系統調用爲fork。在linux中,要創建一個新的進程需要一個老進程調用fork來實現,

原创 求解數獨

我的代碼 package main import ( "fmt" ) func main() { //board := [][]byte{{'5', '3', '.', '.', '7', '.', '.', '.', '.'}

原创 search in rotated sorted array

題目 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7

原创 longest valid parentheses

題目 Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parent

原创 substring with concatenation of all words

題目 You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of

原创 reverse nodes in k group

題目 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive in

原创 roman to integer

題目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I

原创 Integer to Roman

題目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I

原创 Container With Most Water

題目 Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical line

原创 正則表達式匹配 (Regular Expression Matching )

題目 Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.

原创 迴文數字(Palindrome Number)

題目 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.

原创 最長無重複公共子串

題目: Longest Substring Without Repeating Characters:Given a string, find the length of the longest substring without rep

原创 兩個有序數組中位數

題目 4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the me

原创 兩數相加(Add Two Numbers)

題目 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse or