09 2018 档案

摘要:Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文 »
posted @ 2018-09-30 22:00 Veritas_des_Liberty 阅读(118) 评论(0) 推荐(0) 编辑
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, just two one's 阅读全文 »
posted @ 2018-09-30 20:48 Veritas_des_Liberty 阅读(171) 评论(0) 推荐(0) 编辑
摘要:Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp 阅读全文 »
posted @ 2018-09-30 09:19 Veritas_des_Liberty 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. The matching should cover the entire  阅读全文 »
posted @ 2018-09-30 08:33 Veritas_des_Liberty 阅读(156) 评论(0) 推荐(0) 编辑
摘要:Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Example 3: 阅读全文 »
posted @ 2018-09-28 21:17 Veritas_des_Liberty 阅读(185) 评论(0) 推荐(0) 编辑
摘要:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文 »
posted @ 2018-09-28 17:47 Veritas_des_Liberty 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: AC code: std 阅读全文 »
posted @ 2018-09-27 22:29 Veritas_des_Liberty 阅读(161) 评论(0) 推荐(0) 编辑
摘要:There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文 »
posted @ 2018-09-27 17:18 Veritas_des_Liberty 阅读(147) 评论(0) 推荐(0) 编辑
摘要:Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer 阅读全文 »
posted @ 2018-09-27 16:50 Veritas_des_Liberty 阅读(145) 评论(0) 推荐(0) 编辑
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文 »
posted @ 2018-09-27 16:35 Veritas_des_Liberty 阅读(158) 评论(0) 推荐(0) 编辑
摘要:本题要求实现一个函数,找到并返回链式表的第K个元素。 函数接口定义: ElementType FindKth( List L, int K ); 其中List结构定义如下: typedef struct LNode *PtrToLNode; struct LNode { ElementType Da 阅读全文 »
posted @ 2018-09-25 17:19 Veritas_des_Liberty 阅读(909) 评论(0) 推荐(0) 编辑
摘要:本题要求实现一个函数,求链式表的表长。 函数接口定义: 其中List结构定义如下: L是给定单链表,函数Length要返回链式表的长度。 裁判测试程序样例: 输入样例: 输出样例: AC code: 阅读全文 »
posted @ 2018-09-25 17:04 Veritas_des_Liberty 阅读(840) 评论(0) 推荐(0) 编辑
摘要:本题要求实现顺序表的操作集。 函数接口定义: 其中List结构定义如下: 各个操作函数的定义为: List MakeEmpty():创建并返回一个空的线性表; Position Find( List L, ElementType X ):返回线性表中X的位置。若找不到则返回ERROR; bool I 阅读全文 »
posted @ 2018-09-25 17:01 Veritas_des_Liberty 阅读(1631) 评论(1) 推荐(1) 编辑
摘要:本题要求实现一个函数,将给定的单链表逆转。 函数接口定义: List Reverse( List L ); 其中List结构定义如下: typedef struct Node *PtrToNode; struct Node { ElementType Data; /* 存储结点数据 */ PtrTo 阅读全文 »
posted @ 2018-09-25 16:19 Veritas_des_Liberty 阅读(3287) 评论(3) 推荐(0) 编辑
摘要:K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。 所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数。 例如:n = 13,S中 >= 13的最小的数是15,所以输出15。 Input Output Input示例 Out 阅读全文 »
posted @ 2018-09-23 17:11 Veritas_des_Liberty 阅读(309) 评论(0) 推荐(0) 编辑
摘要:将一堆正整数分为2组,要求2组的和相差最小。 例如:1 2 3 4 5,将1 2 4分为1组,3 5分为1组,两组和相差1,是所有方案中相差最少的。 Input Output Input示例 Output示例 分成两组当两组的数据都趋向于算术平均值的时候此时的差值最小,res来表示一个背包,背包的空 阅读全文 »
posted @ 2018-09-23 15:40 Veritas_des_Liberty 阅读(282) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示