自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 [leetcode]高级算法——回溯算法

分割回文串Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.Example:Input: "aab"Output:[ ["aa","b"], ["a","a",".

2018-07-13 10:59:57 338

原创 [leetcode]高级算法——树和图

被围绕的区域Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.Example:X X X XX O O ...

2018-07-08 00:28:40 434

原创 [leetcode]高级算法——链表

合并K个排序链表Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[  1->4->5,  1->3->4,  2->6]Output: 1->1->2->3-&gt...

2018-07-04 23:48:50 179

原创 [leetcode]高级算法——数组和字符串

除自身以外数组的乘积Given an array nums of n integers where n > 1,  return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Example:Input: [1,2,3,4]Out...

2018-07-04 15:44:35 255

原创 [leetcode]中级算法——设计

二叉树的序列化和反序列化Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connectio...

2018-07-02 22:12:58 224

原创 [leetcode]中级算法——其他

快乐数Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares ...

2018-07-02 20:51:52 229

原创 [leetcode]中级算法——动态规划

跳跃游戏Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if yo...

2018-06-30 23:37:03 179

原创 [leetcode]中级算法——排序和搜索

分类颜色Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the ...

2018-06-30 16:00:28 829

原创 [leetcode]中级算法——回溯算法

电话号码的字母组合Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons)...

2018-06-29 23:24:40 325

原创 [leetcode]中级算法——树和图

二叉树的中序遍历Given a binary tree, return the inorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [1,3,2]Code(By myself):# Definition for a binary tree n...

2018-06-28 23:40:22 251

原创 [leetcode]中级算法——链表

两数相加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 retu...

2018-06-28 00:01:30 203

原创 [leetcode]中级算法——数组和字符串

三数之和Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not cont...

2018-06-27 16:41:33 161

原创 [lleetcode]初级算法——设计问题

打乱数组Shuffle a set of numbers without duplicates.Example:// Init an array with set 1, 2, and 3.int[] nums = {1,2,3};Solution solution = new Solution(nums);// Shuffle the array [1,2,3] and return it...

2018-06-20 13:28:40 153

原创 [leetcode]初级算法——其他

位1的个数Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 0000000...

2018-06-20 11:16:40 141

原创 [leetcode]初级算法——数学

Fizz BuzzWrite a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Bu...

2018-06-19 21:13:53 205

原创 [leetcode]初级算法——动态规划

爬楼梯You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive ...

2018-06-18 15:35:22 247

原创 [leetcode]初级算法——排序和搜索

合并两个有序数组Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectively.You may assume t...

2018-06-17 16:42:06 178

原创 [leetcode]初级算法——树

二叉树的最大深度Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node with no chi...

2018-06-17 15:23:04 134

原创 [leetcode]初级算法——链表

删除链表中的节点Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Example:Input: head = [4,5,1,9], node = 5Output: [4,1,9]Explanation: You are given...

2018-06-16 13:44:00 160

原创 [leetcode]初级算法——字符串

反转字符串Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".Code(By myself):class Solution: def reverseString(self, s): """...

2018-06-15 14:13:38 260

原创 [leetcode]初级算法——数组

Title:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., bu...

2018-05-26 15:28:50 226

原创 时间序列的R语言实现

时间序列简介时间序列(或称动态数列)是指将同一统计指标的数值按其发生的时间先后顺序排列而成的数列。时间序列分析的主要目的是根据已有的历史数据对未来进行预测。本文主要记录时间序列的几种模型及其R语言实现。需要用到的包:library(zoo)library(forecast)library(tseries)白噪声的判断首先,我们先对数据进行检测,判断数据是否是白噪声(纯随机序列)这里可以使用Bo...

2018-03-15 15:58:24 7676 1

原创 欢迎使用CSDN-markdown编辑器

python包之间调用一般我们会将自己写的 Python 模块与 Python 自带的模块分开存放以达到便于维护的目的。调用可以分为二种:一、同一子目录下互相调用 如a调用b: 直接使用from b import xxx(*)即可二、调用父包同一目录下模块 如a1中调用b:方法一:在各个包目录下添加__init__.python文件让其成为包后才可调用。使用from

2017-10-25 09:23:12 133

空空如也

空空如也

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

TA关注的人

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