由买买提看人间百态

topics

全部话题 - 话题: nstart
(共0页)
x*********w
发帖数: 533
1
来自主题: JobHunting版 - 求rotate image的对折算法

const int N = 5;
void Rotate(int A[N][N])
{
int nStart = 0;
int nDim = N;
while (nDim > 1)
{
for (int i = 0; i < nDim-1; i++)
{
swap(A[nStart][nStart+i], A[nStart+i][nStart+nDim-1]);
swap(A[nStart][nStart+i], A[nStart+nDim-1][nStart+nDim-1-i]);
swap(A[nStart][nStart+i], A[nStart+nDim-1-i][nStart]);
}
nStart++;
nDim -= 2;
}
}
是这个旋转算法吗
w****x
发帖数: 2483
2
来自主题: JobHunting版 - twitter intern面经
/*
Given tweet's inverted index,how to find phrases combination,e.g
phrase "twitter good tool", "twitter is a good tool" is better than "twitter
is good,
facebook is a better tool"
*/
bool GetClosestPhrase(hash_map>& dic, vector& strs,
int& nStart, int& nEnd)
{
for (vector::iterator it = strs.begin(); it != strs.end(); it++)
{
if (dic.find(*it) == dic.end())
return false;
}
int nNum = strs.size();
vector*> vec;
ve... 阅读全帖
w****x
发帖数: 2483
3
来自主题: JobHunting版 - twitter intern面经
/*
Given tweet's inverted index,how to find phrases combination,e.g
phrase "twitter good tool", "twitter is a good tool" is better than "twitter
is good,
facebook is a better tool"
*/
bool GetClosestPhrase(hash_map>& dic, vector& strs,
int& nStart, int& nEnd)
{
for (vector::iterator it = strs.begin(); it != strs.end(); it++)
{
if (dic.find(*it) == dic.end())
return false;
}
int nNum = strs.size();
vector*> vec;
ve... 阅读全帖
r*c
发帖数: 167
4
来自主题: JobHunting版 - 问一道题(6)
贴个pattern字符串有重复字符的解法, 是dek,cpp1等大牛的解法的扩展。
#include
#include
#include
#include
using namespace std;
#define INT_MAX 2147483647
#define INT_MIN -2147483648
class MinWindowSolution
{
public:
struct TreeNode
{
TreeNode *parent;
int val;
vector children;
TreeNode(int i, TreeNode *p) : val(i), parent(p){}
};
void FindMinWindow_Tree(const vector& input , const vector&
query , int& nStart,... 阅读全帖
w****x
发帖数: 2483
5
来自主题: JobHunting版 - 出两道题目大家做做

为啥要扫第二次? 谁帮我看看下面这个解法对不对!
struct EVENT
{
int nStart;
int nEnd;
bool bFlg;
EVENT(int a, int b) : nStart(a), nEnd(b) { bFlg = false; }
};
bool lessThan(const EVENT& evt1, const EVENT& evt2)
{
return evt1.nStart < evt2.nStart;
}
void setFlg(EVENT events[], int n)
{
sort(events, events+n, lessThan);
int nMaxEndIndex = 0;
for (int i = 1; i < n; i++)
{
if (events[i].nStart <= events[nMaxEndIndex].nEnd)
{
events[i].bFlg = true;
... 阅读全帖
r*c
发帖数: 167
6
来自主题: JobHunting版 - 问一道题(6)
之前写了个C#的。思路都一样, use tree matching algorithm to determine the
candidate window.
//using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
class MinWindowSolution
{
class TreeNode
{
public TreeNode parent;
public int val;
public List children;
public TreeNode(int i, TreeNode p) { val = i; parent = p; children =
new List(); }
};
public void FindMinWindow_Tree(int[] input, int[] query, out int nS... 阅读全帖
w****x
发帖数: 2483
7
来自主题: JobHunting版 - 问个reverse linked list

以后面试因该严格静止用脚本语言面试,太坯了
NODE* Reverse(NODE* pHead, int nStart, int n)
{
if (NULL == pHead || nStart < 1 || n < 1)
return pHead;
NODE* pX = NULL;
NODE* pIter = pHead;
for (int i = 1; i < nStart && pIter != NULL; i++)
{
pX = pIter;
pIter = pIter->pNext;
}
if (pIter == NULL) return pHead;
NODE* pEnd = pIter;
NODE* pPrev = NULL;
for (int i = 0; i < n && pIter != NULL; i++)
{
NODE* pTmp = pIter->pNext;
pIter->pNext = p... 阅读全帖
w****x
发帖数: 2483
8
来自主题: JobHunting版 - 出两道题目大家做做

struct EVENT
{
int nStart;
int nEnd;
bool bFlg;
EVENT(int a, int b) : nStart(a), nEnd(b) { bFlg = false; }
};
struct ENDPOINT
{
int nIndex;
bool bStart;
int nVal;
};
bool lessThan(const ENDPOINT& ed1, const ENDPOINT& ed2)
{
return ed1.nVal < ed2.nVal;
}
void setFlg(EVENT events[], int n)
{
if (events == NULL || n <= 0)
return;
ENDPOINT* ends = new ENDPOINT[n*2];
for (int i = 0; i < n; i++)
{
ends[2*i].bStart = true;
ends[2*... 阅读全帖
m**k
发帖数: 18660
9
不用那么麻烦啊.
start exercise.
然后另外打开一个窗口 copy this link:
http://50.197.204.74/exam?cmd=startexercise&status=NSTART
就可以打印了
m**k
发帖数: 18660
10
不用那么麻烦啊.
start exercise.
然后另外打开一个窗口 copy this link:
http://50.197.204.74/exam?cmd=startexercise&status=NSTART
就可以打印了
n****t
发帖数: 66
11
来自主题: NewJersey版 - NJ中部送honeydew苗 (转载)
【 以下文字转载自 gardening 讨论区 】
发信人: nstart (回眸), 信区: gardening
标 题: NJ中部送honeydew苗
发信站: BBS 未名空间站 (Sun Jun 21 20:00:13 2015, 美东)
就是HMART卖的那种白色的瓜苗。要的话留下个言。可以放门口自取。
t*********7
发帖数: 9506
12
来自主题: NBA版 - 接受报名的ID (转载)
【 以下文字转载自 Piebridge 讨论区 】
发信人: xixihaha2008 (欣欣), 信区: Piebridge
标 题: 接受报名的ID
发信站: BBS 未名空间站 (Fri Apr 6 16:53:04 2012, 美东)
谢谢各位同学的支持
接受报名的ID统计如下
活动具体时间和地点,我在晚上7:00之前发到各位的信箱, 谢谢大家
希望,大家在活动中,保持宽容,平和的心情,
如果活动地点或者相关事宜考虑或者安排不周,敬请原谅,谢谢
(1) ID: xixhaha2008 --- 女
(2) ID: forpie --- 男
(3) ID: medimm ---女
(4) ID: comcow --- 男
(5) ID: Faye2012 ---女
(6) ID: SmartMeter --- 男
(7) ID: lastdream ---女
(8) ID: wansg --- 男
(9) ID: cherry324 ---女
(10) ID: jcnj --- 男
(11) ID: ndtc --- 女
(12) ID: cherryseas... 阅读全帖
x**********8
发帖数: 3151
13
在我站内报名的
个人基本信息:
★ ID nstart (回眸)
★性别: 女
★出生年份: 70年代中
★所在地(至少明确state): NJ
★学历: MS
★职业情况(学生还是工作): 工作
★简单的物理参数(身高/体重): 1.6米/47kg
★属相,血型、星座: scorpia
★当前婚姻状态(从没结过婚/曾婚/丧偶):  曾婚
★联系方式(email/IM/站内):站内
本人特点:
比较喜欢静静地做自己喜欢的事。我很enjoy cooking什么的,喜欢看着对方把我做的
东东吃完了。
喜欢弹弹琴,看看书,喜欢拍照,我也很喜欢旅游的,
很想找一个人陪我一起看风景,不想一个人孤零零的。
我比较孩子气,希望你能把我当成手心里的宝,呵护我。别笑呀,天下所有的女人无论
年纪多大都是这样想的。
对对方的要求:
我们彼此有很好的默契;
重感情,专一,对我好,希望找到一个一辈子不离不弃的。。。
x**********8
发帖数: 3151
14
来自主题: Piebridge版 - 接受报名的ID
谢谢各位同学的支持
接受报名的ID统计如下
活动具体时间和地点,我在晚上7:00之前发到各位的信箱, 谢谢大家
希望,大家在活动中,保持宽容,平和的心情,
如果活动地点或者相关事宜考虑或者安排不周,敬请原谅,谢谢
(1) ID: xixhaha2008 --- 女
(2) ID: forpie --- 男
(3) ID: medimm ---女
(4) ID: comcow --- 男
(5) ID: Faye2012 ---女
(6) ID: SmartMeter --- 男
(7) ID: lastdream ---女
(8) ID: wansg --- 男
(9) ID: cherry324 ---女
(10) ID: jcnj --- 男
(11) ID: ndtc --- 女
(12) ID: cherryseason --- 男
(13) ID: qqzy --- 女
(14) ID: newlife2000 --- 男
(15) ID: funnyminnow --- 女
(16) ID: shaquille --- 男
(17) ID: goodluc... 阅读全帖
m**k
发帖数: 18660
15
oh.. I see your problem.
ok. do this.
after you click start. another window will pop up and will not allow you
print. right?
open a new window. and copy this URL:
http://beestar.org/exam?cmd=startexercise&status=NSTART
m**k
发帖数: 18660
16
来自主题: _K12版 - 问问这个beestar
yes. after you start exercise, you can post this URL in browser and print it
out:
http://beestar.org/exam?cmd=startexercise&status=NSTART
m**k
发帖数: 18660
17
来自主题: _K12版 - Mark, 请教
还可以阿。
start exercise 以后。
在另外一个新窗口打开 :
http://beestar.org/exam?cmd=startexercise&status=NSTART
(共0页)