C++
文章平均质量分 70
wbing520
这个作者很懒,什么都没留下…
展开
-
The STL Vector Class 学习笔记
vector: is a resizable array;Useful functions: unsigned int size();原创 2014-04-19 07:10:11 · 654 阅读 · 0 评论 -
[LeetCode] ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given num原创 2014-11-24 13:32:13 · 431 阅读 · 0 评论 -
[LeetCode] Anagrams solution
Given an array of strings, return all groups of strings that are anagrams.Nots:All in原创 2014-11-25 13:56:13 · 484 阅读 · 0 评论 -
[LeetCode] Linked List Cycle II Solution
Given a linked list, return the node where the cycle begins, if there is no cycle, return null.Follow up: could you solve it原创 2014-11-03 07:55:10 · 1069 阅读 · 0 评论 -
[Leetcode] Convert Sorted List to Binary Search Tree Solution
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.原创 2014-11-03 02:02:02 · 685 阅读 · 0 评论 -
[LeetCode] Linked List Cycle
Given a linked list, deter if it has cycle in it.Follow up: can you solve it without using extra space?原创 2014-11-03 02:31:58 · 495 阅读 · 0 评论 -
[LeetCode] Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum sh原创 2014-11-13 13:59:22 · 1092 阅读 · 0 评论 -
[LeetCode] Reverse Linked List II Solution
Reverse a linked list from position m to n, Do it in-place and in one-pass.For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4return 1->4->3->2->5->NULL.Note:Given m, n satisfy the follo原创 2014-10-27 05:35:14 · 618 阅读 · 0 评论 -
[LeetCode] Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates".原创 2014-11-12 13:50:38 · 411 阅读 · 0 评论 -
[LeetCode] Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element原创 2014-11-11 10:55:50 · 427 阅读 · 0 评论 -
[LeetCode 143] Reorder List Solution
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder原创 2014-10-07 07:25:57 · 1135 阅读 · 0 评论 -
[LeetCode] Merge Sorted Array
Given Two Sorted integer array A and B, merge B into A as one sorted array.Note:You may assume that A has enough space(size that is )原创 2014-11-10 13:02:27 · 437 阅读 · 0 评论 -
[LeetCode] Valid Palindrome
Given a string, determine if it is a palindrome,considering only alphanumeric characters and ignoring cases.原创 2014-11-10 12:34:01 · 425 阅读 · 0 评论 -
[LeetCode] Remove Element
Given an array and a value, remove all instances of that value in place and return the new原创 2014-11-10 11:45:06 · 408 阅读 · 0 评论 -
[LeetCode Solution] Merge k sorted Lists
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *me原创 2014-11-09 15:33:40 · 511 阅读 · 0 评论 -
[LeetCode] Reverse Nodes in K-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modi原创 2014-11-09 16:20:15 · 520 阅读 · 0 评论 -
[Leecode 61] Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.Idea: get the length of原创 2014-06-01 22:12:37 · 597 阅读 · 0 评论 -
More about Vector
1. Vector Constructorvector myVector;vector myVector(elementNo);vector myVector(elementNo, value);原创 2014-04-19 13:35:36 · 564 阅读 · 0 评论 -
[LeetCode] Copy List with Random Pointer
A linked list is given such that each node contains an additional random po原创 2014-11-08 17:37:33 · 562 阅读 · 0 评论