自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 无监督学习-k-means聚类方法

K-Means 聚类方法对象与有监督学习不同的是,无监督学习所面向的数据是没有标签的。那么如果给定一个无标签的数据集,怎么对其进行分类呢,这时就要使用聚类方法K-means 就是聚类方法的一种K-means 的流程:k-means 是一个迭代算法,可以按以下步骤记忆按照给定的K值产生K个不同的聚类中心数据点与K个聚类中心进行距离上的计算,每个数据点选择其本身距离最近的聚类中...

2019-11-28 20:28:40 532

原创 ubuntu18.04 + opencv3 c++ 环境配置及编译

ubuntu18.04 + opencv3 c++ 环境配置及编译在安装opencv前,一定先安装pkg-config和libgtk2.0-dev,顺序不能颠倒,不然编译出来的程序会有Unspecified error的情况发生。在官网下载好opencv3的压缩包,解压到任意目录,然后进入该文件夹。在该文件夹目录下创建一个空的文件夹,可以命名为release,然后进入该文件夹(此时该文件...

2019-03-11 18:36:44 5145 4

原创 推免复试——计算机网络(二) 物理层、数据链路层

第二章 物理层与数据链路层(一)物理层1.信道(channel):向某一方向传输信息的媒体通信信道 = 发送信道 + 接收信道分类:① 单工:只能沿一个方向输送② 半双工:可以双向传输,但不可以同时③ 全双工:可以双向同时传输2.信道容量:单位时间内信道正确传输的比特数 bps波特率B:信号值每秒中变化次数比特率b:每秒钟传输的数据位数3.差分曼彻斯特编码:曼彻...

2018-09-19 22:16:02 294

原创 推免复试——计算机网络(一) 概述

第一章 概述:1.基本概念:报文(message):网络中交换与传输的数据单元,即站点一次性要发放的数据块。报文中包含了将要发送的完整数据信息,其长短可不一致,长度不限且可变。分组,包(packet):用户发送的数据会被分成多个更小的部分,每个部分前面会加上对数据的描述和控制信息。message 可以被拆成不同的 packetpacket = header + data协议(p...

2018-09-19 21:03:21 998

原创 LeetCode 31. Next Permutation

题目描述:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possi...

2018-09-19 20:08:52 92

原创 LeetCode 30. Substring with Concatenation of All Words

题目描述:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once ...

2018-09-18 22:27:01 139

原创 LeetCode 25. Reverse Nodes in k-Group

LeetCode 25. 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.k is a positive integer and is less than or equal t...

2018-08-29 18:36:16 109

原创 LeetCode 23. Merge k Sorted Lists

LeetCode 23. Merge k Sorted Lists题目描述: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, ...

2018-08-29 17:52:26 96

原创 leetcode 10 Regular Expression Matching

leetcode 10 Regular Expression Matching题目描述:Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’.‘.’ Matches any single character. ...

2018-08-27 21:10:21 735

原创 LeetCode 48. Rotate Image(矩阵旋转相关)

LeetCode 48. Rotate ImageYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have ...

2018-08-23 11:17:15 145

原创 LeetCode 131. Palindrome Partitioning

LeetCode 131. Palindrome PartitioningGiven a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.Example:Input...

2018-08-22 16:32:58 123

原创 LeetCode 91. Decode Ways

LeetCode 91. Decode WaysA message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given a non-empty string contain...

2018-08-22 11:39:17 131

原创 LeetCode 46. Permutations(回溯法解决)

LeetCode 46. Permutations题目描述:Given a collection of distinct integers, return all possible permutations.Example:Input: [1,2,3]Output:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2]...

2018-08-20 19:27:57 255

原创 LeetCode 24. Swap Nodes in Pairs(链表交换操作)

LeetCode 24. Swap Nodes in Pairs题目描述:Given a linked list, swap every two adjacent nodes and return its head.Example:Given 1->2->3->4, you should return the list as 2->1->4...

2018-08-20 17:03:24 109

原创 LeetCode 22. Generate Parentheses

LeetCode 22. Generate Parentheses题目描述:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ ...

2018-08-19 16:57:28 106

原创 LeetCode 873. Length of Longest Fibonacci Subsequence

LeetCode 873. Length of Longest Fibonacci Subsequence题目描述:A sequence X_1, X_2, …, X_n is fibonacci-like if:n >= 3X_i + X_{i+1} = X_{i+2} for all i + 2 <= nGiven a strictly increasi...

2018-08-19 15:19:06 494

原创 LeetCode 2. Add Two Numbers

LeetCode 2. 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...

2018-08-16 12:04:27 93

原创 DFS 和 BFS 写在124题后

深度优先搜索(Depth First Search)和广度优先搜索(Breadth First Search)深度优先遍历图的方法是,从图中某顶点v出发(百度百科): (1)访问顶点v; (2)依次从v的未被访问的邻接点出发,对图进行深度优先遍历;直至图中和v有路径相通的顶点都被访问; (3)若此时图中尚有顶点未被访问,则从一个未被访问的顶点出发,重新进行深度优先遍历,直到图中所...

2018-08-16 10:30:32 122

原创 LeetCode 127. Word Ladder

题目描述:Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation sequence from beginWord to endWord, such that:Only one letter can be changed ...

2018-08-16 10:28:24 394

原创 LeetCode 98. Validate Binary Search Tree

LeetCode 98. Validate Binary Search Tree题目描述:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains...

2018-08-15 12:24:44 178

原创 LeetCode 73. Set Matrix Zeroes

LeetCode 73. Set Matrix Zeroes题目描述:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place.Example 1:Input: [ [1,1,1], [1,0,1], [1,1,1]]Outp...

2018-08-14 20:31:46 83

原创 LeetCode 65. Valid Number

LeetCode 65. Valid Number题目描述:Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNot

2018-08-14 17:10:25 115

原创 LeetCode 15. 3Sum

LeetCode 15. 3Sum题目描述: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:...

2018-08-14 10:51:18 88

原创 LeetCode 8. String to Integer (atoi)

LeetCode 8. String to Integer (atoi)题目描述:Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-white...

2018-08-13 17:57:55 77

原创 38. Count and Say

38. Count and Say题目描述:The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211 is read off as...

2018-08-12 12:11:17 1154

原创 28. Implement strStr()

28. Implement strStr()题目描述:Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello",...

2018-08-12 11:12:05 95

原创 27. Remove Element

27. Remove Element跟26题类似,没什么营养 在重新确定数组长度时,除了erase还可以用base迭代器和resize函数操作以下,即直接nums.resize(base)class Solution {public: int removeElement(vector<int>& nums, int val) { ...

2018-08-12 10:46:09 134

原创 26. Remove Duplicates from Sorted Array

26. Remove Duplicates from Sorted Array题目描述:Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra s...

2018-08-12 10:36:57 92

原创 LeetCode 21 Merge Two Sorted Lists

LeetCode 21 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. 翻译: 将两个已经排...

2018-08-11 20:45:45 109

空空如也

空空如也

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

TA关注的人

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