由买买提看人间百态

topics

全部话题 - 话题: pseudocode
首页 上页 1 2 (共2页)
l*******r
发帖数: 322
1
来自主题: BrainTeaser版 - 提问
哦,发现我原来的两个解法就分别对应动态规划里面的top-down和bottom-up方法
不过我没有想到这就是动态规划
嗯,我的答案都太底层了,接近pseudocode了
应该上来就跟面试官说dynamic programming
没准他手一摆就换下一道题了
嘿嘿
H***r
发帖数: 3303
2
man, stop thinking in this way!!!
let me give you a piece of pseudocode:
if you can do something, do it!
if not, stop bothering!

to
I
z******n
发帖数: 8851
3
You are right, sir! I will implement your pseudocode.
T******y
发帖数: 128
4
strings oracle.exe | grep radiohead
Starting at least at 10.2.0.1, function kfasSelfTest_update() (located
in kfas.o) use Radiohead lyrics to test... something related to ASM
probably.
Schematic pseudocode:
#define STRING "I'm a creep, I'm a winner, what the hell am I doing
here.I don't belong here - radiohead"
kfasSelfTest_update()
{
kfasOpen (...);
somestruct.somevalue=STRING;
kfasUpdate (somestruct);
kfasClose (...);
newstruct=kfasOpen (...);
if (strn
z*****n
发帖数: 7639
5
那你说考啥吧?
我同意可以不用考对某种语言的熟悉程度,(其实很多公司招人就是要直接用的,
需要的就是对某语言熟悉)但是pseudocode可以不?
x****o
发帖数: 21566
6
来自主题: Joke版 - 烂笑话 -- 爱的真谛
可以是pseudocode,上课嘛
y****r
发帖数: 17
7
来自主题: CS版 - 做题作题
今天面试给了一道数据结构题,哥们用个二叉树摆弄半天最后还是载了。
谁给说说咋整的
implement a data structure that stores non-overlaping line segments of the
form ((x1,0)(x2,1))(that is, the bottom vertex has y-coordinate 0, and the
top vertex has y-coordinate 1.)
Describe (in pseudocode) a data structure that:
A: when a new line segment is inserted, checks in O(log n) time (where n is
the number of line segments in the data structure) if the new line segment
intersects any of the original ones, and inserts it in the data structure in
O
w*******w
发帖数: 18
8
来自主题: CS版 - 如何在latex下写pseudocode?
如果用\begin{verbatim},遇到要写大于,小于符号怎么办,还有缩进问题?或有其他什么
更好的方法?谢谢!
f****i
发帖数: 98
9
来自主题: CS版 - 如何在latex下写pseudocode?
Use algorithmic, you can google algorithmic.sty
m******y
发帖数: 25
10
来自主题: CS版 - 如何在latex下写pseudocode?
Use alltt and \ensuremath when you want to include math symbols, e.g.,
\begin{alltt}
\textbf{boolean} func(\textbf{Constraint} C1, \textbf{Constraint} C2) \{
\textbf{return} checkValidity(\ensuremath{\tau});
\}
\end{alltt}
r*****y
发帖数: 507
11
来自主题: CS版 - 如何在latex下写pseudocode?
I use "algorithm" package. it works well.
f*********i
发帖数: 197
12
来自主题: CS版 - 几道算法题求教
小弟在准备qualify考试,看到算法例卷上有三题,百思不得其解,希望高人能给一
点帮助。
1.You are given n items with weighs w[1..n] with w[1] to group the items into m groups (1<=m<=n) non-empty and disjoint classes C1
,C2....Cm, and assign each item in Cj a weight-label Lj, 1<=j<=m, such that
EE(w[i]-Lj)^2 is minimun (汗,连加号打不出来,只好用E代替,1<=j<=m, w[i]
are the elements in each group j)
1)Give a pseudocode of an efficient algorithm to determine the Cj and the
label Lj, take w=[2,3,5,6,7,8,9,10], m=2 show L1,L2 a
z*****n
发帖数: 7639
x******i
发帖数: 172
14
Given an AVL tree (using pseudocode) how to support the following queries:
RangeMin (k1, k2): consider the field data stored in each node to be an
integer. Find the key with minimum data values among all the keys which are
between k1 and k2 in O(log n) times. (Hint: Consider storing an additional
field in the Node structure and show how can this field be maintained during
updates).
Thank you very much.
l*******c
发帖数: 478
15
上次来这个版,得到很多朋友的热心指点,大家大概不记得我这个外行了。我终于开始
学编程拉!
我这学期开始学第一门课:PROGRAMMING LOGIC。用PSEUDOCODE 和 FLOWCHART编程,相
应的学习例子会给出对应的JAVA,C++,PYTHON和VISUAL BASIC 的程序。
真是太有趣了!太有技术含量了!我每天上别的课也会想到它,玩也会想到,睡觉也会
想到。有时候会半夜睡不着,哎,简直有点神经衰弱了。可是可是,我当了那么多年学
生,从没对哪门课达到过入迷的程度,也许,这就是上帝给我的,适合我的那一个。
不过,这些不是我今天再次来请教的重点,我想问的是,如今流行的那个OOP,在我们
教科书的最后一章,老师都不会讲也不考的,我自己看了看开头,怎么没看懂啊?觉得
,一个简单的例子好像在用复杂的方法解决题似的,我知道这一定是因为我没懂。怎么
办?
我的目标是接下来学完C++,JAVA,SQL和其它几门课程(数据管理什么的)以后,做个
DATA ANALYST,希望以后有机会能去做BI。请问,做初级DATA ANALYST的话,需要OOP
吗?
(心里偷懒地想,不要阿。。。... 阅读全帖
p*u
发帖数: 2454
16
来自主题: Programming版 - thread safe or not???
Please take a look at following Pseudocode. I don't think
it's thread-safe. any ideas how to make it thread-safe?
class A
{
public:
A() : ptr(NULL) { };

void startup(B b, int i)
{
static C c(i);
ptr = &c;
b.dostuff(ptr);
}
private:
const C * ptr;
};
class B
{
public:
B() { };

/*
* value that c points to is NOT copied,
* so it needs to stay valid during
* muliple invocations of dostuff
t**********s
发帖数: 930
17
来自主题: Programming版 - 用pseudo-code 写数据结构问题。
pseudo-code太抽象了,我更喜欢编实际的程序。
比如这个问题请高手帮帮忙,我怎么一碰到pseudo-code就糊涂,况且还要分析其时间
和空间复杂度:
Write a procedure (in pseudocode!) to increase the number of buckets in a (
closed) hash table. Analyze its time and space complexity.
c***d
发帖数: 996
18
来自主题: Programming版 - [合集] thread safe or not???
☆─────────────────────────────────────☆
pxu (Lingua Franca) 于 (Wed Sep 20 16:23:26 2006) 提到:
Please take a look at following Pseudocode. I don't think
it's thread-safe. any ideas how to make it thread-safe?
class A
{
public:
A() : ptr(NULL) { };

void startup(B b, int i)
{
static C c(i);
ptr = &c;
b.dostuff(ptr);
}
private:
const C * ptr;
};
class B
{
public:
B() { };

/*
* value th
k*******d
发帖数: 1340
19
来自主题: Programming版 - 现在招工什么标准阿?
My major is not CS and I have not touched this algo for several years. The
basic idea is that it is a greedy algorithm. Every step you try to find a
local optimum and there is a proof saying that doing this leads to global
optimum. Every step you include a unvisited node that is closest to the
visited node set.
It is not as difficult as you thought. Read the pseudocode and the
examples on wiki slowly in more detail.
v****s
发帖数: 1112
20
来自主题: Programming版 - 多线程优化求助! (转载)
thanks good bug..
我试了一下你贴的这个pseudocode,觉得我思路转不过弯来。。。这2个class怎么你中
有我我中有你?
如果我现在有另一个class 叫做 RunAllJobs, 里面包含一个main() entry, 然后怎么
弄?谢谢。。。。
W***o
发帖数: 6519
21
来自主题: Programming版 - 哈,居然写完了作业
觉得这学期上的advanced OS很有挑战性,对于我这转行读CS的,没有C,没有OS背景的
,上来就修AOS,开始还是挺头疼的,本来抱定学学看再决定是否withdraw的
今天算是完成了第二个编程project, 就是实现了MCS paper里几个 synchronization
barrier算法的;其实如果对C熟悉的话,就是把算法pseudocode翻译一遍的过程。我从
动态二位数组,calloc/malloc, 到Open MP, Open MPI统统要自学一遍。花了几天时间
算入门了,可是在写的时候,这个synchronization 算法很容易就 deadlock 一动也不
动,急死个人,头上冒汗。 上周花了几个晚上终于整明白asynchronous和synchronous
communication了。
现在看来好像不需要withdraw了,C的一些基本的东西,比如指针,内存,还有掌握了
MP, MPI的皮毛,就这么一路往下走吧,每学期修两门,没准明年这时候我就能开始投
简历了,前途是光明的 --- 自己鼓励一下,大牛见笑。
l**********n
发帖数: 8443
22
学一种语言就可以了,pseudocode
b******n
发帖数: 107
23
来自主题: TeX版 - Question on typesetting pseudocode
Sorry that I'm not able to type Chinese now.
I'm using package 'algorithm2e' to write pesudocodes in my tex file. There
is one piece of code which is a little long, and the system automatically
relocates it to a new page following the current page.
Is there anyway I can force it to be displayed right in the place of
insertion? I've tried adding [!TH] after \begin{algorithm}, but it doesn't
work. :(
Thanks in advance for any suggestion!
o*******r
发帖数: 51
24
来自主题: TeX版 - Question on typesetting pseudocode
Maybe, you can try[!h]
b******n
发帖数: 107
25
来自主题: TeX版 - Question on typesetting pseudocode
多谢!我尽快去试一下~
S**********l
发帖数: 3835
26
来自主题: Biology版 - 开始找博后,求建议 (转载)
不是的。是真的不会写。。。如果我给他说一遍pseudocode,再去写,就能写出来,不说,就好几天憋不出来,或者写出来一个效率很低的。
有的时候需要我告诉他这个循环要这么写能快10倍。
m****g
发帖数: 118
27
来自主题: Computation版 - 请教一个C++编程问题
I need some help with a small C++ project since I do not have background in
programming functions such as “Logger”. Any help would be really
appreciated. If you would point me to some tutorial of similar programming
problem will be great!
Problem Description:
You must provide a simple logging framework in C++ that conforms to the
following pseudocode interface:
pLogger
{
LogInfo( message )
LogWarning( message )
LogError( message )
}
Example of code using this logger would b... 阅读全帖
x******i
发帖数: 172
28
Given and AVL tree show (using pseudocode) how to support the following
queries:
RangeMin(K1, K2): consider the field data stored in each node to be an
interger. Find the key with minimum data values among all the keys which are
between k1 and k2 in O(log n) time. Hint: consider storing an additional
field in the Node structure and show how can this field be maintained during
updates.
Thank you very much
z*****n
发帖数: 7639
29
写个pseudocode实现一下吧,怎么样弄出个
rand8(x,y)。
这样的数学表达式解决了啥问题?

1
s*********l
发帖数: 103
30
来自主题: Quant版 - 问一道编程题

Well, the short answer is "use bitmap" and the OP can learn more by himself
starting from the hints I gave, either google or read the book I suggested.
If it is still not clear, hope the following pseudocode helps:
allocate 2MB memory filled by all 0's;
scan the list of phone numbers;
/*
treat the 2M memory block as a very long bit vector;
for i in numbers{ //assert(i<=9999999);
set the i-th bit of this bit vector to 1;
}
*/
scan the allocated memory bit by bit;
/* if the i-th bi
E*******1
发帖数: 3464
31
来自主题: Quant版 - GS 的 strat 面试
My experience is that the interview in GS focus more on brain teaser,
pricing and stochastic maths instead of programming. Their coding problems
are way easier than hedge funds or trading companies, and in many cases just
providing some pseudocode or talking about what is OO what is virtual
function blabla... and the interviewers are sometimes not good at
programming themselves, once a guy interviewing me even not know clearly
what is pass by reference in C++ ... I think GS does not use any comm... 阅读全帖
D******n
发帖数: 2836
32
你可能没搞清楚function,algorithm这些东西。
一个问题,你编程解决就是algorithm,譬如上面那个matrix问题。algorithm是解决问
题的方法和步骤,什么语言都可以,甚至pseudocode也行。用function不等于就不是de
velop algorithm。当然你个整个algorithm只有一个R的function,那就不行。
用R写function很简单,
yourfunction<-function(x)
{ 。。。
。。。
}
首页 上页 1 2 (共2页)