图的遍历(DFS/BFS)
NJUdudu
这个作者很懒,什么都没留下…
展开
-
复原IP地址
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example: Given “25525511135”,return [“255.255.11.135”, “255.255.111.35”]. (Order does...原创 2018-04-19 12:16:10 · 2278 阅读 · 0 评论 -
搜索二叉树的所有构建情况
原文链接:https://blog.csdn.net/chilseasai/article/details/50083201 题目链接:https://leetcode.com/problems/unique-binary-search-trees-ii/题目:Given n, generate all structurally un...转载 2018-04-19 10:27:04 · 263 阅读 · 1 评论 -
回文分割方案—DFS
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.For example, given s = “aab”, Return [ [“aa”,”b”]...原创 2018-04-04 20:24:51 · 373 阅读 · 0 评论 -
字节跳动笔试—组织优化
题目描述: 解题思路:图的遍历#include<bits/stdc++.h>using namespace std;void dfs(vector<vector<int>>& v,int i, int j,int& n) { if (i<0 || i>=n ||原创 2018-09-09 14:26:58 · 1206 阅读 · 0 评论 -
字节跳动笔试—抖音红人
题目描述: 解题思路:图的遍历#include<bits/stdc++.h>using namespace std;bool bfs(vector<vector<int>>& v, vector<bool>& test, int val) { queue&am原创 2018-09-09 14:26:35 · 5143 阅读 · 4 评论