LeetCode Integer to Roman
摘要:链接: https://oj.leetcode.com/problems/integer-to-roman/题目上已经说最大出现的整型值为3999,这样就很简单了。class Solution{ public: string intToRoman(int num) { string ans;...
阅读全文
Container With Most Water
摘要:链接: https://oj.leetcode.com/problems/container-with-most-water/尺取法,从两端向中间缩进class Solution{ public: int maxArea(vector &height) //尺取法 { int L=0; ...
阅读全文
LeetCode ZigZag Conversion
摘要:链接: https://oj.leetcode.com/problems/zigzag-conversion/题意为:把字符串按如下规则排列AGMBFHLNCEIK:DJ:输出按行顺序:AGMBFHLNCEIKDJ剩下的就是通过字符的坐标计算在字符串中的位置了class Solution{ publ...
阅读全文
LeetCode 5 最长回文子串 Manacher线性算法
摘要:题目链接:https://oj.leetcode.com/problems/longest-palindromic-substring/回文串即正向反向序列都一样的连续序列 如abba,abcba...为了统一回文串的偶数情况和奇数情况,可以向串中插入不相关的字符,例如abba->#a#b#b#a#...
阅读全文
LeetCode Longest Substring Without Repeating Characters
摘要:链接: https://oj.leetcode.com/problems/longest-substring-without-repeating-characters/字符串中最长连续不重复子序列,用JAVA中的哈希表比较方便public class Solution { public int...
阅读全文
Add Two Numbers
摘要:链接:https://oj.leetcode.com/problems/add-two-numbers/链表的大数加法/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode ...
阅读全文
vim 常用插件的安装
摘要:安装如下几个插件taglist 以分割窗口显示代码结构预览 下载地址:http://www.vim.org/scripts/script.php?script_id=273stl STL语法高亮 下载地址:http://www.vim.org/scripts/script.php?script_id...
阅读全文
LeetCode Swap Nodes in Pairs
摘要:链接:https://oj.leetcode.com/problems/swap-nodes-in-pairs/交换链表相邻的节点的位置/** * Definition for singly-linked list. * struct ListNode { * int val; * ...
阅读全文
LeetCode Majority Element
摘要:链接: https://oj.leetcode.com/problems/majority-element/LeetCode给的这道题的解答真的不错:Runtime: O(n2) — Brute force solution: Check each element if it is the majo...
阅读全文
10 Open Source Security Tools from Google, Facebook, Netflix and Cisco
摘要:原文地址:http://www.linux.com/news/software/applications/797378-10-open-source-security-software-tools源自Google,Facebook,Netflix和Cisco的十个开源安全工具Choicehaslon...
阅读全文
JAVA基础课程设计 简易坦克大战
摘要:工程的结构如下:类名父类/接口功能Palyvoid音频播放Wel_PanelJPanel欢迎界面keylistenerKeyAdapter键盘监听PC_tankRunnable电脑坦克的控制T_BulletRunnable子弹的控制Testvoid主函数入口各类的组装A_tankJPanel左方向坦...
阅读全文
JAVA基础课程设计 简易扫雷
摘要:以下每行代码,文字均为原创,转载请注明出处.程序一共分为7个文件,每个文件为一个类文件名功能描述Test.java测试类,包含main()函数Mine.java设计主界面,Calmine.java随机雷的位置.计算雷区点击后应该显示的数字My_button.java继承自button类,添加按钮的坐...
阅读全文
LeetCode Evaluate Reverse Polish Notation
摘要:链接: https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/后缀表达式求值class Solution{ public: int evalRPN(vector &tokens) { stack stk; in...
阅读全文