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

03 2015 档案

 
Leetcode 15 3sum
摘要:1.题目要求Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:... 阅读全文
posted @ 2015-03-31 22:58 LC凑热闹 阅读(183) 评论(0) 推荐(0)
Leetcode 3 Longest Substring Without Repeating Characters
摘要:1.题目要求Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lett... 阅读全文
posted @ 2015-03-29 17:11 LC凑热闹 阅读(174) 评论(0) 推荐(0)
Leetcode 4 Median of Two Sorted Arrays
摘要:1.题目要求There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity shou... 阅读全文
posted @ 2015-03-27 15:08 LC凑热闹 阅读(170) 评论(0) 推荐(0)
Leetcode 1 Two Sum
摘要:1.题目要求Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the ... 阅读全文
posted @ 2015-03-26 16:43 LC凑热闹 阅读(188) 评论(0) 推荐(0)
内联函数与宏
摘要:因为函数的调用必须要将程序执行的顺序转移到函数所存放在内存中的某个地址,将函数的程序内容执行完后,再返回到转去执行该函数前的地方。这种转移操作要求在转去执行前要保存现场并记忆执行的地址,转回后要恢复现场,并按原来保存地址继续执行。因此,函数调用要有一定的时间和空间方面的开销,虽然函数调用开销是很小的... 阅读全文
posted @ 2015-03-23 14:50 LC凑热闹 阅读(424) 评论(0) 推荐(0)
面试算法题:16个数,最多用20次比较,找出第二大的数?
摘要:这道题最笨的方法就是先从16个数中选出最大的数,然后再从剩下的15个数中选出最大数就可得到答案,因此,需要15+14=29次比较。既然这道题要求在20次比较之内就能找出第二大的数,那我们就想能简单的方法。假设16个数中最大的是A,第二大的是B。首先将16个数两两进行比较,较大者胜出,然后再在胜出者中... 阅读全文
posted @ 2015-03-20 22:07 LC凑热闹 阅读(1014) 评论(0) 推荐(0)
windows中通过bat批处理打开exe文件
摘要:1、想要运行的程序:C:\Program Files\Windows Media Player\wmplayer.exeC:\Program Files\Haihaisoft Universal Player\hmplayer.exe2、在桌面上,“新建文本文档.txt”,方法是:在桌面上右键,新建... 阅读全文
posted @ 2015-03-12 20:34 LC凑热闹 阅读(14764) 评论(0) 推荐(0)
动态规划求两个序列的最长公共子序列
摘要:摘录:http://blog.chinaunix.net/uid-26548237-id-3374211.html1、序列str1和序列str2 ·长度分别为m和n; ·创建1个二维数组L[m.n]; ·初始化L数组内容为0 ·m和n分别从0开始,m++,n++循环: - 如果str1[m]... 阅读全文
posted @ 2015-03-08 10:54 LC凑热闹 阅读(5323) 评论(1) 推荐(0)
HDU 5182
摘要:#include #include #include using namespace std;/************************************************************************//* HDU 5182题 http://acm.hdu.e... 阅读全文
posted @ 2015-03-07 21:54 LC凑热闹 阅读(230) 评论(0) 推荐(0)
利用动态规划求矩阵中和最大的子矩阵
摘要:题目一:给定一个整型数组,数组中有正有负,求最大连续子序列的和。解法:利用动态规划的思想。设f(n)表示以a[n]为子序列最后一个元素的最大和,则可以有下面的规则:(1)当f(n-1)0时,f(n)=f(n-1)+a[n]。用一个nGreatestNum来记录最大值,每次与f(n)进行比较,不断更新... 阅读全文
posted @ 2015-03-04 20:37 LC凑热闹 阅读(4494) 评论(0) 推荐(0)
 

公告


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