1. 问题引入主要是为了查询在一个表中出现,而不在另一个表中出现的数据,具体来说:如下图所示,
有A、B两个表,其中B表的Aid字段参照A表的主键id,为了查询在A表中出现,却没有被B表引用的数据;限定条件:A和B中is_deleted字段为‘n’
并且B中type为‘common’。 2. 解决....
分类:
数据库 时间:
2014-05-16 08:38:24
阅读次数:
334
第一步:加载验证插件css和js:官网:http://validform.rjboy.cn//valid.css">valid.css的详细代码如下:.Validform_checktip{ margin-left:8px; line-height:20px; height:20px; overfl...
分类:
其他好文 时间:
2014-05-16 07:08:02
阅读次数:
294
1. SELECT语句可以使用正则表达式做列选择,下面的语句查询除了ds和h
之外的所有列:SELECT `(ds|hr)?+.+` FROM sales2. LEFT SEMI JOIN的限制是,
JOIN子句中右边的表只能在ON子句中设置过滤条件,在WHERE子句、SELECT子句或其他地方过滤...
分类:
其他好文 时间:
2014-05-16 06:22:00
阅读次数:
283
Problem Description:
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys l...
分类:
其他好文 时间:
2014-05-15 11:22:21
阅读次数:
317
#include
#include
using namespace std;
//下面一个移位是一样的,>>相当于除去2,主要是要用right-left,否则对于大数据来说会产生溢出问题。切记
int binarySearch(int arr[],int len,int number)
{
int left=0;
int right=len-1;
in...
分类:
其他好文 时间:
2014-05-15 07:14:38
阅读次数:
272
Pat1043代码
题目描述:
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:
The left subtree of a node contains only nodes with keys less than t...
分类:
其他好文 时间:
2014-05-15 05:09:59
阅读次数:
351
1、
??
Populating Next Right Pointers in Each Node
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate...
分类:
其他好文 时间:
2014-05-15 04:57:36
阅读次数:
221
题目
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.The first integer...
分类:
其他好文 时间:
2014-05-15 03:41:11
阅读次数:
257
题意:给一个整数序列(可能有负数),求最短的连续序列使得序列之和大于等于整数x;
解法:第一种是On的复杂度:
我们要的是sum[j]-sum[i]>=x,如果有两个决策j = sum[j'],那么j就是没用的。即维护一个sum[j]递增序列。然后每次可以二分查找,但是这里有个特点就是要得到最近的,可以同时维护一个left指针,left指针用于跟进更...
分类:
其他好文 时间:
2014-05-15 03:20:26
阅读次数:
303
.left .left_down
li.a.left-down-pic{display:block;width:50px;height:50px;background:url(images/app_icons_50_6.jpg)
-400px 0px no-repeat;//关键是这句话}
分类:
Web程序 时间:
2014-05-14 11:36:25
阅读次数:
419