时间: 2024-11-03 03:43:54
算法经典文章收藏
算法经典文章收藏的相关文章
【LeetCode-面试算法经典-Java实现】【066-Plus One(加一)】
[066-Plus One(加一)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. 题目大意 给定一个用数组表示的一个数,
【LeetCode-面试算法经典-Java实现】【067-Add Binary(二进制加法)】
[067-Add Binary(二进制加法)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100" 题目大意 给定两个二进制的字符串,返回它们的和,也是二进行制字符串. 解题思路 先将对应的两个二进制字符串
【LeetCode-面试算法经典-Java实现】【130-Surrounded Regions(环绕区域)】
[130-Surrounded Regions(环绕区域)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. For example, X X X X X
【LeetCode-面试算法经典-Java实现】【134-Gas Station(加油站问题)】
[134-Gas Station(加油站问题] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from statio
【LeetCode-面试算法经典-Java实现】【120-Triangle(三角形)】
[120-Triangle(三角形)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,5,7], [4
【LeetCode-面试算法经典-Java实现】【121-Best Time to Buy and Sell Stock(最佳买卖股票的时间)】
[121-Best Time to Buy and Sell Stock(最佳买卖股票的时间)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one
【LeetCode-面试算法经典-Java实现】【125-Valid Palindrome(回文字验证)】
[125-Valid Palindrome(回文字验证)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. &quo
【LeetCode-面试算法经典-Java实现】【226-Invert Binary Tree(反转二叉树)】
[226-Invert Binary Tree(反转二叉树)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 代码下载[https://github.com/Wang-Jun-Chao] 原题 Invert a binary tree. 4 / 2 7 / \ / 1 3 6 9 to 4 / 7 2 / \ / 9 6 3 1 题目大意 将一棵二叉树进行翻转. 解题思路 对每一个结点,将它的左右子树进行交换,再对它的左右子结点进行同样的操作. 代码实现 树结点类 pub
【LeetCode-面试算法经典-Java实现】【219-Contains Duplicate II(包含重复元素II)】
[219-Contains Duplicate II(包含重复元素II)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 代码下载[https://github.com/Wang-Jun-Chao] 原题 Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = n