• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
xiaoba1203
记录leetcode之路
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

随笔分类 -  leetcode

上一页 1 2 3 4 5 6 7 8 9 下一页

leetcode 历程
 
leetcode 150. Evaluate Reverse Polish Notation ------ java
摘要:Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2016-11-18 18:12 xiaoba1203 阅读(526) 评论(0) 推荐(0)
leetcode 149. Max Points on a Line --------- java
摘要:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 求二维平面上n个点中,最多共线的点数。 1、比较直观的方法是,三层循环,以任意两点划线,判断第三个点 阅读全文
posted @ 2016-11-18 16:55 xiaoba1203 阅读(343) 评论(0) 推荐(0)
leetcode 148. Sort List ----- java
摘要:Sort a linked list in O(n log n) time using constant space complexity. 排序,要求是O(nlog(n))的时间复杂度和常数的空间复杂度,那么就使用归并就可以了。 阅读全文
posted @ 2016-11-18 11:19 xiaoba1203 阅读(364) 评论(0) 推荐(0)
leetcode 147. Insertion Sort List ----- java
摘要:Sort a linked list using insertion sort. 插入排序。 /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNo 阅读全文
posted @ 2016-11-16 16:43 xiaoba1203 阅读(145) 评论(0) 推荐(0)
leetcode 146. LRU Cache ----- java
摘要:esign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the 阅读全文
posted @ 2016-11-16 16:05 xiaoba1203 阅读(519) 评论(0) 推荐(0)
leetcode 145. Binary Tree Postorder Traversal ----- java
摘要:Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [3,2,1]. Note: Recursive sol 阅读全文
posted @ 2016-11-16 11:29 xiaoba1203 阅读(204) 评论(0) 推荐(0)
leetcode 144. Binary Tree Preorder Traversal ----- java
摘要:Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. Note: Recursive solu 阅读全文
posted @ 2016-11-16 11:02 xiaoba1203 阅读(272) 评论(0) 推荐(0)
leetcode 143. Reorder List ----- java
摘要:Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
posted @ 2016-11-16 10:35 xiaoba1203 阅读(286) 评论(0) 推荐(0)
leetcode 142. Linked List Cycle II ----- java
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you 阅读全文
posted @ 2016-11-15 17:55 xiaoba1203 阅读(244) 评论(0) 推荐(0)
leetcode 141. Linked List Cycle ----- java
摘要:Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 判断是否成环 1、利用set,很简单,但是题目中说不要用额外的空间。 2、设置两 阅读全文
posted @ 2016-11-15 16:32 xiaoba1203 阅读(150) 评论(0) 推荐(0)
leetcode 140. Word Break II ----- java
摘要:Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such p 阅读全文
posted @ 2016-11-15 16:06 xiaoba1203 阅读(325) 评论(0) 推荐(0)
leetcode 139. Word Break ----- java
摘要:Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For 阅读全文
posted @ 2016-11-15 14:59 xiaoba1203 阅读(208) 评论(0) 推荐(0)
leetcode 138. Copy List with Random Pointer ----- java
摘要:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2016-11-15 12:00 xiaoba1203 阅读(190) 评论(0) 推荐(0)
leetcode 137. Single Number II ----- java
摘要:Given an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should have a linear runtime c 阅读全文
posted @ 2016-11-15 10:11 xiaoba1203 阅读(140) 评论(0) 推荐(0)
leetcode 136. Single Number ----- java
摘要:Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex 阅读全文
posted @ 2016-11-14 16:40 xiaoba1203 阅读(108) 评论(0) 推荐(0)
leetcode 135. Candy ----- java
摘要:There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re 阅读全文
posted @ 2016-11-14 16:33 xiaoba1203 阅读(359) 评论(0) 推荐(0)
leetcode 134. Gas Station ----- 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 cost 阅读全文
posted @ 2016-11-14 14:30 xiaoba1203 阅读(237) 评论(0) 推荐(0)
leetcode 133. Clone Graph ----- java
摘要: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-11-14 10:54 xiaoba1203 阅读(196) 评论(0) 推荐(0)
leetcode 132. Palindrome Partitioning II ----- java
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning 阅读全文
posted @ 2016-11-11 16:31 xiaoba1203 阅读(180) 评论(0) 推荐(0)
leetcode 130. Surrounded Regions----- java
摘要:Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in 阅读全文
posted @ 2016-11-10 17:29 xiaoba1203 阅读(657) 评论(0) 推荐(0)
 

上一页 1 2 3 4 5 6 7 8 9 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3