- 博客(11)
- 收藏
- 关注
原创 杂记
1. 静态链表第一个元素value为任意值, next为1 2.Copy&Assignment constructor 3法: default,在public里实现,在private里实现(不是所有的都能实现) 3. Multidimensional Vector vectorint> > vec(4, vectorint>(4)); 4.原码,反码,补码 正数:原反补
2012-02-01 13:15:37 608
原创 LeetCode: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. c
2012-02-29 02:53:13 1064
原创 LeetCode: Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, t
2012-02-29 00:47:10 803
原创 LeetCode:Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you thought about this? Here are some good questions to ask before coding. Bonus points
2012-02-27 05:45:13 1102
原创 LeetCode: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 i
2012-02-27 05:11:56 1299
原创 LeetCode: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.
2012-02-16 12:36:54 1625
原创 LeetCode:Roman to Integer
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. #include #include using namespace::std; class Solution { public: int romanToInt(strin
2012-02-16 03:29:59 1575
原创 LeetCode:String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input case
2012-02-13 13:10:03 1200
原创 LeetCode: Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe
2012-02-10 13:58:03 2703 1
原创 LeetCode: Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid
2012-02-10 11:59:24 931
原创 LeetCode: ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I
2012-02-10 09:33:52 1799
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人