自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 Remove Nth Node From End of List(删除从最后一个结点起的第n个结点)

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 en...

2018-03-08 15:14:08 331

原创 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 ...

2018-03-07 22:00:42 402

原创 Odd Even Linked List(奇偶链表,把所有第偶数个节点排到所有奇数个结点后面,相对顺序不变)

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.You should try to do it in pla...

2018-03-06 15:22:43 520

原创 Split Linked List in Parts(拆分链表)

Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts".The length of each part should be as equal as possible: no two parts ...

2018-03-03 19:03:41 331

原创 Intersection of Two Linked Lists(找到两个链表的交叉结点)

Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘ c...

2018-03-03 16:07:59 321

原创 Remove Linked List Elements(移除列表中指定的元素)

Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5/** *...

2018-03-01 18:26:02 809

原创 Palindrome Linked List(回文链表)

Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?思路:1、使用快慢指针,找到链表的中点;2、翻转中点之后的链表;3、从头结点开始,翻转的链表和未翻转的链表进行值的比较。/** * Definition for sing...

2018-03-01 11:40:05 225

原创 Linked List Cycle(链表是否有环)

思路:使用快、慢指针,当两个指针相等时,则链表有环。/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution ...

2018-03-01 10:16:52 267

原创 Two Sum(两数之和)

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same el...

2018-03-01 09:47:31 251

原创 Add Two Numbers(两个数相加)

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...

2018-03-01 09:44:19 236

原创 Binary Tree Preorder Traversal(二叉树前序遍历)

Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,2,3]./** * Definition for a binary tree node....

2018-02-28 10:30:00 202

原创 Average of Levels in Binary Tree(二叉树的平均水平)

Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]Explanation:T...

2018-02-27 16:37:45 273

原创 Trim a Binary Search Tree(修剪二叉查找树)

Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the re...

2018-02-27 16:31:54 326

原创 Merge Two Binary Trees(合并两个二叉树)

Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree. ...

2018-02-27 16:28:38 275

原创 Remove Duplicates from Sorted List(移除有序链表的重复元素)

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->1->2->3->3, return 1->2->3./** * D...

2018-02-27 16:08:17 341

原创 Merge Two Sorted Lists(合并两个有序的链表)

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3->4Output: 1->1...

2018-02-27 16:04:24 262

原创 Reverse Linked List(逆链表)

Reverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next;...

2018-02-27 15:51:57 333

原创 Delete Node in a Linked List(删除链表中的结点)

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with ...

2018-02-27 15:48:28 237

原创 Python3调用face++免费API接口识别身份证信息

# 源代码如下import requestsfrom json import JSONDecoderimport datetimehttp_url ="https://api-cn.faceplusplus.com/cardpp/v1/ocridcard"key ="q9LNKjuFDAbUbfh5VG8FEMdJqyVVexM3"secret ="bYTXhWRl

2017-11-06 23:43:55 2921 2

原创 Windows10下安装GPU版本的Tensorflow

1、确保自己的显卡支持CUDA,安装CUDA8.02、下载cudnn6,解压后,修改环境变量,添加到路径,如下图:3、安装Python3.5版本的anaconda34、命令行输入命令  pip install --upgrade tensorflow-gpu(没有pip的自行百度安装的方法)5、个人安装之前遇到的问题:安装的TensorFlow版本为1.3,之前

2017-09-10 18:27:33 340

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除