由买买提看人间百态

topics

全部话题 - 话题: graphs
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
w****p
发帖数: 45
1
来自主题: Programming版 - 程序占用很大内存
多谢各位!!!
对,我想我做的比较外行,是把所有的数据都读到内存里,
我是读一些原始的信息,建GRAPH,建成的GRAPH都是在内存里,然后在GRAPH上做些模
拟。
我不清楚怎么把内存中很大GRAPH弄到硬盘上,然后再像你说的,用哪块取哪块。
您有没有一些具体该怎么做的信息。多谢了!
o****i
发帖数: 1706
2
【 以下文字转载自 Linux 讨论区 】
发信人: ouyadi (可乐会捂帮帮众), 信区: Linux
标 题: Valgrind报uninitialized value was created by a heap allocation
发信站: BBS 未名空间站 (Sat Feb 19 12:11:20 2011, 美东)
程序运行正常,可是在测memery leak的时候报上面那个错,具体错误消息如下:
==25663== Conditional jump or move depends on uninitialised value(s)
==25663== at 0x400C9F: add_edge (graph.c:59)
==25663== by 0x40071A: main (main.c:13)
==25663== Uninitialised value was created by a heap allocation
==25663== at 0x4A0515D: malloc (vg_replace_malloc.c:195)
==256... 阅读全帖
l********a
发帖数: 1154
3
来自主题: Computation版 - matlab一条curve如何plot出2个横坐标?
matlab的就多查mathworks网站
http://www.mathworks.com/help/techdoc/creating_plots/f1-11215.h
The XAxisLocation and YAxisLocation properties specify on which side of the
graph to place the x- and y-axes. You can create graphs with two different x
-axes and y-axes by superimposing two axes objects and using XAxisLocation
and YAxisLocation to position each axis on a different side of the graph.
This technique is useful to plot different sets of data with different
scaling in the same graph.
n******d
发帖数: 18
4
来自主题: Economics版 - 大家用什么软件画图呀?
Very very cool!!
Now the graph is so professional looking.
If you know latex, then it's not complicated at all.
In the preamble section, add \usepackage{psfrag}
then when you have to add a graph, (which is usually
in the format of eps, let the graph's name be picture.eps)
you just do the simple substitution before you use the
\includegraphics command
a very simple example:
suppose you have some "x"'s in your graph, and you want to
change all of them to "\bar_{x}_1" ( "x bar sub 1")
do the follow
a*****g
发帖数: 19398
5
来自主题: Education版 - IL 教师对 PARCC 发表的意见
IL 教师对 PARCC 发表的意见
【注:PARCC是基于Common Core的 Assessment】
Dear ICTM colleagues:
With the recent, extensive field test of PARCC test items now completed and
some sample items posted on the PARCC web site, teachers now have a better s
ense of the kinds of test items that PARCC will be asking. (Practice items
form the Grades 3-8 performance-based tests will be released in Fall 2014.)
I raise here one concern about plans for the performance (open response) ite
ms in the hope of generating some discuss... 阅读全帖
p******e
发帖数: 164
6
来自主题: Macromolecules版 - Origin作图一问
也许是这个?
vertical 2 panel graph
Data Requirements
Requires a selection of at least one Y column of values (or a range from at
least one column). Ideally, select two Y columns of values. If the Y
column(s) has an associated X column, then the X column supplies the X
values. Otherwise, the worksheet's default X values are used.
Creating the Graph
Select Plot:Panel:Vertical 2 Panel or click the Vertical 2 Panel button on
the 2D Graphs Extended toolbar.
Template
The vertical 2 panel graph is creat
c*******h
发帖数: 1096
7
来自主题: Mathematics版 - bib help
I am making a citation of Steinitz theorem saying that a graph G is
the edge graph of a polyhedron iff G is a simple planar graph which
is 3-connected, but I don't know where does theorem come from. I am
not a graph or combinatorics guy, and could anyone please point me
out a book that introduces this theorem? Thanks
t*****k
发帖数: 15
8
来自主题: Quant版 - 200刀一题目
谁会做,我PAY 200刀,有兴趣的留言,速度从快
[45 pts total] Consider a 1,000,000 CMBS pass-through (PT) security
consisting of fresh 15 year fixed rate loans that amortize over a period of
30 years, and have a WAC of 7% with fees amounting to 0.5%. All loans have
a prepayment lock-out for the entire term. Assume that the pool consists of
very many small, identical loans. The CMBS is sold at par under a zero CDR
assumption.
a. [10 pts] Assume there are no defaults. Compute the PT cash flows and
show that the ca... 阅读全帖
d****a
发帖数: 193
9
来自主题: Statistics版 - winbugs doodle
I made a graph for a model using winbugs doodle. The graph looked nice when
I
first created it. However, when I opened it the second time, it became very
very small.
I am a winbugs novice. Can someone help tell me how to zoom the graph to
make
it larger. Moreover, can some tell me how to export this graph, to use it in
MS
Word or LaTex? Many thanks.
m*******s
发帖数: 469
10
来自主题: Statistics版 - 【OPENING】Biostatistician with Novartis
I have a new position in Greensboro, NC. It’s for Novartis Animal Health
– a very stable company that is working on some interesting projects,
many in the area of vaccines. Ideally they would like to hire at the
Senior Biostatistician level and they are looking for a MS with 3 years
in industry or a PhD with 1. I thought I would circulate this around to
see if you knew anyone who might be interested in such a position –
please feel free to pass it along. Thank you so much! Here is the
official j... 阅读全帖
n***m
发帖数: 292
11
来自主题: Statistics版 - 怎么更改sas9.2的过期时间
把这个存为txt文档,然后sas 9.2 renew就可以了
这个到2012.2, 到时候应该有新的sid释放出来
[_SID_]
Version=9.2
Revision=9.2
Platform=Windows
Platform_long=Microsoft Windows Workstation 32-bit
Platform_short=win
Order=999HR5
Setnumid=10502896
SID_schema=2
ph_agreement=PROMPT
SID_header=SAS 9.2
[_Info_]
[_FileData_]
$_Filename=setinit.sss
$_Path=sas\core\sasinst\
$_Date=
$_Time=
$_Stream=——————– BEGIN ——————–
PROC SETINIT RELEASE='9.2';
SITEINFO NAME='CHUNGNAM NATIONAL UNIVERSITY'
SITE=10502896 OSNAME='W32_WKS' RECREATE WARN=30 G... 阅读全帖
I*****a
发帖数: 5425
12
来自主题: Statistics版 - 发面经 回报本版
【 以下文字转载自 JobHunting 讨论区 】
发信人: barbie6676 (barbie), 信区: JobHunting
标 题: 发面经 回报本版
关键字: 面经
发信站: BBS 未名空间站 (Sat Nov 16 11:49:17 2013, 美东)
背景:本科生物,统计master + 9个月工作经验
结果: offer: amazon, facebook, linkedin, google
Withdraw了ebay的onsite,别的好多电面都fail或者没有消息
电面:
Amazon两个:面得太早,具体想不起来了,code题不多。问怎么从某种格式的log file
里抓出想要的信息,简单的regular expression 和perl scripts, 问一些如果server
有问题怎么trouble shooting的开放问题。
Linkedin 两个:
1 binary tree level order traversal, leetcode原题
2 pow(x,2) leetcode原题
3 判断一个string表示的数字是否valid,类似l... 阅读全帖
n****n
发帖数: 11
13
来自主题: Statistics版 - 最近又被深深震撼了一次!!
换个角度设想一下,如果SAS不再高昂收费了,干脆免费了,这时在功能上再比较会
用哪个SAS or R?
除此之外,也简单搜了一下两个的比较。For more detailed comparison, please see
link below (a MIT slides 据说):
http://lgdata.s3-website-us-east-1.amazonaws.com/docs/148/98214
/comparison_presentation.pdf
1-If you want free software with a lot macro available, you could use R. It
is good with not so strong errors. If you want to develop some heavy
calculus and routines on large databases, so SAS is the best.
2-Another thing SAS does much better than R is data manipul... 阅读全帖
z*******n
发帖数: 1034
14
http://gamerboom.com/archives/83927
发布时间:2014-05-26 11:10:27 Tags:中国游戏市场,亚太游戏市场,日本平板市场
1)市场调研公司Newzoo最新报告预测,2014年亚太地区在全球增长的60亿美元的游戏
收益中将占比82%。
全球电子游戏行业(游戏邦注:这包括PC、在线PC、社交、手机和主机游戏领域)今年
收益增长8%,达到815亿美元。其中亚太地区所占市场份额从原来的42%增长至45%,预
计将达368亿美元。
拉美地区在全球市场份额中仅占比4%,预计今年将增长14%,达到33亿美元。北美则将
增长至222亿美元,占比27%。欧洲、中东、非洲三个地区(EMEA)收益为191亿美元,
占比24%。
pc dominate gaming(from pcworld.com)
pc dominate gaming(from pcworld.com)
从整体来看,电脑屏幕仍是人们在2014的首要游戏平台,在全球市场中占比40%,比一
年前增长9%。电视屏幕所占份额为29%,收益为234亿美元,比去年下降1个百分点。手
持掌上设备在20... 阅读全帖
a*******6
发帖数: 520
15
很多领域现在确实很难做一个明确的区分,比方说图论,很早很早就有graph theory了
,现在搞图论算法的人称自己搞的是graph algorithms,其实解决的就是图论问题,其
中复杂度理论又让一些图论里的问题有了难易的区分,graph minors里的一些很艰深的
结果也是搞CS理论算法的人搞出来的,当然这些人称为数学家也不为过。。。扯远了。
。。
s***h
发帖数: 487
16
当然对 graph 而不是 tree,subproblem 之间其实有 overlap,但这个 overlap 属于
trivial,用个 visited mark 先到先占位就是了。


