随笔分类 -  Graph

摘要:You are given a list of edges in a graph with weight. Find all the paths between start node and end node with min weights in the path. The edges like 阅读全文
posted @ 2021-06-25 01:58 北叶青藤 阅读(52) 评论(0) 推荐(0)
摘要:You are given a data structure of employee information, which includes the employee's unique id, their importance value and their direct subordinates' 阅读全文
posted @ 2021-04-12 23:22 北叶青藤 阅读(59) 评论(0) 推荐(0)
摘要:You have a graph of n nodes. You are given an integer n and an array edges where edges[i] = [ai, bi] indicates that there is an edge between ai and bi 阅读全文
posted @ 2021-04-08 08:17 北叶青藤 阅读(173) 评论(0) 推荐(0)
摘要:You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1. Return the size of the largest island in grid after applyi 阅读全文
posted @ 2021-04-07 12:49 北叶青藤 阅读(89) 评论(0) 推荐(0)
摘要:There are n cities connected by m flights. Each flight starts from city u and arrives at v with a price w. Now given all the cities and flights, toget 阅读全文
posted @ 2021-04-05 07:05 北叶青藤 阅读(58) 评论(0) 推荐(0)
摘要:Given a directed acyclic graph (DAG) of n nodes labeled from 0 to n - 1, find all possible paths from node 0 to node n - 1, and return them in any ord 阅读全文
posted @ 2020-12-27 02:45 北叶青藤 阅读(103) 评论(0) 推荐(0)
摘要:You are given some lists of regions where the first region of each list includes all other regions in that list. Naturally, if a region X contains ano 阅读全文
posted @ 2020-12-27 00:54 北叶青藤 阅读(118) 评论(0) 推荐(0)
摘要:Given a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements a 阅读全文
posted @ 2020-12-14 14:05 北叶青藤 阅读(121) 评论(0) 推荐(0)
摘要:In an infinite chess board with coordinates from -infinity to +infinity, you have a knight at square [0, 0].A knight has 8 possible moves it can make, 阅读全文
posted @ 2020-12-14 13:57 北叶青藤 阅读(216) 评论(0) 推荐(0)
摘要:We are given a binary tree (with root node root), a target node, and an integer value K. Return a list of the values of all nodes that have a distance 阅读全文
posted @ 2020-02-02 23:55 北叶青藤 阅读(193) 评论(0) 推荐(0)
摘要:Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it's set of nodes into two ind 阅读全文
posted @ 2019-08-29 13:31 北叶青藤 阅读(314) 评论(0) 推荐(0)
摘要:Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given 阅读全文
posted @ 2019-08-02 11:48 北叶青藤 阅读(202) 评论(0) 推荐(0)
摘要:Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled 阅读全文
posted @ 2016-12-13 08:38 北叶青藤 阅读(195) 评论(0) 推荐(0)
摘要:Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick 阅读全文
posted @ 2016-10-17 09:40 北叶青藤 阅读(269) 评论(0) 推荐(0)
摘要:There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the 阅读全文
posted @ 2016-09-01 23:07 北叶青藤 阅读(286) 评论(0) 推荐(0)