原创 Leetcode Q5:Longest Palindromic Substring

題目5: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000

原创 Leetcode Q3:Longest Substring Without Repeating Characters

題目3: Given a string, find the length of the longest substring without repeating characters. For example, the longest su

原创 Leetcode Q7:Reverse Integer

題目7: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Have you thought abo

原创 Leetcode Q6:ZigZag Conversion

題目6: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want t

原创 Leetcode Q136: Single Number

題目136: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algo

原创 Leetcode Q9: Palindrome Number

題目9: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers

原创 Leetcode Q4:Median of Two Sorted Arrays

題目4: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays

原创 c語言限制訪問鏈表元素的一種機制

自己記錄下的一些心得,以便自己以後能夠回顧。 定義兩個自己的鏈表節點,stIn和stOut。 list_head即爲Linux中List的使用。 鏈表stIn保存了1-16個節點(不包括頭),其中a和b的值依次爲1到16。 遍歷鏈表stI

原创 Leetcode Q8 : String to Integer (atoi)

題目8: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a

原创 VS將已有的項目生成lib靜態庫並使用

首先,建一個空項目,在其中添加兩個文件,test.h和test.c。 test.h int add(int, int); test.c #include "test.h" int add(int a, int b) { re

原创 Leetcode Q191:Number of 1 Bits

題目191: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Ham

原创 VS2012 C語言dll文件生成和C#調用

 用C#做Web項目時,需要使用C實現的加密算法,將加密算法封裝成dll文件以便在C#中調用,第一次使用dll,做個簡單記錄。 1. 在需要調用的函數前面添加 __declspec(dllexport)。 使2.用命令行生成dll

原创 fork()和邏輯運算符的混合使用

fork()的使用和邏輯運算的混合使用。 fork() || fork(); 生成多少進程? 解析:1fork() || 2fork(); fork()用來創建進程,並返回值,子進程返回0,父進程返回子進程的進程號;對兩個fork進行編號

原创 Leetcode Q2: Add Two Numbers

題目2: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and e

原创 Leetcode Q1: Two Sum

這個專欄是爲了記錄在leetcode刷題過程的記錄,便於查看。 題目1: Given an array of integers, find two numbers such that they add up to a specific t