随笔分类 -  数据结构

摘要:A binary heap is a heap data struc­ture cre­ated using a binary tree. binary tree has two rules - Imple­men­ta­tion: Use array to store the data. Star 阅读全文
posted @ 2016-06-30 00:09 流白 阅读(565) 评论(0) 推荐(0)
摘要:package dataStructure; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; import java.io.*; cl 阅读全文
posted @ 2016-01-24 08:32 流白 阅读(516) 评论(0) 推荐(0)
摘要:Given an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive.Theupdate(i, val)function modifiesnumsby updating the el... 阅读全文
posted @ 2015-11-20 11:13 流白 阅读(552) 评论(0) 推荐(0)
摘要:STL中的list就是一双向链表,可高效地进行插入删除元素。List是C++标准程式库中的一个类,可以简单视之为双向连结串行,以线性列的方式管理物件集合。list 的特色是在集合的任何位置增加或删除元素都很快,但是不支持随机存取。list 是C++标准程式库提供的众多容器(container)之一,... 阅读全文
posted @ 2015-11-12 21:57 流白 阅读(465) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/word-search/class Solution {public: struct Trie{ Trie *next[57]; bool isWord; Trie() { ... 阅读全文
posted @ 2015-11-10 11:00 流白 阅读(493) 评论(0) 推荐(0)
摘要:Check whether a given graph is Bipartite or notABipartite Graphis a graph whose vertices can be divided into two independent sets, U and V such that e... 阅读全文
posted @ 2015-10-24 10:09 流白 阅读(194) 评论(0) 推荐(0)
摘要:Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second.For example, in the following graph... 阅读全文
posted @ 2015-10-23 19:48 流白 阅读(296) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn = 10; 8 struct edge{ 9 int to, cost;10 edge(in... 阅读全文
posted @ 2015-10-23 11:05 流白 阅读(309) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 struct BST{ 8 int key; 9 BST *lc, *rc;10 BST(){11 ... 阅读全文
posted @ 2015-10-22 16:55 流白 阅读(150) 评论(0) 推荐(0)