LeetCode[Algorithms] Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). package com.coderli.leet...
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). package com.coderli.leet...
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3. F...
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a l...
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 two numbers such that they add up to the target, whe...
索引类型 - B-tree,Hash, GiST, SP-GiST, GIN。默认是B-tree B-tree - 适合处理等值和范围查询。支持的操作符: <, <=, =, >=, >, in, between, is null, is not null。 like和~ 操作支持从前匹配,如:foo% 、^foo。 B-tree也可用于获取排序后的数据,虽然效率...
numeric - 可以存储非常大数据,并且可存储高精度数据。numeric(precision, scale)例如:23.5141 precision=6, scale=4 可存储NaN值,代表not-a-number。在Postgresql中NaN和NaN数值是相等的,并且大于其他任何值。 serial - 用于自增字段。相当于: CREATE SEQUENCE tablename_...
记录阅读中在意的点 ###字段约束: check、notnull、unique、primary key、reference 外键必须关联primary key 或者unique字段。这两种字段都带索引。 exclude约束??? ###系统列 oid、tableoid、xmin、cmin、xmax、cmax、ctid。都是32位的字段。 ###schema(架构) 类似操作系统中的...
最近博客(www.coderli.com) 被几个流氓IP爬的厉害,流量超标。促使我萌生了将博客迁移到github.io的想法。整个迁移过程OneCoder之前也是不熟悉的,不过思路是清晰的。 1、 如何在github.io/GitCafe上建立页面。 github.io就是原github的page功能。建立的方式很简单。首先你需要有一个Github帐号,然后在你的github帐号下建...
在乱学装饰模式的时候给出了一篇参考文章,是对比装饰模式和代理模式的。自然,这就是OneCoder现在需要理解的问题。 先复习一下设计模式6大原则: 设计模式的六大原则(引自:http://zz563143188.iteye.com/blog/1847029) 1. 开闭原则(Open Close Principle) 开闭原则就是说对扩展开放,对修改关闭。在程序需要进行拓展的时候,不能去...
码农写码3,4年,设计模式用了不少,但又有一种在乱用的感觉。要么叫不出名字,要么感觉摸不到其精髓。其实所谓Java中的23种设计模式,OneCoder之前也乱乱的看过几遍,但是至今感觉也没有什么深刻的领悟。 之前,看到每种设计模式总会有一种“理所应当”的感觉,心里就好像在说本来就应该这么做啊,我也是这么写的啊。但是后头回头品味,总感觉缺少更认真的思考,应用的很不自如。得进步。 这次整理,...