Mew


  • 首页

  • 分类

  • 归档

  • 标签

Leetcode解题-Copy List with Random Pointer

发表于 2015-08-26   |   分类于 编程题   |  
描述 A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep c ...
阅读全文 »

Leetcode解题-Reverse Nodes in k-Group

发表于 2015-08-26   |   分类于 编程题   |  
描述 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 the ...
阅读全文 »

Leetcode解题-Swap Nodes In Pairs

发表于 2015-08-26   |   分类于 编程题   |  
描述 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-> ...
阅读全文 »

Leetcode解题-Remove Nth node From End of List

发表于 2015-08-26   |   分类于 编程题   |  
描述 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 ...
阅读全文 »

Leetcode解题-Rotate Array

发表于 2015-08-26   |   分类于 编程题   |  
描述 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. ...
阅读全文 »

Leetcode解题-Rotate List

发表于 2015-08-26   |   分类于 编程题   |  
描述 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,ret ...
阅读全文 »

Leetcode解题-Remove Duplicates From Sorted List

发表于 2015-08-25   |   分类于 编程题   |  
描述 Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1- ...
阅读全文 »

Leetcode解题-Remove Duplicates From Sorted List II

发表于 2015-08-25   |   分类于 编程题   |  
描述 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 1 ...
阅读全文 »

Leetcode解题-Partition List

发表于 2015-08-25   |   分类于 编程题   |  
描述 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve t ...
阅读全文 »

Leetcode解题-Reverse Linked List II

发表于 2015-08-25   |   分类于 编程题   |  
描述 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 = 4, ...
阅读全文 »

Leetcode解题-Reverse Linked List

发表于 2015-08-25   |   分类于 编程题   |  
描述 Reverse a singly linked list. 分析简单题,翻转单链表。时间O(n),空间O(1)。 代码Python1234567891011121314151617181920# Definition for singly-linked list.class ListNode ...
阅读全文 »

Leetcode解题-Add Two Numbers

发表于 2015-08-25   |   分类于 编程题   |  
描述 You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sing ...
阅读全文 »

Leetcode解题-Single Number III

发表于 2015-08-25   |   分类于 编程题   |  
描述 Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elemen ...
阅读全文 »

Leetcode解题-Single Number II

发表于 2015-08-25   |   分类于 编程题   |  
描述 Given an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear runtim ...
阅读全文 »

Leetcode解题-Single Number

发表于 2015-08-25   |   分类于 编程题   |  
描述 Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime comp ...
阅读全文 »
«1…891011»
Garfieldog

Garfieldog

只有猪肉卷是永恒的

158 日志
2 分类
39 标签
RSS
github zhihu
Creative Commons
©   2015 - 2016 Garfieldog
由 Hexo 强力驱动
主题 - NexT