由买买提看人间百态

topics

全部话题 - 话题: empti
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
k****u
发帖数: 1686
1
来自主题: Fengshui版 - 六爻入门——基础篇
声明
1.此资料中内容是六爻占卜术的最基础的知识;
2.我能整理此资料,并不代表我的技术高,这只是个人机缘的关系。
3.资料中的内容、观点与论坛无关。
整理此资料的目的
1.为了让不懂六爻占卜的朋友对其有所了解;
2.给想学习六爻占卜的易友一个入门的基础资料;
3.为了大家相互交流与个人卦技的提高。
资料内容简述如下:
第一部分 为占卜术基础内容,此中内容为所有占卜方法都使用的基础知识;
第二部分 为六爻占卜术的基础内容,其为六爻占卜方法专用的基础知识。
第三部分 为六爻占卜中一些常见的基础问题的个人浅见。
学习方法:
学习占卜不是一天两天的事儿,我们以六爻为例,你学会了起卦的方法,这并不代
表你就会解卦了,有的人学习了十几年,几十年也没有看到门,可是有的人学了几个月
甚至几天就可以分析简单的卦了,有的人不服气,有的人不明白,其实这其中除了个人
的机缘与命运不同以外,还有个学习方法的问题。(以下内容为一家之言,仅供参考)
1、学习六爻占卜术,首先要有一个稳定的心态,因为时下派系繁多,又都有各自
的一套技法,而我们这些新人也没有办法去分析那一家对那一家错,所以我建议... 阅读全帖
J*******g
发帖数: 8775
2
来自主题: TrustInJesus版 - 是谁移动了耶稣墓穴的巨石?
你的疑问还是建立在你的猜想之上得,耶稣如何复活,或是耶稣复活后是什么状态,这
个石头,白布如何处理等等,都是神的意志,或者也许不是。我们没必要去猜想这些细
节。
如果你真的感兴趣可以在NETbible上看到各种解释。
https://lumina.bible.org/bible/Matthew+28
点右边Constable's Notes。
也可以参考其它福音书的说明。
B. The King’s resurrection ch. 28
The resurrection is central to Christian theology (cf. 1 Cor. 15:12-19).
However the Gospel evangelists did not deal with the theological
implications of the resurrection but simply recorded the facts. The Apostle
Paul wrote much to help us appreciate the significance of this g... 阅读全帖
j*******7
发帖数: 6300
3
来自主题: TrustInJesus版 - About “God Created Everything From Nothing”
What We Mean When We Say, “God Created Everything From Nothing”
Even as an atheist, I understood the challenge offered by the “Standard
Cosmological Model” (the Big Bang Theory) when examined from my
naturalistic worldview. This model infers a “cosmological singularity” in
which all space, time and matter came into existence at a point in the
distant past. In others words, “everything” came from “nothing”. I knew
this presented a problem for me as a naturalist; if the universe had a
beginning, t... 阅读全帖
N*******n
发帖数: 348
4
来自主题: Wisdom版 - One more question: Are there only ONE?
You are welcome. I am not sure I can answer your questions, but I will try.
From your questions, I just realized that our discussion is a little too
advanced for you (don't get offended,:)), so i am going to back down to some
basics. I don't come to this board often and I don't know everyone's
background in Buddhism study. So, first, I want to ask you: do you do
meditation? A lot of things I am talking about above are based on meditation
experience. Without meditation, it is difficult to progres... 阅读全帖
s*******y
发帖数: 558
5
Makefile编译中间错误信息是:
./main.C:5: undefined reference to 'Empty::Empty[in-charge](int const&)'
collect2: ld returned 1 exit status
make: *** [main] Error 1
Empty.H文件如下:
#ifndef EMPTY_H_
#define EMPTY_H_
template
class Empty{
public:
Empty(const Object& obj);
private:
Object objectValue;
};
#endif
r**s
发帖数: 129
6
来自主题: Military版 - 台妹「令人噁心但肉體很迷人」
Let's be fair here. I have a gorgeous, adorable Taiwanese girlfriend that I
am willing to spend the rest of my life with. Not because she is Hello Kitty
, submissive, shallow, brain dead and a good fuck. Because she calls herself
a freak (a surprisingly foxy one) , standing out from that essentially
numbed crowd that I call most of Taiwan (excluding the "hen qi guay" lot),
in ways that make most other girls look like total idiots.
就這方面而言,我想講幾句實在話:我有一個台灣女朋友,看起來漂亮又大氣。我很願
意跟她共度下半輩子。我之所以如此,不是因為她對丈夫言... 阅读全帖
o*********e
发帖数: 3093
7
2015-09-19 10:53 〔即时新闻/综合报导〕欧洲难民问题难解,有成千上万叙利
亚人不断前往欧洲各国寻求庇护,但近期有外媒想出了能一举解决这场难民危机的好方
法,也就是开放中国「鬼城」。
《路透社》报导,欧洲近期涌入数十万人,但同一时间,中国也拥有超过上百万
的新建无人公寓,以及几乎看不到人影的新设城市,该名记者认為,那如果这些房子都
提供给难民,问题不就迎刃而解吗?
报导指出,目前中国有高达2000万至4500万户的房子无人居住,有将近6亿平方公
尺的楼地板面积上找不到一个人。但这些「鬼屋」并不是真的没有「主人」,大部分的
房子在盖好之前,就已经被人买下了,原因当然是预期那个地方的房价会再上涨。
但该名记者也表示,要把「鬼城」提供给这些难民,实务上不太可能达成,因為
除了让大批难民跨越地球一大半,本身就是政治大麻烦外,这些难民需要的也不只是一
个能住的地方而已,这不只是个简单的供应与需求问题。
Nearly 150,000 Syrian refugees have already claimed asylum in Europe and
tens of thousands ... 阅读全帖
l****z
发帖数: 29846
8
By William M. Welch, USA TODAY
RIVERSIDE, Calif. — In a sign of just how deep economic and budget problems
have grown in the nation's largest state, a gleaming new high school built
at a cost of $105 million will sit unused for at least a year because
education officials say they don't have money to operate it.
Newly constructed Hillcrest High School in Riverside, Calif., won't be
easing the crowding at La Sierra High as the new school sits empty for the
coming school year.
Newly constru... 阅读全帖
l****z
发帖数: 29846
9
August 14, 2012
For The New York Times, reporter Jackie Calmes must have found Chris
Matthews’ leg tingle as she penned a story dreamily reminiscing about Obama
’s “jaw-dropping crowds” he used to garner at campaign stops back in 2007
-08.
Calmes also wondered why Obama isn’t getting those great crowds anymore?
Oh, she was filled with all sorts of reasons to explain away Obama’s
smaller crowd sizes, mind you. The most amusing one is her regurgitation of
the campaign’s claims that Obama wants sma... 阅读全帖
y****t
发帖数: 10233
10
empty suit gives an empty speech, leaves empty chair with empty promises.
k*****u
发帖数: 14053
11
☆─────────────────────────────────────☆
BMWfan (TheUltimateDrivingMachine) 于 (Wed May 11 18:01:29 2011, 美东) 提到:
4月3号买的车,刚买了1周,后面的bumper就被不知道什么人给挂了很小一块,心中略有不爽;在小
平同志两手都要抓两手都要硬的指导思想下,一次,搬东西的时候,不小心把里面门把手上的皮给挂
破了,这下好了,平衡了,不过呢。。。以后还是小心点好~
修吧,唉~开到dealer,给他们一看,直接说给修/换,不用钱,唯一的就是能给他们在各大网站上
写些好评~那不就是写段话,然后copy/paste吗?没问题啊~哈哈
可惜当天是周六,bodyshop没开门,他们建议我过段时间再来,我一想,最近挺倒霉的,万一又挂
了,也能一起修了,就欣然走了~
转眼快1个月了,上周日开到dealer那,想着是周日丢那,周三去取~由于没做准备工作,人家周日
的service department是关门的。。。悲剧了。。。经理来了,那态度好得不行,直接说,找工
作人员周一的时候开到我家门口... 阅读全帖
g********d
发帖数: 19244
12
来自主题: Automobile版 - [合集] 下代miata蛮帅的啊
☆─────────────────────────────────────☆
icefox (icefox) 于 (Sun Feb 24 12:19:52 2013, 美东) 提到:
alfa romeo也会用miata底盘复活AR spider,但发动机和外形都完全不同
新miata外形宛如新nsx和z4的合体
★ 发自iPhone App: ChineseWeb 7.8
☆─────────────────────────────────────☆
Lexian (蒙古大夫) 于 (Sun Feb 24 12:34:43 2013, 美东) 提到:
看过几个不同的版本, 不知道哪个是真的。
☆─────────────────────────────────────☆
iolosoeisi (Quentin) 于 (Sun Feb 24 13:52:47 2013, 美东) 提到:
漂亮,出来买一个,那时候正好是中年危机的时候。
话说我至今买过的车都是马自达,忽悠身边朋友买了3辆马自达,也算死忠了,暑假买
大切情非得已,马自达没这个类型的。

☆──... 阅读全帖
g********d
发帖数: 19244
13
来自主题: Automobile版 - [合集] 听说这个车不WS
☆─────────────────────────────────────☆
covenante (dapp) 于 (Wed Feb 27 22:31:07 2013, 美东) 提到:
91 Landcruiser,入手。
初步整饬完毕,修理的地方多如牛毛:
已解决的问题:
向右转向不能完全转到最大角度,向左转没问题。
熄火后钥匙卡在acc,转不到lock,停半个小时后可以转到lock拔出。
故障灯亮:氧传感器,TPS sensor。
怠速不正常,热车后转速在1100左右。
仪表盘内左右转向指示灯不亮,挡位指示灯D以下不亮
两个前轮胎不正常磨损,左右都是内侧磨得多。
左前方轴承旷量,左右转向关节渗油。
方向机漏油,助力泵安装不到位。
发动机下方漏机油,已更换oil pan,解决部分漏油问题,rear main seal依然漏油,这
个暂时无解。
空调不工作,系统多处渗漏。
刹车偏软,左前卡钳某个活塞卡死,rotor需要换,后鼓刹需要调节。
内饰件多处缺失,驾驶员座椅破损。
洗玻璃水罐破损,泵不工作,不喷水。
按ih8mud论坛上的说法,基本入手一个二手的FJ80以后,就要额... 阅读全帖
g********d
发帖数: 19244
14
来自主题: Automobile版 - [合集] My DIYs
☆─────────────────────────────────────☆
swat518 (GT) 于 (Mon Apr 8 11:50:45 2013, 美东) 提到:
1st of all, cannot type Chinese…
I owned this Nissan 350Z for a year, it is mainly for autox and will be
built for track use as well. Not a daily car because installed supercharge
and tuned for performance, so the MPG is mess, car is loud and need extra
time to warm up.
I’ve been self-studying engine, suspension tuning, tires and driving skill
for less than 2 years, so still too fresh. I did 90% of mai... 阅读全帖
g********d
发帖数: 19244
15
☆─────────────────────────────────────☆
kiz (泥偶) 于 (Sun Jun 23 17:48:29 2013, 美东) 提到:
家里一台2010 Honda Odyssey, 一个2012 Infiniti QX56.
现在需要买一个上班Commute的车,每天来回30英里,不堵车。因为benz和BMW美国太便
宜了,不买都不好意思。国内买个S600要220w RMB,买个Q7要120w RMB。买个Enclave
要70w RMB。买个华晨535要40W。买个大众途锐,75w,买个Camry要30w。这里买个E350
/535,只要40W-RMB不到,S350也只要50WRMB。
初步考虑奔驰E350 or R350。 有兄弟推荐 BMW 550GT。 俺主要是要省油和便宜。什么
维修什么的不需要考虑。一般来说我都买platinum extended warranty. 推荐A8,S350,
7xx的就算了,第一没钱,第二还是没钱。第三还是没钱。AVG. MPG一定要超过20.预算
目前是5.5W. 中途还考虑过Mini Manu... 阅读全帖
g********d
发帖数: 19244
16
☆─────────────────────────────────────☆
JeepFans (JeepFans) 于 (Thu Jul 25 23:42:02 2013, 美东) 提到:
DIY更换2004甲壳虫变速箱valve body
09G变速箱阀体使用一定程度后会出现换档延迟,闯档等问题。这是这款变速箱的通病
。2004年甲壳虫就是用这款变速箱。。。
☆─────────────────────────────────────☆
koust (我在农村) 于 (Thu Jul 25 23:43:30 2013, 美东) 提到:
sf !!!!
广告位招租~
☆─────────────────────────────────────☆
JeepFans (JeepFans) 于 (Thu Jul 25 23:43:38 2013, 美东) 提到:
将车如此架起,4个jack
☆─────────────────────────────────────☆
scorpin (scorpin) 于 (Thu Jul 25 23:44:20 ... 阅读全帖
c**********t
发帖数: 98
17
来自主题: JobHunting版 - Two-Sigma面经
Here is my try for the second question
link_1=link_2=link_3=empty
DO current=read next byte
if (current != link_1.back())
link_1=link_1 + link_2 + link_3 //Appending
link_2=empty
link_3=empty
end
if (current == link_1.back())
link_1.pop_back()
link_2.push_front(current)
link_3.push_back(current)
else
link_1=link_1+current
end
While (link!=empty)
j*******a
发帖数: 61
18
will this work?
void f(NODE* r)
{
// define stack1, stack2;
stack1.push(r);
while(!stack1.empty && !stack2.empty)
{
while(!stack1.empty)
{
NODE* n=stack1.pop();
if(n->r) stack2.push(n->r);
if(n->l) stack2.push(n->l);
}
while(!stack2.empty)
{
NODE* n=stack2.pop();
if(n->l) stack1.push(n->l);
if(n->r) stack1.push(n->r);
}
}
}
a********d
发帖数: 195
19
来自主题: JobHunting版 - Amazon最近电面面经
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace testSplitStringToNArray
{
class Program
{
static void Main(string[] args)
{
const string originalString = "
Thisjdfkldjsflkdswieruewirfjkmkdfsdfdsfdsfdsfjkjowieorewjtoirekfdjngmvkmvlkn
ldsfjkljlkjlkjoijeroijelqrefdsakfjlkswxy";
//int arraySize =Convert.ToInt32(args[0]);
int arraySize = 5;//you name it
for... 阅读全帖
a********d
发帖数: 195
20
来自主题: JobHunting版 - Amazon最近电面面经
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace testSplitStringToNArray
{
class Program
{
static void Main(string[] args)
{
const string originalString = "
Thisjdfkldjsflkdswieruewirfjkmkdfsdfdsfdsfdsfjkjowieorewjtoirekfdjngmvkmvlkn
ldsfjkljlkjlkjoijeroijelqrefdsakfjlkswxy";
//int arraySize =Convert.ToInt32(args[0]);
int arraySize = 5;//you name it
for... 阅读全帖
s*******f
发帖数: 1114
21
来自主题: JobHunting版 - amazon onsite 面经
// 给一个字符串,例如"30*(5+10)",输出计算结果。
double GetValue(double b1, double b2, char op){
switch(op){
case '+':
return b1 + b2;
case '-':
return b1 - b2;
case '*':
return b1 * b2;
case '/':
if (b2 < 0.00000001)
return 0;
return b1 / b2;
default:
return 0;
}
}
bool OpPriority(char op1, char op2){
if (op1 == '*' || op1 == '/'){
return true;
}else if ((op1 ==... 阅读全帖
w*******s
发帖数: 96
22
有没有对Careercup的C/C++的Solution感兴趣的同学啊?准备做几个样题和我的实现放
上来大家讨论讨论:先来一个拍拍
////////////////////////////////////////////////////////////////////////////
////////
// Problem 3.6: (第4版)
//
// Analysis and points:
// 1. You are asking to implement one sort algorithm with input
parameter is a stack.
// 2. If we allow to use extra space, we can use another stack to
help. Each time, we
// insert the top element into the proper postion. The stack is
used each other as
// buffer ... 阅读全帖
p*i
发帖数: 411
23
来自主题: JobHunting版 - 上一道题吧
感谢帮忙测试。我的已经通过了
基本思想是用一个stack s0,遇到'('就push当前的index,遇到')'就pop,说明发现一
个'('-')' pair
此时left和right分别记录这个pair的左边'('的位置和右边')'的位置
同时还有一个额外的s1,记录当前已经遇到的所有pair的左右位置
每次发现一个新的pair (lnew, rnew),就与s1栈顶的pair(假设是lold, rold)进行比较
如果lnew == rold+1,说明他们是()()这种情况,所以需要合并
如果lnew < rold+1,说明是(())这种情况,也需要合并
一旦进行了第一个合并,就需要继续检查s1直到桟为空或者不能继续合并为止,应付()
(())这种情况
下面是我在leetcode上用的code
#include
using namespace std;
class Solution {
public:
int longestValidParentheses(string s) {
Start typing your ... 阅读全帖
l***i
发帖数: 1309
24
来自主题: JobHunting版 - 问一道老题
use hellobruce's idea, here is code
assume input is a[N] and difference is K
typedef pair pii;
// small keeps track of min while p1 is moving to right
// large keeps track of max while p1 is moving to right
deque small, large;
int p1, p2;
int ans=0, curr=0;
small.clear(); large.clear();
for(p1=p2=0; p2 {
int val = a[p2];
while(!small.empty() && val > small.front().first + K)
{
p1=small.front().second +1;
small.pop_front();
}
while(!large.empty() && val < ... 阅读全帖
b******g
发帖数: 77
25
来自主题: JobHunting版 - 求教一道面试题
#include
#include
void printZ(Node * root)
{
bool l2r = true;
stack S1, S2;
stack S1.push(root);
Node * node;
while ( !S1.empty() || !S2.empty())
{
if (l2r)
{
while ( !S1.empty())
{
v = S1.top();
S1.pop();
cout << node->value;
if (node -> left != NULL)
S2.push(node -> left);
if (node -> left != NULL)
... 阅读全帖
z******e
发帖数: 82
26
来自主题: JobHunting版 - 发个Twitter的面试题
借用eswine的idea:
public static String test1(String str) {
StringBuilder sb = new StringBuilder();
int len = str.length();
boolean escape = false;
for (int i = 0; i < len; i++) {
char c = str.charAt(i);
// everything between ' '
if (c == '\'') {
escape = true;
while (i < len) {
c = str.charAt(i);
sb.append(c);
if (c == '\'' && !escape) {... 阅读全帖
t****a
发帖数: 1212
27
来自主题: JobHunting版 - 这个题目怎么做?
这个是map .*的dp算法,用memoize recursion实现,包括测试数据。改成.+很简单。
懒得改了。
(defn ch-match [c1 c2]
(if (= c2 \.)
true
(if (= c1 c2)
true
false)))
(def str-match
(memoize
(fn [str1 str2]
(cond (and (empty? str1) (empty? str2)) true
(or (empty? str1) (empty? str2)) false
:else (let [c1 (peek str1)
c2 (peek str2)]
(if (= c2 \*)
(let [c3 (peek (pop str2))]
(if (ch-match c1 c3)
... 阅读全帖
j********g
发帖数: 80
28
你的代码稍微改改逻辑就不用那么多NULL判断了。C++写的,不太清楚java里对null的
处理。
class Solution {
public:
bool isSymmetric(TreeNode *root) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if(root == NULL)
return true;

stack s1;
stack s2;

s1.push(root->left);
s2.push(root->right);

while(!s1.empty()&& !s2.empty()){
TreeNode* n1 = s1.top();
TreeNode* ... 阅读全帖
j********g
发帖数: 80
29
你的代码稍微改改逻辑就不用那么多NULL判断了。C++写的,不太清楚java里对null的
处理。
class Solution {
public:
bool isSymmetric(TreeNode *root) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if(root == NULL)
return true;

stack s1;
stack s2;

s1.push(root->left);
s2.push(root->right);

while(!s1.empty()&& !s2.empty()){
TreeNode* n1 = s1.top();
TreeNode* ... 阅读全帖
s****e
发帖数: 75
30
bool isSymmetricTree(TreeNode* root){
queue q1, q2, p1, p2;
if(!root) return true;
if((!root->left) && (!root->right)) return true;
if(!(root->left && root->right && (root->left->val == root->right->val)))
return false;
q1.push(root->left);
q2.push(root->right);
TreeNode* t1;
TreeNode* t2;
while(!q1.empty()){
while(!q1.empty()){
t1=q1.front();
t2=q2.front();
q1.pop();
q2.pop();
if(t1->left && t2->right && (t1->left->val == t2->right-... 阅读全帖
d**e
发帖数: 6098
31
☆─────────────────────────────────────☆
remraf (如来佛) 于 (Wed Jul 25 16:17:30 2012, 美东) 提到:
看到版上时不时有人抱怨中国人面试中国人时,不但不帮忙,还故意恶心中国人。我想
来说说自己面试中国人的感受。
1。我还是小角色时,面试中国人不敢用中文,因为怕被人说闲话。
(所以不讲中文不是要故意恶心找工的人)
2。 有时我会问一些比较难的问题,因为我想要找到一个闪光点来推荐录取他。不要以
为问容易的问题的人,就想要你。其实正好相反,嫌瓜的才是想买瓜的。上次一老中来
面试,我的一个同事对他非常好,结果最反对的就是他。
3。 不要以为中国人就一定要照顾你,因为其实你那个职位的候选人全是中国人。这种
情况我们发生了很多次。
中国人都很相似,所以你找工作的竞争者一般来讲至少有一个中国人。
4。 我选人一般是中国人,东亚人优先。但是往往来面试的要么都是中国人,要么都是
白人
5。我面试过几个年纪大的中国人,见到我一小年轻,都表现的很不屑,甚至连回答我
的问题都表现的不耐烦。
跟其他年青的候选人极大反差。理所当... 阅读全帖
f*******t
发帖数: 7549
32
来自主题: JobHunting版 - 2道算法题。 求教大家!
找出了一年多前写的逆波兰处理算数表达式的代码,强烈建议有兴趣的自己实现一下:
#include
#include
#include
#include
#define BUFFSIZE 1024
using namespace std;
struct Token {
bool isNum;
int num;
char op;
Token();
Token(const Token& t);
};
Token::Token()
{
isNum = false;
num = 0;
op = 0;
}
Token::Token(const Token& t)
{
isNum = t.isNum;
num = t.num;
op = t.op;
}
Token *getToken(const char expr[], int& idx)
{
Token *res = NULL;
while(expr[idx] == ' ')
... 阅读全帖
j********x
发帖数: 2330
33
我觉得是有个bug,我还没想出来怎么构造反例,先不说具体的bug了
能过small和large case
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool isSymmetric(TreeNode* root) {
stack lhs;
for (TreeNode* l_root = root; l_root != NULL; l_root = l_root->left)
{
lhs.push(l_root);
}

stack rhs;
for (Tre... 阅读全帖
s*******s
发帖数: 1031
34
来自主题: JobHunting版 - 一个小面筋
做了一下,不知道对不对。
void PostVisit(TreeNode *tree) {
if(!tree)
return;
PostVisit(tree->left);
PostVisit(tree->right);
print(tree->value);
}
void PostVisit(TreeNode *tree) {
if(!tree)
return;
stack stkNodes;
stkNodes.push(tree);
while(!stkNodes.empty()) {
TreeNode *node = stkNodes.top();
if(node->left)
stkNodes.push(node->left);
else if(node->right)
stkNodes.push(node->right);
else {
... 阅读全帖
s********u
发帖数: 1109
35
就是用condition_variable的时候,wait函数有一个参数是predicate,一般就是传一
个bool函数进去。
但我用gcc 4.8.1试了下这几种都不行(设计blocking queue):
_cond.wait(locker, [](){ return !_queue.empty() } );
_cond.wait(locker, []{ return !_queue.empty() } );
bool notEmpty(){return !_queue.empty() ;}
_cond.wait(locker, notEmpty);
错误是: 'this' was not captured for this lambda function
编译器问题?
顺便问下就是这种写法等效么:
while(_queue.empty())
_cond.wait(locker);
要是等效就不费事了。
x******e
发帖数: 18
36
来自主题: JobHunting版 - 刚上市公司面经
Using 2 stacks to mimic the 2 bucket, suppose s1 has 5L and s2 has 3L.
Algorithm:
1) Fill s1 to be full
2) Move the water in s1 to s2 until s2 is full
3) Empty s2
4) Move the water in s1 to s2 until s1 is empty
5) Fill s1 to be full
6) Move the water in s1 to s2 until s2 is full
Code:
#include
using namespace std;
const int kSize1 = 5;
const int kSize2 = 3;
void PourWater(stack &s1, stack &s2) {
for (int i = 0; i < kSize1; i++) {
s1.push(1);
}
for (int i = 0; i < kSiz... 阅读全帖
P*A
发帖数: 189
37
两个容器分别从两头开始存,最后merge到一起
vector copy(Quack& q) {
vector v1, v2;
int a,b,c;
while (!q.empty()) {
a = q.peek();
q.pop();
c = 1;
while (!q.empty()) {
b = q.peek();
if (b == a) {
++c;
q.pop();
}
else
break;
}
if (q.empty()) {
v1.insert(v... 阅读全帖
P*A
发帖数: 189
38
两个容器分别从两头开始存,最后merge到一起
vector copy(Quack& q) {
vector v1, v2;
int a,b,c;
while (!q.empty()) {
a = q.peek();
q.pop();
c = 1;
while (!q.empty()) {
b = q.peek();
if (b == a) {
++c;
q.pop();
}
else
break;
}
if (q.empty()) {
v1.insert(v... 阅读全帖
f**********t
发帖数: 1001
39
来自主题: JobHunting版 - T面经一题
int opNum(int x, int y, char op) {
switch (op) {
case '+':
return x + y;
case '_':
return x - y;
case '*':
return x * y;
case '/':
if (y == 0) {
return 0;
}
return x / y;
}
return 0;
}
int calc(stack &ops, stack &nums) {
int x = nums.top();
nums.pop();
int y = nums.top();
nums.pop();
int res = opNum(x, y, ops.top());
ops.pop();
nums.push(res);
return res;
}
string simplify(string s) {
auto it = s.begin();
stack ops;... 阅读全帖
a***e
发帖数: 413
40
Symmetric Tree一开始又把题理解错了。后来弄了个recursion之后,写了如下这个冗
长的 iterative version. 后来看了别人写的发现用一个stack要简洁好多好多。估计
是same tree那道题偷了懒,没认真看iterative的做法。
请问怎么样才能想到比较简洁的答案呢?是不是还是得多练?
从2月中就断断续续的刷,151道做了77道,希望年底能搞完一遍。N年前的今天来到美
国,雄心壮志要当教授,开公司,现在备受打击后,只是很实际的希望找个喜欢的工作
,能够在不爽的时候快点离开!
bool isSymmetric(TreeNode *root) {
if (root==NULL||(root->left==NULL &&root->right==NULL)) return true;

if ((root->left==NULL && root->right!=NULL)||(root->left!=NULL&&root
->right==NULL))
{
re... 阅读全帖
l******a
发帖数: 14
41
来自主题: JobHunting版 - A高频题:老鼠钻洞问题
Sort the mouse for left to right.
Add mouse one at a time, keep a current time length that all included mouses
can run to holes. And keep the current mapping.
When adding new mouse, if min time hole for that mouse is not mapped, added,
move on.
If no empty hole on left for existing included mouses, pick the min hole
from not mapped hole, added and move on.
If min hole is occupied, and there are empty holes on the left, pick the
closest empty hole, check if the max time if move all existing mouse... 阅读全帖
m*****g
发帖数: 71
42
JUnit test 代码
public class SolutionTest {
@Test
public void test() {
int[] a;
int[] b;
boolean expect;
Solution s = new Solution();
//both empty
a = new int[] {};
b = new int[] {};
expect = true;
testSolution(s, a, b, expect);
//empty and 1 element
a = new int[] {};
b = new int[] {1};
expect = true;
testSolution(s, a, b, expect);
//empty and 2 element all 0s
a =... 阅读全帖
z********o
发帖数: 83
43
来自主题: JobHunting版 - 借人气问一道Samsung的题
求思路,感谢哈
A binary tree is either an empty tree (represented by an empty pointer) or a
node consisting of a single integer value and two binary trees called the
left subtree and right subtree.
A binary tree T is given. A path in tree T is a non-empty sequence of nodes
of tree T such that each consecutive node in the sequence is a subtree of
its preceding node.
A path P in tree T is given. The amplitude of path P is the maximum
difference between values of nodes on path P. The amplitude of tree T i... 阅读全帖
c*******t
发帖数: 123
44
来自主题: JobHunting版 - 问一道面经的题目
用两个stack, best case 可以O(n)
第一个stack 不变量是:递增,所有元素比当前元素小。
第二个 stack不变量是:递减,所有元素比当前元素大。
比如 2 8 5 2 6 1
指针指向6时,stack 1: 1. stack2:empty output stack1.size();
指针指向2时, stack1: 1,6, stack2:empty. 6入 stack2, output stack1.size().
2 入stack1
stack1:1,2 stack2:6
省略。。。。。。
指针指向8时, stack1: 1,2,5 stack2: 6, rebalance stack, 6入1.
stack1: 1,2,5,6 stack2:empty
stack1:1,2,5,6,8, stack2:empty
最后指向2: rebalance stack, stack1:1 stack2: 8,... 阅读全帖
t*******r
发帖数: 22634
45
来自主题: Parenting版 - autism and puzzles
关于数学,我觉得应该这么说。。。不同的人,对数学的 perception,不一定
一样。。。或者说,基本不会一样。
我觉得不是所有人的,都把数学看成完全铁板钉钉的逻辑。。。打个比方,也许
有人觉得 jigsaw puzzle 是非常 logical/analytical。。。但是我觉得
jigsaw puzzle 的第一步,“selection/pruning by guess”,我觉得其实是
非常 intuitive 的。。。或者另一个角度说,你很难用逻辑来说明为啥你先
try this piece first,not that piece,很多时候你仅仅就是 feel this
simply is the right choice from your guts。。。逻辑则是那一步以后的事
。。。
我觉得娃版 foundation of mathematics 的概念啥的,也是非常 intuitive
的。。。只不过大妈们不这么看而已。。。就比如为啥俺在娃面前写了那个错误的
用 additive inverse property 和 distributive property 来证明... 阅读全帖
k********n
发帖数: 18523
46
来自主题: Stock版 - Read how to eat apple
Eating Fruit - this opened my eyes.
Dr Stephen Mak
treats terminal ill cancer patients by
"un-orthodox" way and many patients recovered.
Before he used solar energy to clear the illnesses of his patients.
He believes on natural healing in the body against illnesses.
See his article below.
It is one of the strategies to heal cancer.
As of late, my success rate in curing cancer is about 80%.
Cancer patients shouldn't die. The cure for cancer is already found.
It is whether you believe it or not.
I... 阅读全帖
j***a
发帖数: 10844
47
来自主题: WashingtonDC版 - DC Hiking Trails
Hiking and Backpacking Gear and Tips
I've gotten several e-mails about what gear is necessary for hiking and
backpacking. There are 100s of vendors out there selling different qualities
of gear at different prices. To try to evaluate them all here is impossible
and beyond the scope of this website. Instead I've chosen to list the most
important items you'll need and what features to look for and avoid. I
strongly recommend visiting one of the many on-line outfitters and doing
some comparison sho... 阅读全帖
p*********l
发帖数: 26270
48
来自主题: loseweight版 - 减肥可以喝红酒么?
http://www.sparkpeople.com/resource/nutrition_articles.asp?id=5
Alcohol is metabolized differently than other foods and beverages. Under
normal conditions, your body gets its energy from the calories in
carbohydrates, fats and proteins, which are slowly digested and absorbed
within the gastrointestinal system. However, this digestive process changes
when alcohol is present. When you drink alcohol, it gets immediate attention
(because it is viewed by the body as a toxin) and needs no digestion.
O... 阅读全帖
u*********s
发帖数: 2077
49
来自主题: Running版 - Nausea and vomiting
http://www.ws100.com/pguide.htm#nausea
This is a particularly vexing problem; nothing will shut you down faster
than a bout of nausea. The causes of nausea are many. They include
dehydration, running too fast (relative to your ability and training),
electrolyte depletion, overeating, and sometimes, simple exhaustion.
In many cases it is simply your body抯 way of protecting itself. When the
body gets into extreme situations, it automatically starts shutting down non
-essential systems to protect t... 阅读全帖
w******a
发帖数: 2057
50
来自主题: LeisureTime版 - Les Miserables 悲惨世界
http://www.youtube.com/watch?v=CJnjcX8skXk
This link is from the Les Miserables 10 year anniversary musical by Mike
Ball.It is a very good representation of the song and the character.The name
of
the song is: 'empty chairs at empty tables'.
When Marius found out after a blood shed student revolution battle
against the French government that all his comrades were dead, he went
back to the barricade and sang the song 'empty chairs at empty
tables'.
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)