You are given a list of cities. Each direct connection between two cities has its transportation cost (an integer bigger than 0). The goal is to find the paths of minimum cost between pairs of cities....
分类:
Web程序 时间:
2014-10-05 01:29:57
阅读次数:
289
Problem Description
Given a 3-dimension ellipsoid(椭球面)
your task is to find the minimal distance between the original point (0,0,0) and points on the ellipsoid. The distance between two points...
分类:
其他好文 时间:
2014-10-04 18:05:26
阅读次数:
242
Replacing an element of a list with another:% lreplace {a b c d e} 1 1 fooa foo c d eReplacing two elements of a list with three:% lreplace {a b c d e...
分类:
其他好文 时间:
2014-10-04 13:08:16
阅读次数:
162
#include?<stdio.h>
#include?<stdlib.h>
int?main(void)?{
//?Method?One
printf("Line-1");
printf("Line-1\n");
//?Method?Two
printf("Line-2Line-2\n");
//?Method?Three
printf("Li...
分类:
其他好文 时间:
2014-10-04 02:52:26
阅读次数:
536
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* Lis...
分类:
其他好文 时间:
2014-10-03 17:21:45
阅读次数:
167
Problem Description
In this problem, you are given a string s and q queries.
For each query, you should answer that when all distinct substrings of string s were sorted lexicographically, which ...
分类:
其他好文 时间:
2014-10-03 16:56:54
阅读次数:
249
There are fifty-two cards in a deck, each of which belongs to one of four suits and one of thirteen ranks. The suits are Spades, Hearts, Diamonds, and...
分类:
其他好文 时间:
2014-10-03 16:07:24
阅读次数:
146
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* ...
分类:
其他好文 时间:
2014-10-03 15:40:04
阅读次数:
186
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
分类:
其他好文 时间:
2014-10-03 13:39:24
阅读次数:
205
Problem Description
The light travels in a straight line and always goes in the minimal path between two points, are the basic laws of optics.
Now, our problem is that, if a branch of light goes...
分类:
其他好文 时间:
2014-10-03 04:12:15
阅读次数:
162