由买买提看人间百态

topics

全部话题 - 话题: preordered
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
a***e
发帖数: 413
1
下面这两个1.2.写法都是O(N^2)吧?为啥2说是O(N)呢?另外,看到lc上一个
discussion的iterative的解法3.https://oj.leetcode.com/discuss/2297/the-
iterative-solution-is-easier-than-you-think
时间复杂度是O(N)吧?
我看了helper的function signature能写出1,对2中用到的好多STL要搜索才能写出来
,不熟。
Binary tree和recursion现在是我最弱处,多谢!
1.
class Solution {
public:
TreeNode *buildTree(vector &preorder, vector &inorder) {
if (preorder.size()==0) return NULL;
else if (preorder.size()==1)
{
TreeNode *t = new TreeNode(preorder[0])... 阅读全帖
h*********o
发帖数: 230
2
进行到第三次的build的时候,beg,end应该分别 为 2,1,此时应该返回,为什么 end
是3呢。。。
看了许久了,请大家帮忙看看问题在哪儿
public static TreeNode buildBST(int[] preorder){
if(preorder.length==0)
return null;
return buildBST(preorder,0, preorder.length-1);
}
public static TreeNode buildBST(int[] preorder, int beg, int end){

if(beg>end)
return null;
//System.out.println(beg+" "+end);
TreeNode root=new TreeNode(preorder[beg]);
int index=-1;
for(int i=... 阅读全帖
C*******a
发帖数: 448
3
来自主题: JobHunting版 - construct tree with preorder and inorder
以下是这道题正确的代码
然而当我想把代码简洁一些,把标有*的4行换成1行:
int i = Arrays.asList(inorder).indexOf(preorder[preL]);
就会报错。谁知道错在哪儿???
public class Solution {
public TreeNode buildTree(int[] preorder, int[] inorder) {
return _buildTree(preorder, 0, preorder.length, inorder, 0, inorder.
length);
}
private TreeNode _buildTree(int[] preorder, int preL, int preR, int[]
inorder, int inL, int inR) {
if (preL >= preR) {return null;}
TreeNode root = new TreeNode(preorder[preL]);
* int i... 阅读全帖
c******n
发帖数: 16666
4
来自主题: TVGame版 - $5 GC for preordering FF X|X-2@newegg
Houa Y:Just a word of warning to everyone. I'd be wary about preordering
games from newegg that comes with a preorder bonus/limited edition from now
on. I preordered Tomb Raider Definitive edition for the Xbox One and I only
received the regular copy and not the actual copy with the artbook packaging
. If you go and check the Q&A section of the Tomb Raider Definitive edition,
you'll see that some people got screwed like me. Newegg clearly stated in
the product description that people who preorde... 阅读全帖
a***e
发帖数: 413
5
这个是在leetcode的讨论中一个叫dtx0的同学贴的。
gpraveenkumar的idea和他/她的几乎一样
The idea is as follows: 程序中没用flag,而是用pp这个指针
1) Keep pushing the nodes from the preorder into a stack (and keep making
the tree by adding nodes to the left of the previous node) until the top of
the stack matches the inorder.
2) At this point, pop the top of the stack until the top does not equal
inorder (keep a flag to note that you have made a pop).
3) Repeat 1 and 2 until preorder is empty. The key point is that whenever
the flag is set... 阅读全帖
C******g
发帖数: 2930
6
来自主题: _Playstation3版 - Best Buy God of War Preorders Arrive
Looks as if Best Buy has just received its stock of God of War 3 preorder
boxes. Supporting both versions of the title, Best Buy is offering a 10$
savings on the purchase of God of War Collection and also the preorder will
net you the much talked about E3 2009 demo (be on the look out for my
impressions soon, and a nice surprise). Get out there and preorder the
Ultimate Edition while the supplies last. Note: to receive the 10$ off the
collection you must purchase the God of War 3 preorder at the
d***y
发帖数: 5325
7
3月12日preorder的都没收到。刚看到有家店来3G了,打电话人家说没货,需要
preorder。preorder也不知道自己要的型号什么时候能拿到啊。
f********e
发帖数: 166
8
void preorder(Node *r)
{
if(!r) return;
cout< preorder(r->left);
preorder(r->right);
}
void dfs(Node *r)
{
if(!r) return;
visit(r);
r.visited = true;
foreach(Node n in r.adjecent){
if(n.visited==false)
dfs(n);
}
}
如果按照先左子树,后右子树DFS的话,我觉得是的
d*****y
发帖数: 260
9
【 以下文字转载自 ebiz 讨论区 】
发信人: doubley (Viceroy), 信区: ebiz
标 题: [zz] AT&T: 200,000 iPhone 4S preorders in 12 hours
发信站: BBS 未名空间站 (Fri Oct 7 19:37:44 2011, 美东)
AT&T: 200,000 iPhone 4S preorders in 12 hours
Read more: http://news.cnet.com/8301-27076_3-20117529-248/at-t-200000-iphone-4s-preorders-in-12-hours/#ixzz1a8sdTHFy
s****t
发帖数: 17096
10
来自主题: TVGame版 - MW3 preorders hit nearly 9 million
Lazard Capital Markets' Atul Bagga says latest Call of Duty presales are
almost three times those of Battlefield 3; Call of Duty: Elite now live.
By Tom Magrino, GameSpot
Even if EA doesn't expect its Battlefield franchise to unseat Call of Duty
as the top-selling first-person shooter this year, the game still logged a
solid start of 5 million units sold. Those opening-week sales were bolstered
by preorders that exceeded 3 million units, according to EA. And according
to Lazard Capital Markets a... 阅读全帖
l**********i
发帖数: 34
11
【 以下文字转载自 shopping 讨论区,原文如下 】
发信人: LedZeppelinI (Physical Graffiti)(Argerich), 信区: shopping
标 题: Velvet Revolver CD preorder at BB $9.99
发信站: Unknown Space - 未名空间 (Fri Jun 4 13:00:54 2004) WWW-POST
Velvet Revolver CD 'Contraband' preorder at BB $9.99
ddd has for $12.99
Velvet Revolver: Scott Weiland (vocals); Dave Kushner (guitar, background
vocals); Slash (guitar); Duff McKagan (bass, background vocals); Matt Sorum
(drums, background vocals).
9.99 preorder at cc too.
d*****y
发帖数: 260
12
【 以下文字转载自 ebiz 讨论区 】
发信人: doubley (Viceroy), 信区: ebiz
标 题: [zz] AT&T: 200,000 iPhone 4S preorders in 12 hours
发信站: BBS 未名空间站 (Fri Oct 7 19:37:44 2011, 美东)
AT&T: 200,000 iPhone 4S preorders in 12 hours
Read more: http://news.cnet.com/8301-27076_3-20117529-248/at-t-200000-iphone-4s-preorders-in-12-hours/#ixzz1a8sdTHFy
z****y
发帖数: 345
13
在ATT preorder了一个4s一个4,现在4s都收到一周了,但是4还没动静。眼看一个月都
快过去了,问问板上有类似情况的吗?
ATT的preorder也太慢了吧,以后都不敢玩preorder了。
e******n
发帖数: 3435
14
【 以下文字转载自 PDA 讨论区 】
发信人: everseen (无名), 信区: PDA
标 题: ATT的iphone 6s的preorder是ship时候才charge么
发信站: BBS 未名空间站 (Thu Sep 24 01:59:31 2015, 美东)
想从ATTpreorder,是preorder的时候就charge钱么?什么时候算plan开始?
有人preorder了吗,是什么情况?
多谢啦。
w*******y
发帖数: 60932
15
Amazon is now offering $10 video game credit for preorders of Duke Nukem
Forever:
Link:
http://www.amazon.com/dp/B002I0JAJ2/
Price is $59.99 for PS3/Xbox 360, $49.99 PC. As usual, credit will be given
after the game ships.
This applies to existing preorders, so it's particularly nice for those of
us who locked in their preorder when the base price was a few dollars lower
($46.99 for PC version in my case).
a*******o
发帖数: 691
16
来自主题: ebiz版 - preorder 的问题
版内神医神户,问个化妆品Preorder的事。
1。一般preorder电话答应多给的gift bag是不是有可能被cancel啊。
2。看到版上这么多人征化妆品护士,是不是gift bag走的还是很快的?不提前订,到
release 的时候就怕订不上了?
提前谢答复。
d*****y
发帖数: 260
m***r
发帖数: 1801
18
来自主题: ebiz版 - preorder 要选定local店吗
从来没preorder 过,是preorder然后去pick up 吗
m****n
发帖数: 15
19
来自主题: shopping版 - newegg的preorder有戏吗
早上八点多起床,迷迷糊糊,进NEWEGG,发现那天没抢到的VAIO本又出来了,然后赶紧
一路NEXT,到了CHECKOUT那步提示没货了,CART变EMPTY
来坛子里转一圈,再出去,那个本本的页面还在那,显示SOLD OUT,下面有一个ADD TO
WISHLIST,无聊就加了试试。。竟然可以CHECKOUT,而且价格是一样的
现在收到preorder confirmation mail了
哪位大牛给俺解释一下这个preorder是什么意思啊?
是不是按队列排后备,别人要是cancell了就把我补上。还是。。。就是一个BUG,过两
天就把我给cancell了。
先谢过。。。
c*******b
发帖数: 459
20
来自主题: shopping版 - DIABLO 3!!!!! Preorder now!
这玩意preorder根本没谱的。。。SC2也早就preorder了。。。暴雪做事不到他们觉得
可以谁说也没戏的。。。
h*******a
发帖数: 3279
21
来自主题: shopping版 - preorder能拿到cashback么?
【 以下文字转载自 ebiz 讨论区 】
发信人: huliweiba (狐狸), 信区: ebiz
标 题: preorder能拿到cashback么?
发信站: BBS 未名空间站 (Sun Feb 27 23:32:05 2011, 美东)
突然想到 preorder等扣钱寄东西的时候也许都过去1、2个月了 这样的情况 shopper啊
ebates啊还会给cashback嘛?有人有拿到过的先例不?谢谢~~
t*******y
发帖数: 11968
22
【 以下文字转载自 Game 讨论区 】
发信人: talkdirty (做爱不成仁义在), 信区: Game
标 题: Guild Wars 2 available to preorder on Amazon at $46.99
发信站: BBS 未名空间站 (Wed Jun 2 14:45:46 2010, 美东)
It seems like retail price is going to be $59.99.
So, good idea to preorder at Amazaon and lock the price. Plus, Amazon doesn'
t charge until the day of release. You can always cancel the order without
penalty.
BTW, Guildwars is so much fun to play. I am looking forward to its sequel.
c*********y
发帖数: 1461
23
土问电话用GC preorder是不是可以只要code就好了?
就是想在dillards,preorder的时候是要告诉卡号的,那是当场就会被刷掉吗?是的话
是不是就不用让gift card卖家把实体卡寄过来了?
GWP是sept 6开始,25结束,我是收到的宣传单,所以没有图的说。。。。
有化妆包一个,毛笔式的唇彩(汗,不会叫正确的名字,大家领会精神吧),睫毛膏,
眼影*2+腮红*1的一个彩妆盘,repair那个面霜。
彩妆又cool和warm可选,cool就是pink/plum那种,warm就是大地色系
a******w
发帖数: 774
24
preorder价格会不会比出来以后便宜?
在想要不要搞个现在amazon上preorder的s95
M*****e
发帖数: 4550
25
来自主题: PhotoGear版 - 6d2需要preorder吗
上市时间都不确定,就叫人preorder?
再说如果不preorder,上市当天买,还会没货吗?请当年关注过5d4 5d3的大牛们说说
s****r
发帖数: 31686
26
来自主题: PhotoGear版 - 6d2需要preorder吗
当然是先紧着预订的人了

:上市时间都不确定,就叫人preorder?
:再说如果不preorder,上市当天买,还会没货吗?请当年关注过5d4 5d3的大牛们说说
M*****e
发帖数: 4550
27
来自主题: PhotoGear版 - 6d2需要preorder吗
好 那我也preorder 离上市还有至少一个月吧 7月4日喇嘛和bh会有折扣吗
当年5d4 5d3上市的时候如果不preorder 要等很久吗

说说
g*****k
发帖数: 682
28
是online preorder
还是preorder在local store pick up?
online order说会提供free shipping WHEN YOUR IPHONE IS AVAILABLE。问题是什么时
候才会available啊?是24号吗?还是更早?
d****o
发帖数: 434
29
15号开始就可以PREORDER IPHONE4了.请问如果现在是att的3GS的用户,打算EARLY
UPGRADE,是不是先在APPLE.COM上PREORDER一台,然后再到店里PICK UP的时候重新签约
和付$399?还是怎样呢?
w*******y
发帖数: 60932
30
Not sure if this price will stick at $40 but it's lower than everywhere else
that's selling this game for $60 on google products:
http://www.google.com/products/catalog?q=Majin And The Forsaken Kingdom&hl=en&cid=17298666414908779901&ei=XKTZTO_wE4P4MaOE8egF&sa=button&ved=0CAkQgggwADgA#cond=1
#cond=1" rel="nofollow" target="_blank" onclick="_gaq.push(['_trackEvent', '
thread', 'click', '2361889 - price-drop-majin-and-the-forsaken-kingdom-
preorder-ps3-40-fs']);">google products [google products:
h... 阅读全帖
w*******y
发帖数: 60932
31
Lego Star wars The Padawan Menace DVD and BluRay:
http://www.walmart.com/ip/17057164?wmlspartner=Qfq2SUmeSyM&sour
is avaialble for preorder at walmart.
Looks like reg retail is going to be 19.99
Preorder is $13.00 with free shipping.
Includes an exclusive minifigure The blu ray and dvd disc
Details:
http://www.starwars.com/fans/media_news/lego_star_wars_padawan_
on what is included.
Looks to be only available at walmart
w*******y
发帖数: 60932
32
Add another one to the Arkham City preorder fiasco!
Right now if you preorder Batman Arkham City on PS3 or XBOX 360 at walmart.
com as a bonus you get a $10 egift card and Batman Arkham Asylum GOTY
Edition for $59.96 + tax and shipping. Great deal especially if you don't
already have Arkham Asylum!
PS3 Link:
http://www.walmart.com/ip/Batman-Arkham-City-w-Bonus-10-eGift-C
360 Link:
http://www.walmart.com/ip/Batman-Arkham-City-w-Bonus-10-eGift-C
w*******y
发帖数: 60932
33
Walmart has the Skylander Empire of Ice adventure pack available for
preorder for $19.99. I haven't seen it anywhere else. Just a heads up more
than a great deal.
Link:
http://www.walmart.com/ip/Skylanders-Adventure-Pack-Empire-of-I
#rr" rel="nofollow" target="_blank" onclick="_gaq.push(['_trackEvent', '
thread', 'click', '3818254 - skylanders-adventure-pack-empire-of-ice-
preorder-walmart']);">http://www.walmart.com/ip/Skyland...9721313#rr
k*****i
发帖数: 2373
34
我想要的物品:
明天的or preordered Apple Ipad 16g $560+ML
单张面值:
可接受的价格(必须明码标价!):
物品新旧要求:
邮寄方式要求:
买卖双方谁承担邮寄损失(Required if not code only):
付款方式说明:
其他补充说明:
广告的有效期:
物品来源:
我的联系方式:
二手交易风险自负!请自行验证是否合法和一手卡!:
s***r
发帖数: 4013
35
来自主题: ebiz版 - kinect preorder@amazon
11月才有。。不过可以定很多台~
preorder会立刻扣钱吗?不扣的话就定个几百台了~
h*******a
发帖数: 3279
36
来自主题: ebiz版 - preorder能拿到cashback么?
突然想到 preorder等扣钱寄东西的时候也许都过去1、2个月了 这样的情况 shopper啊
ebates啊还会给cashback嘛?有人有拿到过的先例不?谢谢~~
a******e
发帖数: 36306
37
是啊。。。又不敢去preorder,免得进黑名单。。
t**********a
发帖数: 851
38
Leappad 2可以preorder 了,可以订吗?不会毒吧。。。
Amazon, BB 都有。
z****0
发帖数: 1351
39
来自主题: ebiz版 - Apple iphone 5 Preorder
现在只能preorder带plan的吧
n****Z
发帖数: 1069
b*x
发帖数: 5456
41
来自主题: ebiz版 - 啥时候preorder? (转载)
【 以下文字转载自 Apple 讨论区 】
发信人: bmx (BMX), 信区: Apple
标 题: 啥时候preorder?
发信站: BBS 未名空间站 (Wed Oct 24 23:24:19 2012, 美东)
26号早上几点?
x*******1
发帖数: 4787
42
safeway's brother store, only in CA, hehe.
.
.
.
.
i am kidding, = lay away, ppl order stuff for late pickup, some stores
charges fees on that. walmart has preorder @ lay away a few weeks ago.
k*****i
发帖数: 2373
43
我想要的物品:
明天的or preordered Apple Ipad 16g $560+ML
单张面值:
可接受的价格(必须明码标价!):
物品新旧要求:
邮寄方式要求:
买卖双方谁承担邮寄损失(Required if not code only):
付款方式说明:
其他补充说明:
广告的有效期:
物品来源:
我的联系方式:
二手交易风险自负!请自行验证是否合法和一手卡!:
d*******l
发帖数: 338
44
感觉这俩不大能类比。preorder遍历可以通过dfs来实现,不过dfs里是先处理左儿子还
是右儿子还是先输出节点都是随意的
i******w
发帖数: 214
45
preorder is a specific instance of dfs
w***o
发帖数: 109
46
只给preorder不能保证唯一的BST。
如果只是构建任意一个符合条件的BST,把
int index=-1;
改成
int index = end + 1;
就好了。
s****y
发帖数: 44
47
MS on-site, A3问了这道题,结果挂了。CC150和recruiter都说见到最后一个
interviewer (HM的Manager)就差不多了。上次Amazon也是被A3灭了。
TreeNode CreateBinaryTree(int[] preorder, int[] inorder)
{
}
w*****e
发帖数: 931
48
如果有duplicate number的话,preorder和inorder不能唯一确定BST吧。
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)