xinyu04

导航

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 30 下一页

2022年7月25日 #

LeetCode 77 Combinations 回溯

摘要: Given two integers $n$ and $k$, return all possible combinations of $k$ numbers out of the range [1, n]. You may return the answer in any order. Solut 阅读全文

posted @ 2022-07-25 15:00 Blackzxy 阅读(14) 评论(0) 推荐(0) 编辑

2022年7月24日 #

LeetCode 206 Reverse Linked List 翻转链表

摘要: Given the head of a singly linked list, reverse the list, and return the reversed list. Solution 点击查看代码 /** * Definition for singly-linked list. * str 阅读全文

posted @ 2022-07-24 16:19 Blackzxy 阅读(15) 评论(0) 推荐(0) 编辑

LeetCode 21 Merge Two Sorted Lists 链表合并

摘要: You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing toge 阅读全文

posted @ 2022-07-24 15:34 Blackzxy 阅读(12) 评论(0) 推荐(0) 编辑

LeetCode 102 Binary Tree Level Order Traversal 层序BFS

摘要: Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Solution 用 $BFS$ 即 阅读全文

posted @ 2022-07-24 05:27 Blackzxy 阅读(5) 评论(0) 推荐(0) 编辑

2022年7月23日 #

LeetCode 78 Subsets 回溯

摘要: Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Retu 阅读全文

posted @ 2022-07-23 21:07 Blackzxy 阅读(13) 评论(0) 推荐(0) 编辑

LeetCode 994 Rotting Oranges BFS

摘要: You are given an m x n grid where each cell can have one of three values: 0 representing an empty cell, 1 representing a fresh orange, or 2 representi 阅读全文

posted @ 2022-07-23 16:31 Blackzxy 阅读(13) 评论(0) 推荐(0) 编辑

LeetCode 542 01 Matrix BFS

摘要: Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is $1$ Solution 首先将所有的 $ 阅读全文

posted @ 2022-07-23 15:17 Blackzxy 阅读(9) 评论(0) 推荐(0) 编辑

Codeforces Round #805 (Div. 3) A C D E F题解

摘要: A. problem A 点击查看代码 #include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #include<cstring> #include<string> #include<cmath> #incl 阅读全文

posted @ 2022-07-23 05:54 Blackzxy 阅读(33) 评论(0) 推荐(0) 编辑

2022年7月22日 #

LeetCode 116 Populating Next Right Pointers in Each Node 思维

摘要: You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin 阅读全文

posted @ 2022-07-22 16:28 Blackzxy 阅读(17) 评论(0) 推荐(0) 编辑

LeetCode 617 Merge Two Binary Trees DFS+模板

摘要: You are given two binary trees root1 and root2. Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped w 阅读全文

posted @ 2022-07-22 15:15 Blackzxy 阅读(13) 评论(0) 推荐(0) 编辑

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 30 下一页