Valid Palindrome II Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Example 2 ...
分类:
其他好文 时间:
2018-05-25 11:13:51
阅读次数:
188
判定链表是否为回文 方法一:借助一个栈,将链表节点值全部压入栈中,再弹出,依次比较。本质是把链表节点值逆置,然后与原链表节点值比较。全部相等则为回文。 方法二:先计算链表长度,把前半部分链表逆置,然后比较新链和剩下那段链节点值是否依次相等。 ...
分类:
其他好文 时间:
2018-05-24 16:36:51
阅读次数:
138
https://www.cnblogs.com/xing901022/p/6195422.html "介绍知识点" [大数据技术原理与应用视频 ](http://www.icourse163.org/learn/XMU 1002335004?tid=1002787005 /learn/content ...
分类:
其他好文 时间:
2018-05-22 12:41:50
阅读次数:
175
前后指针向中间靠拢,扫描到数字或字母就比较,不等则返回false。等则继续扫描,直至前指针越过后指针,输出true。 ...
分类:
其他好文 时间:
2018-05-21 12:38:13
阅读次数:
140
There are 1000 buckets, one and only one of them contains poison, the rest are filled with water. They all look the same. If a pig drinks that poison ...
分类:
其他好文 时间:
2018-05-21 01:05:33
阅读次数:
227
In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the rema ...
分类:
其他好文 时间:
2018-05-19 20:41:12
阅读次数:
167
import urllib.request #导入模块 url="http://blog.csdn.net/weiwei_pig/article/details/52123738" #路径file=("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64) ...
分类:
其他好文 时间:
2018-05-19 19:09:38
阅读次数:
192
dp or memo recursion 1. dp formulation 2. ispalindrome based on the nature structure ...
分类:
其他好文 时间:
2018-05-19 11:08:20
阅读次数:
204
可以to_string转换成string做。 不转换成string的话,计算出反转后一半的数即可。 ...
分类:
其他好文 时间:
2018-05-17 13:46:03
阅读次数:
94
问题描述: Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: 我的思路: 现将链表里的值存储到一个vector中,然后在对vector从两边向中心对比,空间复杂度为O(n), 时间复杂 ...
分类:
其他好文 时间:
2018-05-17 11:50:26
阅读次数:
160