- 博客(48)
- 资源 (5)
- 收藏
- 关注
原创 LeetCode题解——Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB class Solut
2015-07-31 09:50:29 548
转载 计算机视觉、机器学习、人工智能领域知识汇总
http://blog.csdn.net/zouxy09 2012年8月21号开始了我的第一篇博文,也开始了我的研究生生涯。怀着对机器学习和计算机视觉等等领域的懵懂,从一个电子材料的领域跨入这个高速发展的人工智能领域。从开始的因无知而惊慌,因陌生而乏力,到一步步的成长。这过程的知识积累也都大部分反映在这个博客上面了。感谢这个平台促使自己去总结去坚持去进步。也感谢这个平
2015-07-30 11:24:27 5523 2
原创 LeetCode题解——Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.class Solution {public: int divide(int dividend, int divisor) { long a =
2015-07-29 15:48:57 448
原创 LeetCode题解——Implement strStr()
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):The signature of the function had been updat
2015-07-29 14:25:50 429
原创 LeetCode题解——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 val
2015-07-29 14:06:30 528
原创 LeetCode题解——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 --> 5Credits:Special than
2015-07-29 11:05:57 782
原创 LeetCode题解——Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2015-07-29 10:45:10 542
原创 LeetCode题解——Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.c
2015-07-29 10:42:42 473
原创 LeetCode题解——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.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is
2015-07-29 10:18:41 423
原创 LeetCode题解——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 space. Y
2015-07-28 19:14:35 412
原创 LeetCode题解——Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *ne
2015-07-28 16:39:43 522
原创 LeetCode题解——Sort List
Sort a linked list in O(n log n) time using constant space complexity.用冒泡:时间超出用归并:成功解决/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; *
2015-07-28 16:13:06 388
转载 Softmax回归
Softmax回归Contents [hide]1 简介2 代价函数3 Softmax回归模型参数化的特点4 权重衰减5 Softmax回归与Logistic 回归的关系6 Softmax 回归 vs. k 个二元分类器7 中英文对照8 中文译者简介在本节中,我们介绍Softmax回归模型,该模型是logi
2015-07-28 15:16:01 559
原创 LeetCode题解——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.//用递归,不会占用额外的空间,如果是直接比较会占用额外的空间,大小与两个链表的长度成正比/** * D
2015-07-21 21:15:11 484
原创 LeetCode题解——Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold add
2015-07-21 21:12:25 579
原创 LeetCode题解——Remove Nth Node From End of List
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 end, the
2015-07-14 20:14:27 447
原创 LeetCode题解——Letter Combinations of a Phone Number
Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone b
2015-07-14 20:09:36 523
原创 LeetCode题解——4SUm
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Element
2015-07-14 20:02:58 473
原创 LeetCode题解——3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact
2015-07-14 19:58:14 485
原创 LeetCode题解——Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all va
2015-07-14 19:53:51 462
原创 LeetCode题解——Generate Parentheses
做了一些题目之后,发现使用递归的地方和使用回溯的地方也可以使用动态规划来求解,而且动态规划求解更加易于理解和实现,算法的效率更高。//递归方法class Solution {public: vector generateParenthesis(int n) { vector ans; if(n==0){ string s=""
2015-07-14 19:49:42 512
转载 单链表初始化、插入、删除
单链表初始化、插入、删除//单链表初始化、插入、删除#include #include typedef int ElemType; //定义结点类型 typedef struct Node{ ElemType data; //单链表中的数据域 struct Node *next; //单链表的指针域 }N
2015-07-14 16:29:16 1413
原创 LeetCode题解——3Sum
iven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c)
2015-07-12 22:11:42 528
原创 LeetCode题解——Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.以第一个str作为比较标准。class Solution {public: string longestCommonPrefix(vector& strs) { if(strs
2015-07-12 20:52:48 417
原创 LeetCode题解——Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.class Solution {public: string intToRoman(int num) { string M[4] = {"
2015-07-12 20:01:14 570
原创 LeetCode题解——Roman to Integer
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.class Solution {public: int romanToInt(string s) { int base[128];
2015-07-12 19:58:50 535
转载 最小生成树(MST)—prim和kruskal算法
最小生成树(MST:minimum-cost spanning tree)也称最小支撑树,任何只由G的边构成,并包含G的所有顶点的树称为G的生成树(G连通).加权无向图G的生成树的代价是该生成树的所有边的代码(权)的和.最小代价生成树是其所有生成树中代价最小的生成树。实现最小生成树的算法常用的是Prim,Kruskal学校数据结构的书上讲解了这两大算法的思路及用C++实现,但关于其
2015-07-11 22:41:19 7308
转载 最短路径—Dijkstra算法和Floyd算法
http://www.cnblogs.com/biyeymyhjob/archive/2012/07/31/2615833.html最短路径—Dijkstra算法和Floyd算法Dijkstra算法1.定义概览Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止
2015-07-11 22:14:47 2110
原创 TopSort(拓扑排序)中DFS和BFS的应用
图的搜索:深度优先搜索:下面图中的数字显示了深度优先搜索顶点被访问的顺序。为了实现深度优先搜索,首先选择一个起始顶点并需要遵守三个规则:(1) 如果可能,访问一个邻接的未访问顶点,标记它,并把它放入栈中。(2) 当不能执行规则1时,如果栈不空,就从栈中弹出一个顶点。(3) 如果不能执行规则1和规则2,就完成了整个搜索过程。广度优先搜索:在深度优先搜索中,算法
2015-07-11 21:39:28 12874 1
原创 LeetCode题解——Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin
2015-07-11 16:31:38 458
原创 LeetCode题解——Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]
2015-07-11 16:25:04 607
原创 LeetCode题解——9Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.class Solution {public: bool isPalindrome(int x) { if(x<0||(x!=0&&x%10==0)) return false; i
2015-07-11 13:21:50 449
原创 LeetCode题解——8 String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca
2015-07-11 13:18:08 484
原创 LeetCode题解——7Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321class Solution {public: int reverse(int x) { long result=0; while(x!=0) { result = re
2015-07-11 13:14:37 489
原创 LeetCode题解——6ZigZag Conversion
题目:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA
2015-07-11 13:11:41 475
原创 LeetCode题解——10Regular Expression Matching
题目:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire i
2015-07-11 13:02:32 683
转载 B树、B+树、B*树
2-3树和B树很少用于实现,经常使用的是B树的变体B+树和B*树,它们具有更高的效率B树 是一种多路搜索树(并不是二叉的): 1.定义任意非叶子结点最多只有M个儿子;且M>2; 2.根结点的儿子数为[2, M]; 3.除根结点以外的非叶子结点的儿子数为[M/2, M]; 4.每个结点存放至少
2015-07-11 11:52:07 430
转载 2-3树—检索数据类型
在2-3树中,每个内部节点(非叶子节点)有两个或三个孩子,而且所有叶子都在同一级别上。例如,图1显示高度为3的2-3树。包含两个孩子的节点称为2-节点,二叉树中的节点都是2-节点;包含三个孩子的节点称为3-节点。
2015-07-11 11:30:39 518
转载 Fast object segmentation in unconstrained video——非限制场景快速视频对象分割 原文翻译
Fast object segmentation in unconstrained video非限制场景快速视频对象分割ICCV2013 爱丁堡大学,英国Anestis Papazoglou,Vittorio Ferrari摘要:我们展示了一项从视频背景中分离出前景的技术,它快速、全自动并且对视频做最小的限制。这使得我们可以处理更基础的非限制的集合,包括快速移动的背景、任意物体的运
2015-07-07 18:52:05 2745
转载 Occlusion Geodesics for Online Multi-Object Tracking编译过程
转自:http://blog.csdn.net/minstyrain/article/details/33796753百度想钱相疯了,这种技术报告都传不到文库...CVPR2014http://www.cvpapers.com/cvpr2014.html上的处理遮挡的,应该是最新的进展。OcclusionGeodesics for Online Multi-Object Track
2015-07-07 17:45:45 766
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人