以下内容适用于oracle 10.2.0.5及其以上版本 一个查询很慢,原始SQL如下: 表都不大,执行计划如下: 这个执行计划,看起来无比正常,应该要left join的都有。 但问题的关键在于10 步骤-- MERGE JOIN CARTESIAN。笛卡尔乘积的排序合并连接,这个需要耗费很长时间 ...
分类:
数据库 时间:
2017-07-07 20:02:06
阅读次数:
292
题目 URL:https://leetcode.com/problems/longest-palindromic-substring 解法 一、循环搜索 对于每一个字符,往后搜索,遇到相同字符,开始判断是否回文串,若是回文串则与当前最长回文串的长度比较,若更长,则更新最长回文串。 显然是三层循环:第 ...
分类:
其他好文 时间:
2017-07-05 23:04:00
阅读次数:
253
这两题有一个 trick 和 Minimum Window Substring 非常像,就是维护一个 "curCount" 代表目前 (i,j) 之间 match 上的数量,而通过 hash[] 的正负充当计数器的作用 ...
分类:
其他好文 时间:
2017-07-05 22:56:46
阅读次数:
170
https://leetcode.com/problems/longest-word-in-dictionary-through-deleting/#/solutions ...
分类:
其他好文 时间:
2017-07-05 15:22:01
阅读次数:
119
链接 分析:遍历一下,求个gcd即可,最后按照ans排序并去重 1 /* 2 PROB:frac1 3 ID:wanghan 4 LANG:C++ 5 */ 6 #include "iostream" 7 #include "cstdio" 8 #include "cstring" 9 #inclu ...
分类:
其他好文 时间:
2017-07-05 01:21:21
阅读次数:
239
代码编译执行平台:VS2012+Win32+Debug 1.C++中替换全部指定的子串 下面代码,作为平时代码库的储备,仅供各位猿友參考: //替换指定的子串 //src:原字符串 target:待被替换的子串 subs:替换的子串 string replaceALL(const char* src ...
分类:
编程语言 时间:
2017-07-03 19:56:27
阅读次数:
278
这个也是简单题目。可是关键在于题意的理解。 题目原文就一句话:Write a function to find the longest common prefix string amongst an array of strings. 题意是给一个字符串数组,找出这个字符串数组中全部字符串的最长公共 ...
分类:
其他好文 时间:
2017-07-02 16:18:04
阅读次数:
248
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l ...
分类:
其他好文 时间:
2017-07-02 10:24:30
阅读次数:
111
LeetCode 5_Longest Palindromic Substring 题目描写叙述: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length ...
分类:
其他好文 时间:
2017-07-01 20:12:24
阅读次数:
162
题目1042:Coincidence 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:4045 解决:2208 题目描述: Find a longest common subsequence of two strings. 输入: First and second line of each ...
分类:
其他好文 时间:
2017-06-30 19:46:03
阅读次数:
185