题目
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "a...
分类:
其他好文 时间:
2014-06-20 13:44:18
阅读次数:
234
// CommonInject.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
#include
#include
#include
using namespace std;
#include
#pragma comment(li...
分类:
编程语言 时间:
2014-06-20 13:09:49
阅读次数:
306
Burn the Linked Camp
It is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the Wu Empire. The defeat was due to Liu B...
分类:
其他好文 时间:
2014-06-20 12:57:12
阅读次数:
240
题目链接: here。题目描述: Sort a linked list using insertion
sort. 题目要求使用插入排序的方法来实现单链表的排序。插入排序是一种简单的排序,算法描述参考维基百科,或者《算法导论》。 下面是我实现的代码: 1 /**
2 Author:...
分类:
其他好文 时间:
2014-06-12 00:39:40
阅读次数:
284
Merge two sorted linked lists and return it as
a new list. The new list should be made by splicing together the nodes of the
first two lists./** * Def...
分类:
其他好文 时间:
2014-06-11 22:56:31
阅读次数:
257
原题地址:https://oj.leetcode.com/problems/merge-k-sorted-lists/题意:Mergeksorted
linked lists and return it as one sorted list. Analyze and describe its com...
分类:
编程语言 时间:
2014-06-11 21:57:07
阅读次数:
399
dojo函数1.检索 dojo.byid2.创建 dojo.creat()
参数:节点名,节点的属性,可选的父节点或者兄弟节点,可选的父节点和兄弟节点的相对位置。demo:var
list=dojo.byId("list")dojo.create("li",{innerHTML:"seven";},...
分类:
其他好文 时间:
2014-06-11 10:16:31
阅读次数:
236
【题目】
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
【题意】
将一个有序链表转换成平衡二叉树
【思路】
思路跟Convert Sorted Array to Binary Search Tree完全一样...
分类:
其他好文 时间:
2014-06-07 16:20:05
阅读次数:
287
最长回文字串,相信做过Palindrome Partitioning II 这个题的同学应该可以很快做出来。没错,这个题还可以使用动态规划方法得到一个时间复杂度为O(n^2)的解法,当然如果你想要更好的时间复杂度的算法也是有的。好的,我们先来看看时间复杂度为O(n^2)的算法。
代码实现--动态规划O(n^2)
相信如果你在网上看过了别人的算法,你会发现我的算法是最简洁的。哈哈,这个题需要注意的是如果你用惯了vector的话,你这里肯定会得到超时的提示...
...代码二--复杂度为O(n)的算法...
分类:
其他好文 时间:
2014-06-07 12:08:43
阅读次数:
224
atitit。 hb Hibernate sql 查询使用
#----------返回list法..这个推荐使用。
q.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
List li=q.list();
作者 老哇的爪子 Attilax 艾龙, EMAIL:14665...
分类:
数据库 时间:
2014-06-07 12:07:58
阅读次数:
246