: Recursive-function-call based graph traversal 跟 stack based graph
traversal

: 在算法概念模型上有不少差别我想。

: Recursive function call 是基于 non-overlapping subproblem 的编程概念。
所谓

: Preorder / inorder / postorder 就是 traverse non-overlapping
subproblem 的

: order。这个数学美,但有局限。

: Stack 在编程概念上并不小矮挫,stack 的学名叫 LIFO ,对应的其他还有
FIFO,以

: 及更通用的 priority-queue (heap)。

: ,再说

: 管理而

s***h
发帖数: 487
17
当然 recursive function call 也能实现 overlapping subproblem,如果加参数加
marker 能转变成 non-overlapping subprogram


: stack-based graph traversal, 在算法模型上,属于 constructive algorithm。

: 如果把 graph 看成 solution space,也就是 construction based on graph
nodes

: adjacency。这个本质上没有 Subproblem 的概念,但可以用来实现各种不同的

: subproblem 模型,包括 overlapped subprogram ...

: overlap 属于

l****z
发帖数: 29846
18
来自主题: USANews版 - House Prices in Free Fall
By Howard Richman, Raymond Richman, and Jesse Richman
The latest house price data (the S&P Case-Shiller index) shows a clear
downward trend for the most recent six months, as shown in the graph below:
The next graph shows how this year's data fits in with the long-term trend.
It is clear that the house price bubble, which began in 1997 and peaked in
2006, has not yet finished popping:
How We Got Here
The black stars in the above graph highlight 1951 and 1997, the two years
when Congress changed ... 阅读全帖
m****o
发帖数: 182
19
来自主题: JobHunting版 - Amazon电面经
1. java garbage collector
A: reference counts.
Q: circular reference. Any better solution?
A: treat each object like the nodes in the graph. and find separated
subgraph.
Q: How to determine which subgraph is "live", which is “dead”?
A: Use the objects stored in the current stack as the starting point in the
graph.
2. many many documents with unique ids, find duplicate documents.
A: Use hash table. If allowed, use multiple machines to do hashing
Q: Any other solutions?
A: Use prefix tree (word as... 阅读全帖
m*****0
发帖数: 55
20
来自主题: JobHunting版 - 问个g的面试题
就是说有个graph,他的MST已知,记为T。
现在准备新加入一个vertex,记为v。v和原来的graph有一些edges。所以现在可以组成
一个新的graph, 记为G*. G*的vertex就是原来的在G里面的+v。
现在在O(|V|log|V|)时间内求出G*的MST, 记为T*.
求解答~
d********w
发帖数: 363
21
来自主题: JobHunting版 - [salesforce面经]performance engineer
职位:performance engineer
1) 3-tier web application, analyze possible bottleneck
2) calculate power(int x, int y)
3) sorted array,find intersection,
4) jvm heap management, gc mechanism, block, c++/java difference
5) merge sorted array, how to optimize in large scale.
6) given a client and server, server transfer a large data file e.g. (10M)
, traffic is full in network, how to improve the performance. i.e. response
time reduce to half of original version.
7) Wordcount how to improve performance,... 阅读全帖
f****0
发帖数: 151
22
来自主题: JobHunting版 - 一道关于电话pad的面试题
从1开始我算出来是1047条。。2开始886条。。5开始665条。。
你是把哪些当作重复了
这是我的code:
void print(int* set, int size) {
for (int i = 0; i < size && set[i] > 0; i++)
cout << set[i];
cout << endl;
}
int PadPathNum(int** graph, int num, int first) {
static int path_num = 0;
static int visit[9] = {0};
static int set[9] = {0};
static int index = 0;
visit[first] = 1;
set[index++] = first + 1;
print(set, num);
path_num++;
for (int i = 0; i < num; i++)
if (graph[first][i] == 1 && visit[i] == 0)
Pad... 阅读全帖
b*******d
发帖数: 750
23
来自主题: JobHunting版 - 面试是fail掉一轮就全fail掉么?
是个start up,不说名字了,不太好。
题目并不是太难。服务器端接受用户的刷卡服务。
customer1 使用了card1 make了一个purchase
customer2 使用了card2 make了一个purchase
customer3 使用了card1 make了一个purchase
customer1 使用了card2 make了一个purchase
。。。
这是个graph,里面有customer node和card node,上边的客户1 2 3 都是related
customer (connected in the graph)。
设计一个类,query customer id,返回所有related customer;添加一个新的
purchase (就是一个新的customer+card pair),能很快的将其index了。
我的做法是:所有connected 的customer构成一个cluster,created一个cluster id,
Map> M1 表达 (clusterId,customers)。
... 阅读全帖
w****x
发帖数: 2483
24
1 function Dijkstra(Graph, source):
2 for each vertex v in Graph:
3 dist[v] := infinity ;
4
5 previous[v] := undefined ;
6
7
8 dist[source] := 0 ;
9 Q := the set of all nodes in Graph ; ... 阅读全帖
S**I
发帖数: 15689
25
来自主题: JobHunting版 - [合集] 一道关于电话pad的面试题
☆─────────────────────────────────────☆
pore (坚持不懈) 于 (Tue May 15 00:11:28 2012, 美东) 提到:
利用电话按键1-9产生password,必须swipe产生password,跟android很像,密码没有
重复的数字。
比如
1 2 3
4 5 6
7 8 9
可以从1出发到5,到9,到6, 到3, 产生密码15963.
但是不可以从1直接到9,因为1跟9不相连。
也不可以是1421,因为任何数字在一个密码中只能用一次。
问题是:用这种方法一共可以产生多少个passwords?
如果是nxn square,能够有多少个swipable的按键组合?
☆─────────────────────────────────────☆
tradertobe (builder) 于 (Tue May 15 00:24:00 2012, 美东) 提到:
Look like DFS.
☆─────────────────────────────────────☆
realife (leda) 于 ... 阅读全帖
T******n
发帖数: 11
26
来自主题: JobHunting版 - 请教一个题Common Ancestor(不是tree)
Implement a function that will find the most recent common ancestor of any
two commits from a given commit graph. The commit graph is represented as a
String[] called commits containing all commit IDs in sorted date order (most
recent first) and a String[][] called parents. The parent IDs for the
commit ID at index i can be found at parents[i]. The last item in the
parents array is always null since this represents the parent of the root
commit. For example, the following commit graph:
... 阅读全帖
f*********m
发帖数: 726
27
来自主题: JobHunting版 - F家一题
考古发现一大牛贴了这个题目:
找最大的1的cluster size,比如:
00111
01001
00000
11101
这里最大的1的cluster size是5,就是前两行那些1的个数,
两个cell可以组成cluster if
1。两个cell都是1
2。两个cell相邻,对角也算
大牛说用bfs,用数组模拟栈,O(n) n是矩阵大小。我不理解。
是不是说先pre-processing原矩阵,对每一个元素标出和其连接的元素,这样每个元素
都在一个graph中,然后以每一个元素为出发点,用bfs或者dfs遍历其所在的graph同时
记录此graph包含元素个数?
请指教。
h**********y
发帖数: 1293
28
来自主题: JobHunting版 - 一道很难很难的题目
tripartite graph,
三个组每个组有8,9,11个节点
求所有可能的联通graph数目(,满足从任何一个点可以到达任何另外一个点。由于是
tripartitie graph,就像bipartite一样,组内点不能直接连)
1,1,2可以自己画出来。。
s******y
发帖数: 72
29
来自主题: JobHunting版 - LinkedIn 面经
两轮店面 + Onsite, onsite面了8个人,四个人问coding,两个人问design,一个人问
project,还有一个senior manager问behavior。 题目都不难,自我感觉答得也还行,
但是还是悲剧了,anyway, move on了。 发一下记得的题目,
电面:
1. 给一个二叉树,返回它的镜像
实现一个 thread-safe blocking queue
2. 一个嵌套Map, 就是一个HashMap, 它的value可以是一个element也可以是另外一个
嵌套map或是空的map. 实现一个iterator来遍历这个map里面的所有element。 就是类
似树遍历一样的方法
Onsite:
第一个: 给两个单词, 比如head, tail: 找到一个最短的转换,从head到tail,每
次只能变一个字母,path上的word都必须是有效的英文单词,我用的Graph shortest
path
第二个: memcpy: 源区域和目标区域可能有重叠
BST 插入和删除操作实现
BST iterator 实现
3: 实现两... 阅读全帖
f*********m
发帖数: 726
30
来自主题: JobHunting版 - LinkedIn 面经
那位大俠能給個下面两题的解法?
2. 一个嵌套Map, 就是一个HashMap, 它的value可以是一个element也可以是另外一个
嵌套map或是空的map. 实现一个iterator来遍历这个map里面的所有element。 就是类
似树遍历一样的方法
我的想法:
(1)HashMap里装的value type是一个class,这个class的member包括elementhe 和map。
(2)HashMap里装的value type是一个指针,这个指针的类型可以是elementhe 或map
。不过不太确定如何转化指针类型。
4: Given a social graph, find if there is a path between two persons with at
most 2 steps (3rd level connection), how to handle it in distributed way (
large graph stored at a large number of nodes, minimize cross-communication)... 阅读全帖
s******y
发帖数: 72
31
来自主题: JobHunting版 - LinkedIn 面经
两轮店面 + Onsite, onsite面了8个人,四个人问coding,两个人问design,一个人问
project,还有一个senior manager问behavior。 题目都不难,自我感觉答得也还行,
但是还是悲剧了,anyway, move on了。 发一下记得的题目,
电面:
1. 给一个二叉树,返回它的镜像
实现一个 thread-safe blocking queue
2. 一个嵌套Map, 就是一个HashMap, 它的value可以是一个element也可以是另外一个
嵌套map或是空的map. 实现一个iterator来遍历这个map里面的所有element。 就是类
似树遍历一样的方法
Onsite:
第一个: 给两个单词, 比如head, tail: 找到一个最短的转换,从head到tail,每
次只能变一个字母,path上的word都必须是有效的英文单词,我用的Graph shortest
path
第二个: memcpy: 源区域和目标区域可能有重叠
BST 插入和删除操作实现
BST iterator 实现
3: 实现两... 阅读全帖
f*********m
发帖数: 726
32
来自主题: JobHunting版 - LinkedIn 面经
那位大俠能給個下面两题的解法?
2. 一个嵌套Map, 就是一个HashMap, 它的value可以是一个element也可以是另外一个
嵌套map或是空的map. 实现一个iterator来遍历这个map里面的所有element。 就是类
似树遍历一样的方法
我的想法:
(1)HashMap里装的value type是一个class,这个class的member包括elementhe 和map。
(2)HashMap里装的value type是一个指针,这个指针的类型可以是elementhe 或map
。不过不太确定如何转化指针类型。
4: Given a social graph, find if there is a path between two persons with at
most 2 steps (3rd level connection), how to handle it in distributed way (
large graph stored at a large number of nodes, minimize cross-communication)... 阅读全帖
k******a
发帖数: 44
33
来自主题: JobHunting版 - LinkedIn 面经
我的思路:
Onsite:
第一个: 给两个单词, 比如head, tail: 找到一个最短的转换,从head到tail,每
次只能变一个字母,path上的word都必须是有效的英文单词,我用的Graph shortest
path
这个题是word ladder I吧
第二个: memcpy: 源区域和目标区域可能有重叠
BST 插入和删除操作实现
BST iterator 实现
这个是基本数据结构题,BST删除麻烦些,iterator用transverse的中序思路写吧。
3: 实现两个函数: H() and O(), 这两个函数会被多线程调用。当一个线程调用H或O时
,如果当前已经有至少两个线程call H和一个线程call O。那么让两个call H和一个
call O的线程返回(产生一个水分子),其他的都block。
这个大家讨论过了。我感觉用信号量之类的东东?
4: Given a social graph, find if there is a path between two persons with at
most 2 steps (3rd leve... 阅读全帖
k******a
发帖数: 44
34
来自主题: JobHunting版 - LinkedIn 面经
我的思路:
Onsite:
第一个: 给两个单词, 比如head, tail: 找到一个最短的转换,从head到tail,每
次只能变一个字母,path上的word都必须是有效的英文单词,我用的Graph shortest
path
这个题是word ladder I吧
第二个: memcpy: 源区域和目标区域可能有重叠
BST 插入和删除操作实现
BST iterator 实现
这个是基本数据结构题,BST删除麻烦些,iterator用transverse的中序思路写吧。
3: 实现两个函数: H() and O(), 这两个函数会被多线程调用。当一个线程调用H或O时
,如果当前已经有至少两个线程call H和一个线程call O。那么让两个call H和一个
call O的线程返回(产生一个水分子),其他的都block。
这个大家讨论过了。我感觉用信号量之类的东东?
4: Given a social graph, find if there is a path between two persons with at
most 2 steps (3rd leve... 阅读全帖
z****p
发帖数: 18
35
I guess this problem is not about algorithm. It asks for the number of min
swaps. It's more like a math problem. As long as we give N-K, our job is
done, and we don't have to implement any algorithm.
Think this problem in another way:
-There is a large graph, where each node is a permutation of the given list
of data; there is an edge points from node i to node j if we can move from
permutation-i to permutation-j by using one "swap".
-Now the question is I pick two nodes i and k in the graph, wh... 阅读全帖
f*******r
发帖数: 1086
36
来自主题: JobHunting版 - Google电面面经并求Bless
第二题应该就是topological sorting
首先将所有不同的字母找出来,作为directed graph的node,
然后给出的字符串代表了graph中的directed edge,比如fcp,说明有f-->c, c-->p两个
edges。这样就建立了一个directed graph
然后就可以做标准的topological sorting,得到的结果就是字母的顺序。
f*****r
发帖数: 41
37
来自主题: JobHunting版 - facebook面试准备及内推
提供内推,社招校招皆可,天朝美帝皆可,如有兴趣,请发简历到f*****[email protected]
如果需要,本人可以提供一次mock interview。
关于面试流程
社招的话
电面1-2轮,一般就是coding
onsite一般是4轮,2轮coding,1轮design,1轮behavior+coding
校招的话,那轮design也变成coding了
关于准备
1) algo/coding
建议大家刷一下leetcode,基本上cover到了大多数常见面试题,而且有可能碰到原题
。需要注意的是,仅仅解出来可能是不够的。代码的质量和速度也非常重要。网上有一
些别人给出的答案可以参考,尽量做到代码简洁清晰。速度上leetcode上所有题都做到
10分钟以内写完。
2) design
解这种题是个*交流*的过程,或者说是给出方案然后获取反馈的不断循环的过程。一般
的流程:首先你要问清楚requirement;然后可以讲一下high level architecture,就
是分成哪几个component,互相之间如果interact,在白板上画一画;之后面试官可能
会让你深入某个compon... 阅读全帖
c**z
发帖数: 669
38
来自主题: JobHunting版 - 请教如何实现图的数据结构C++
请问graph是不是大概这样用adjacent matrix 这样实现的。多谢了
class graph
{
public:
vector getAllnodes()
vector getadjacentnodes( node* start)
{
//parse the adjacentmatrix and return the adjacent nodes
}
private:
vector arrnodes;
vector> adjacentMatrix;
}
class node
{
bool bvisited;
int nodenumber;
}
void bfs(graph g, node* start, node* end)
{
auto arrNodes = g.getadjacentnodes(start) // 这样的到相领的点?
}
I**********n
发帖数: 77
39
来自主题: JobHunting版 - 请教如何实现图的数据结构C++
-------
美国CS面试工作交流群QQ: 167615205
--------
看下面的code
#include
#include
#include
#include
using namespace std;
struct vertex{
typedef pair ve;
vector adj; //cost of edge, destination vertex
string name;
vertex(string s)
{
name=s;
}
};
class graph
... 阅读全帖
b******i
发帖数: 914
40
来自主题: JobHunting版 - 问一道FLAG经典题
Hi,
你好,贴一下你的code。有几个问题:
1. Graph g(26)是什么,这个Graph的类是哪儿来的?
2. 中间
for(auto i = 0; i < len; ++i) {
if(w1[i] < w2[i]) {
g.add_edge(w1[i] - 'a', w2[i] - 'a');
} else if(w1[i] > w2[i]) {
g.add_edge(w2[i] - 'a', w1[i] - 'a');
}
}
我觉得有问题,首先并不知道w1[i]和w2[i]哪个大啊,只知道w1 从小到大来排序的)。所以我觉得正缺的应该是:
for(auto i = 0; i < len; ++i) {
if(w1[i] != w2[i])
g.add_edge(w1[i]-'a', w2[i]-'a');
}
最后再... 阅读全帖
j**********0
发帖数: 20
41
来自主题: JobHunting版 - G家面经(已挂)
Myself:
Definitely middle-aged.I am now over 40. I graduated long time ago. I am not
very successful in my career. My spoken English is BAD. I came from Canada
to Bay Area six months ago with TN visa. I received a call from recruiter 2
months ago, and started to prepare for interview. Had phone interview one
month ago, and had onsite interview recently.
Interview process
华人小弟电面, 问题很简单。稀疏矩阵 相加。多谢这为小弟:)
after this, I asked to schedule onsite interview one month later so I could
have time to prepar... 阅读全帖
e***i
发帖数: 231
42
results from google search give some hints "linkedin social graph
architecture"
Might be helpful
https://engineering.linkedin.com/real-time-distributed-graph/using-set-cover
-algorithm-optimize-query-latency-large-scale-distributed
http://blog.karmona.com/index.php/2008/12/30/the-social-graph-c
http://hurvitz.org/blog/2008/06/linkedin-architecture
E******t
发帖数: 28
43
来自主题: JobHunting版 - 狗家的OA题目一道, 求讨论
是不是要先看 K> (N-1)是否成立?如果不成立就没有解。
另外是不是dfs 或者bfs都可以?
再者,题目没有说acyclic graph, 剩下的 K-N+1 条线是不是还要随机加回图上去?这
样一下又复杂一层, 总共变成
C(N, (N-1) )*C(K, (N-1))*C(N, (K-N+1))?
即:acyclic graph排法 乘以 这些acyclic graph线段取法 乘以 剩下线段加在图上的
方法数?这里假设了 K<= 2*N。。。
是不是想复杂了?
o*q
发帖数: 630
44
来自主题: JobHunting版 - G家leetcode题
Google
Show problem tags Hide locked problems
#
Title
Acceptance
Difficulty
Frequency
66 Plus One 35.4% Easy
146 LRU Cache 15.8% Hard
200 Number of Islands 29.7% Medium
288 Unique Word Abbreviation 15.7% Easy
163 Missing Ranges 30.3% Medium
56 Merge Intervals 26.7% Hard
228 Summary Ranges 26.0% Medium
308 Range Sum Query 2D - Mutable 20.8% Hard
279 Perfect Squares 34.1% Medium
388 L... 阅读全帖
o*q
发帖数: 630
45
来自主题: JobHunting版 - 请教leetcode高频题是哪些题
# Title Editorial Acceptance Difficulty Frequency
1
Two Sum 28.3% Easy
292
Nim Game 54.4% Easy
344
Reverse String 57.3% Easy
136
Single Number 52.2% Easy
2
Add Two Numbers 25.6% Medium
371
Sum of Two Integers 51.6% Easy
4
Median of Two Sorted Arrays
20.4% Hard
6
ZigZag Conversion 25.6% Easy
13
Roman to Integer 42.7% Easy
237
... 阅读全帖
a*********w
发帖数: 169
46
互联网公司招聘大数据工程师 - 工作地点杭州和湾区
互联网公司新组建的大数据团队招聘数据和人工智能方向的岗位。
公司网址:www.PingPongX.com
公司性质:互联网支付,金融科技,电商服务,大数据
公司情况:2015年创立,C轮 venture backed by Fidelity等多家顶级的风险投资机构
,目前200人的团队,公司员工分布在杭州,深圳,旧金山,卢森堡,香港和东京
岗位名称:数据分析师,数据工程师,数据科学家各若干人
工作地点:杭州和旧金山,最好是杭州
联系方式:站内投条并简单介绍个人情况,或者联系email [email protected]
公司简介:
An innovative payment service provider for cross-border eCommerce sellers.
Our mission is to empower our customers to sell anywhere in the world. We
are committed to bring best-of-class services to ou... 阅读全帖
B******1
发帖数: 9094
47
来自主题: Parenting版 - Support Asian American students!!!
Did the numbers of White, Black, and Hispanic (especially) rise every year??
Why did not the graph show the numbers of the other ethnic groups together
with the Asian youth? Draw those lines, and you will see different things.
Another way to draw the graph may be to draw the percentage of donations
made to Ivy schools by each ethinic group.
Numbers and percentages is the key concept in flaws in logical thinking.
Another way to see the flaw in the reasoning: according to the graph, if the
Asian p... 阅读全帖
B******1
发帖数: 9094
48
来自主题: Parenting版 - Support Asian American students!!!
Then Harvard did not discriminate against Mr. Li, according to your logic.
Why did you still list Harvard as one of the "discriminating" schools?
Second, is it normal that one applicant may be rejected by one school when
he or she is admitted by another school?
Did the numbers of White, Black, and Hispanic (especially) rise every year??
Why didn't the graph show the numbers of the other ethnic groups together
with the Asian youth? Draw those lines, and you will see different things.
Another way... 阅读全帖
t*******r
发帖数: 22634
49
这个不会导致重染,而是证明过程把你的这道题目直接给证伪了。看我
上面给的反例。
实际上你给再多的颜色都没用,因为如果你给 n 种颜色,我可以用 N+1
个点,构造一个全部由 2-point edge 构成的 complete graph,这个
graph 只能用 N+1 中颜色着色(因为是 complete graph)。
t*******r
发帖数: 22634
50
我觉得我还是把特殊情况想复杂了,并且还有遗漏。。。
其实特殊情况就是那些所有 edge 都连到 v1 上的 vertex,保证它们
的 edge 不着成一色。。。这里有个限制条件就是 complete graph。。。
--------------------------------------------
重写一下解法:
(1)首先找任意一个 vertex v1,满足条件 v1 至少有两个或两个
以上 degree > 1 的 edge。
(2)找到那些所有 edge 都连到 v1 上的 vertex:
(2.1)如果出现一个这样的特殊 vertex,那个把那个 vertex 的
第一个 edge 着色成 0, 其他 edge 着色成 1。
(2.2)如果出现两个以上的这样的特殊 vertex,那么如果出现 edge
有交集,那把交集的第一个 edge 着色成 0,其他的 edge 着色
成 1。如果 edge 没有交集,那两个 vertex 里,各自选一个着色
成 0,其余的着色成 1。
(2.3)第三个以上 vertex 话,要么有至少一个目前是独立的(未着色的)
edge,着色... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)