随笔分类 -  leetcode

摘要:题目:ZigZag Conversion The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pat 阅读全文
posted @ 2018-06-03 16:34 pathjh 阅读(161) 评论(0) 推荐(0)
摘要:题目:Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The 阅读全文
posted @ 2018-05-27 22:28 pathjh 阅读(149) 评论(0) 推荐(0)
摘要:题目:在两个排序数组中寻找第K小的数 举例: arr1=[1,2,3,4,5],arr2=[3,4,5],k=1 1是所有数中第一小的数,所以返回1 arr1=[1,2,3],arr2=[3,4,5,6],k=4 3是所有数中第4小的数,所以返回3 要求:如果arr1的长度为N,arr2的长度为M, 阅读全文
posted @ 2018-05-27 21:33 pathjh 阅读(4346) 评论(0) 推荐(1)
摘要:题目:Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. E 阅读全文
posted @ 2018-05-27 15:18 pathjh 阅读(120) 评论(0) 推荐(0)
摘要:题目:Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. Examples: Giv 阅读全文
posted @ 2018-05-26 22:33 pathjh 阅读(157) 评论(0) 推荐(0)
摘要:题目:Add Two Numbers You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of 阅读全文
posted @ 2018-05-26 17:02 pathjh 阅读(143) 评论(0) 推荐(0)
摘要:题目描述 Implement regular expression matching with support for'.'and'*'. '.' Matches any single character. '*' Matches zero or more of the preceding elem 阅读全文
posted @ 2018-05-16 01:07 pathjh 阅读(317) 评论(0) 推荐(0)
摘要:总结:对于二叉树的常见问题: 当涉及到按层序遍历,对二叉树进行各种操作时,常常采用栈或队列来对每一层数据进行保存 收获:对做题时常用的结构的方法进行了一下简要总结 1.Queue Queue: 基本上,一个队列就是一个先入先出(FIFO)的数据结构 Queue接口与List、Set同一级别,都是继承 阅读全文
posted @ 2018-03-31 00:47 pathjh 阅读(317) 评论(0) 推荐(0)