随笔分类 - 数据结构
摘要:A binary heap is a heap data structure created using a binary tree. binary tree has two rules - Implementation: Use array to store the data. Star
阅读全文
摘要:package dataStructure; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; import java.io.*; cl
阅读全文
摘要:Given an integer arraynums, find the sum of the elements between indicesiandj(i≤j), inclusive.Theupdate(i, val)function modifiesnumsby updating the el...
阅读全文
摘要:STL中的list就是一双向链表,可高效地进行插入删除元素。List是C++标准程式库中的一个类,可以简单视之为双向连结串行,以线性列的方式管理物件集合。list 的特色是在集合的任何位置增加或删除元素都很快,但是不支持随机存取。list 是C++标准程式库提供的众多容器(container)之一,...
阅读全文
摘要:https://leetcode.com/problems/word-search/class Solution {public: struct Trie{ Trie *next[57]; bool isWord; Trie() { ...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文

浙公网安备 33010602011771号