题目: Given a binary tree, return the preorder traversal of its nodes’ values. For example: Give…
分类:LeetCode
[剑指offer] 最小的K个数
本文首发于我的个人博客:尾尾部落 题目描述 输入n个整数,找出其中最小的K个数。例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4。 解题思路 两种方法: 法1:先对数组排序,然后取出前k…
48. Rotate Image
48. Rotate Image 题目 You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (cl…
38. Count and Say
题目 The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3…
107. Binary Tree Level Order Traversal II
欢迎fork and star:Nowcoder-Repository-github 107. Binary Tree Level Order Traversal II 题目 Given a binary tree, r…
131. Palindrome Partitioning
欢迎fork and star:Nowcoder-Repository-github 131. Palindrome Partitioning 题目 Given a string s, partition s such …
[LeetCode] IP to CIDR 将IP地址转为CIDR无类别域间路由
Given a start IP address ip and a number of ips we need to cover n, return a representation of the rang…
[Leecode] Linked List Cycle 链表环
Linked List Cycle I Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it withou…
LeetCode | Partition List(partition方法处理链表)
Given a linked list and a value x, partition it such that all nodes less than x come before nod…
[array] leetCode-1-Two Sum-Easy
leetCode-1-Two Sum-Easy descrition Given an array of integers, return indices of the two numbers such that the…
Longest Increasing Subsequence 解题报告
Description: Given a sequence of integers, find the longest increasing subsequence (LIS). You code should retu…
【LeetCode】 -- Merge k Sorted Lists
1、题目描述 Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe…