- 博客(12)
- 收藏
- 关注
原创 欢迎使用CSDN-markdown编辑器
关于c++中为什么要使用extern “C”在编写c++代码时有时候我们看到有人会使用如下的语法extern "C" { void foo();}使用该语法的目的在于使一个c++中的函数名使用c的连接方式。因为在c中是不存在函数的重载的,而在c++中存在,所以在c++中我们就不能单独使用函数名来唯一确定一个函数,还需要加上它的参数列表。所以在编译时,c++的编译器会将你的函数名破坏,加入参数
2015-11-02 16:31:15
218
原创 【leetcode】29. Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.
2015-07-16 21:02:13
162
原创 【leetcode】28. Implement strStr()
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02): The signature of the function had been updated
2015-07-15 21:30:37
309
原创 【leetcode】27. Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn’t matter what you leave beyond the new length. 删
2015-07-15 20:47:04
242
原创 【leetcode】26. Remove Duplicates from Sorted Array
remove duplicates from sorted array
2015-07-15 20:27:28
246
原创 【LeetCode】25.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.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it
2015-06-11 16:48:12
246
原创 【LeetCode】24.Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space.
2015-06-09 16:45:50
330
原创 【LeetCode】23.Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
2015-06-08 16:46:59
359
原创 【LeetCode】22.Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:“((()))”, “(()())”, “(())()”, “()(())”, “()()()”
2015-06-07 15:27:44
257
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人