![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DataStructure
文章平均质量分 86
Follow_Inner_Heart
蚂蚁,坚持,喜爱算法,关注大数据和智能家居。
展开
-
Leetcode 难度及面试频率和算法
转载自:LeetCode Question Difficulty Distribution 1Two Sum25arraysort setTwo Pointe转载 2013-11-21 08:57:16 · 918 阅读 · 0 评论 -
数据结构之图(存储结构、遍历)
一、图的存储结构1.1 邻接矩阵 图的邻接矩阵存储方式是用两个数组来表示图。一个一维数组存储图中顶点信息,一个二维数组(邻接矩阵)存储图中的边或弧的信息。 设图G有n个顶点,则邻接矩阵是一个n*n的方阵,定义为: 看一个实例,下图左就是一个无向图。 从上面可以看出,无向图的边数组是一转载 2014-08-16 16:26:33 · 549 阅读 · 0 评论 -
并查集(Union-Find)算法介绍
本文主要介绍解决动态连通性一类问题的一种算法,使用到了一种叫做并查集的数据结构,称为Union-Find。更多的信息可以参考Algorithms 一书的Section 1.5,实际上本文也就是基于它的一篇读后感吧。原文中更多的是给出一些结论,我尝试给出一些思路上的过程,即为什么要使用这个方法,而不是别的什么方法。我觉得这个可能更加有意义一些,相比于记下一些结论。转载 2014-08-26 16:43:49 · 507 阅读 · 0 评论 -
【LeetCode】 Longest Palindrome Substring
题目链接:http://oj.leetcode.com/problems/longest-palindromic-substring/题目描述:Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that th原创 2014-03-17 22:47:53 · 584 阅读 · 0 评论 -
LeetCode Two Sum
题目链接:http://oj.leetcode.com/problems/two-sum/Two Sum Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indi原创 2014-03-16 17:52:30 · 518 阅读 · 0 评论 -
LeetCode Longest Substring Without Repeating Characters
题目链接:http://oj.leetcode.com/problems/longest-substring-without-repeating-characters/Longest Substring Without Repeating Characters Given a string, find the length of the longest substrin原创 2014-03-16 20:29:45 · 586 阅读 · 0 评论 -
LeetCode Add Two Numbers
题目链接:http://oj.leetcode.com/problems/add-two-numbers/描述:Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order a原创 2014-03-16 20:49:45 · 673 阅读 · 0 评论 -
[leetcode] Single Number II
转自:http://www.tuicool.com/articles/UjQV7n题目描述:给定一个包含n个整数的数组,除了一个数出现一次外所有的整数均出现三次,找出这个只出现一次的整数。题目来源:http://oj.leetcode.com/problems/single-number-ii/题目分析:对于除出现一次之外的所有的整数,其二进制表示中每一位1出现的次数是3的整数转载 2014-03-09 17:31:20 · 641 阅读 · 0 评论 -
最长回文子串
http://blog.csdn.net/sgbfblog/article/details/7979541题目描述给定一个字符串,找出该字符串的最长回文子串。回文字符串指的就是从左右两边看都一样的字符串,如aba,cddc都是回文字符串。字符串abbacdc存在的回文子串有abba和cdc,因此它的最长回文子串为abba。一个容易犯的错误初看这个问题可能转载 2013-11-28 20:56:55 · 879 阅读 · 0 评论 -
数据结构复习之【图】二
一、基本术语图:由有穷、非空点集和边集合组成,简写成G(V,E);Vertex:图中的顶点;无向图:图中每条边都没有方向;有向图:图中每条边都有方向;无向边:边是没有方向的,写为(a,b)有向边:边是有方向的,写为有向边也成为弧;开始顶点称为弧尾,结束顶点称为弧头;简单图:不存在转载 2014-08-16 16:35:36 · 753 阅读 · 0 评论