Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t...
分类:
其他好文 时间:
2014-11-25 10:46:27
阅读次数:
196
【题目】
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
【解析】
分治:用快慢指针找到链表的中点,作为树的root,然后二分——中点之前的链表和中点之后的链表分别再构造二叉平衡树。
/**
* Defin...
分类:
其他好文 时间:
2014-11-24 22:39:00
阅读次数:
218
--getdate 当前系统日期、时间select getdate() --2014-11-24 13:22:40.407 --convert() 函数可以用不同的格式显示日期/时间数据select convert(varchar(100),getdate(),23) --2014-11-24...
分类:
数据库 时间:
2014-11-24 15:17:32
阅读次数:
485
error C2440: 'static_cast' : cannot convert from ...to... 此种错误是由VC6的程序用VS打开而造成的(以前在VC6下完全正常运行的消息映射在其它版本下编译不通过),只要将函数的返回类型或参数类型改为对应的即可。unabletostartpr....
分类:
其他好文 时间:
2014-11-24 15:00:04
阅读次数:
303
1.修改CREATE TRIGGER DJSLSQ_update----- ON DJSLSQ----- AFTER updateAS BEGINSET NOCOUNT ON; Insert INTO DJSLSQ_update_tri-----select *,'修改前数据:'+CONVERT(v...
分类:
其他好文 时间:
2014-11-24 11:46:40
阅读次数:
111
原题地址:https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/题目内容:Given a singly linked list where elements are sorted in ascending...
分类:
其他好文 时间:
2014-11-23 21:34:38
阅读次数:
141
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.SOLUTION 1:思路:从后往前遍历罗马数字,如果某...
分类:
其他好文 时间:
2014-11-23 21:33:17
阅读次数:
223
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.SOLUTION 1:思路:从后往前遍历罗马数字,如果某...
分类:
其他好文 时间:
2014-11-23 20:12:01
阅读次数:
145
Integer to Roman Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.SOLUTION 1: 1 package Algor...
分类:
其他好文 时间:
2014-11-23 17:26:35
阅读次数:
173
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.C++代码实现:#include#include#include#includeu...
分类:
其他好文 时间:
2014-11-23 15:53:30
阅读次数:
256