Looking for programmers...

B

badasspirate

Hey all,
I am looking for some programmers with sufficient qualifications who
would like to join a freelancing programming group, either as a quick
way to make money, or something to do on the side. Anyway, I am really
optimistic about the possibilities that could arise from forming a
programming group (friends, MONEY, etc) and would like to get it
started. If you are interested, just solve this (intermediate skill)
programming problem and send me an email at (e-mail address removed) with
the subject "Wallys Traversal's".
------------------------------------------------------------------------------------
Problem Statement: Given a rooted, binary tree T, write a program that
prompts the user to enter the preorder traversal of T and the inorder
traversal of T. The program should then output the postorder traversal
of T.

You may assume that each node is represented by a character. So a
traversal (whether preorder, postorder, or inorder), is expressed as a
string.

Suppose Wally walks the tree:

a
/ \
/ \
b c
/ \ \
/ \ \
d e f
/
/
g

Here is an example of how the program should work:

Enter preorder traversal of T: abdecfg [Press Enter]
Enter inorder traversal of T: dbeacgf [Press Enter]
Given the preorder traversal abdecfg and the inorder traversal dbeacgf,
I
conclude that the postorder traversal order of T is: debgfca

Your program does not have to provide any error-checking.
------------------------------------------------------------------------------------
The only reason I am including this is to keep away newbies from
joining the group. Just send me the compiled (or source code) .class
(or .java) files in an email if you are interested.
Sincerely,
Eric
 
O

Oliver Wong

Stefan Ram said:
Nice try. Still I will not do your homework.

The OP seems to accept compiled .class files. Perhaps if you run your
code through an obfuscator first, you can prevent the OP from plagiarising
your work, while still submitting an solution.

The problem statement is identical to the competition at
http://cs.hood.edu/pobw/POWDec052003.html (where you could have won a $20
gift certificates to Papa John's pizza), but the contest requires source
code, and the deadline was 2003.

- Oliver
 
B

badasspirate

Oliver said:
The OP seems to accept compiled .class files. Perhaps if you run your
code through an obfuscator first, you can prevent the OP from plagiarising
your work, while still submitting an solution.

The problem statement is identical to the competition at
http://cs.hood.edu/pobw/POWDec052003.html (where you could have won a $20
gift certificates to Papa John's pizza), but the contest requires source
code, and the deadline was 2003.

- Oliver

I did copy that problem exactly, as I had already solved it a year ago
in a programming competition at Hood University. I thought it was a
good candidate to use as a deterrent for noobs.
-Eric
 
M

Mark Space

So Mr. Pirate, your problem seem very simple to me. How do I know that
you are not the noob?

Please post your solution. To make things interesting, you may not use
a language with automatic garbage collection (ie., I want to see your
memory management), and you may not use libraries other than the IO
library. I'd prefer C.

Also, you may not use recursion.

Ready? Go.
 
C

Chris Smith

I did copy that problem exactly, as I had already solved it a year ago
in a programming competition at Hood University. I thought it was a
good candidate to use as a deterrent for noobs.

If you're serious about this, you could ask people to join TopCoder...
I'm pretty impressed with their problems, and while my own score isn't
so great, I do think their scores are pretty meaningful in terms of
general programming skill.

A few more tips, in case you're interested:

- The all-caps MONEY makes me want very little to do with you. I'm not
interested in participating in programming projects with other people
who are there looking for a quick buck. If you're actually interested
in fun and developing friendships, you would make that clearer by
working on open source projects or something like that. If you're in
it for the cash, then you need to be willing to do the work or pay
people reasonable industry rates to do parts of it for you.

- Identifying yourself only by first name and the email address
(e-mail address removed) wouldn't make me trust you even if I were
interested in entering a financial agreement with someone to produce
code in exchange for vague promises of future riches.
 
C

Chris Uppal

Oliver said:
The problem statement is identical to the competition at
http://cs.hood.edu/pobw/POWDec052003.html (where you could have won a $20
gift certificates to Papa John's pizza), but the contest requires source
code, and the deadline was 2003.

Quite a nice little puzzle, though, as are the others in that sequence.

FWIW (which would seem to be several three-year-old pizzas) here's my attempt:

choyvp pynff JnyylJnyxre
{
choyvp fgngvp ibvq
znva(Fgevat[] netf)
{
cevagCbfgBeqre(netf[0], netf[1]);
Flfgrz.bhg.cevagya();
}

choyvp fgngvp ibvq
cevagCbfgBeqre(Fgevat cerBeqre, Fgevat vaBeqre)
{
vs (cerBeqre.yratgu() == 0)
erghea;

pune ebbg = cerBeqre.puneNg(0);
vag yrsgFvmr = vaBeqre.vaqrkBs(ebbg);

Fgevat yrsgCerBeqre = cerBeqre.fhofgevat(1, yrsgFvmr+1);
Fgevat evtugCerBeqre = cerBeqre.fhofgevat(yrsgFvmr+1);
Fgevat yrsgVaBeqre = vaBeqre.fhofgevat(0, yrsgFvmr);
Fgevat evtugVaBeqre = vaBeqre.fhofgevat(yrsgFvmr+1, vaBeqre.yratgu());

cevagCbfgBeqre(yrsgCerBeqre, yrsgVaBeqre);
cevagCbfgBeqre(evtugCerBeqre, evtugVaBeqre);

Flfgrz.bhg.cevag(ebbg);
}
}

-- chris
 
M

M.J. Dance

Hey all,
I am looking for some programmers with sufficient qualifications who
would like to join a freelancing programming group, either as a quick
way to make money, or something to do on the side. Anyway, I am really
optimistic about the possibilities that could arise from forming a
programming group (friends, MONEY, etc) and would like to get it
started. If you are interested, just solve this (intermediate skill)
programming problem and send me an email at (e-mail address removed) with
the subject "Wallys Traversal's".
------------------------------------------------------------------------------------
Problem Statement: Given a rooted, binary tree T, write a program that
prompts the user to enter the preorder traversal of T and the inorder
traversal of T. The program should then output the postorder traversal
of T.

You may assume that each node is represented by a character. So a
traversal (whether preorder, postorder, or inorder), is expressed as a
string.

Suppose Wally walks the tree:

a
/ \
/ \
b c
/ \ \
/ \ \
d e f
/
/
g

Here is an example of how the program should work:

Enter preorder traversal of T: abdecfg [Press Enter]
Enter inorder traversal of T: dbeacgf [Press Enter]
Given the preorder traversal abdecfg and the inorder traversal dbeacgf,
I
conclude that the postorder traversal order of T is: debgfca

Your program does not have to provide any error-checking.
------------------------------------------------------------------------------------
The only reason I am including this is to keep away newbies from
joining the group. Just send me the compiled (or source code) .class
(or .java) files in an email if you are interested.
Sincerely,
Eric

Code is below. Beware, though, that it's straight out of "How to write
unmaintainable code" manual. Meaning: if you show it to your examiner, he/she
will flunk you in a blink of an eye. Now, keep your friends and give me my
MONEY! ;-)

public class Traversal {
private static void t(String tlr, String ltr) {
if(tlr == null || tlr.length() == 0)
return;
String[][] s = new String[2][];
for(int i = 0; i < s.length; i++)
s = new String[3];
s[0][0] = tlr.substring(0, 1);
int p = ltr.indexOf(s[0][0]);
if(p > 0) {
s[0][1] = tlr.substring(1, 1 + p);
s[1][1] = ltr.substring(0, p);
}
if(p < ltr.length() - 1) {
s[0][2] = tlr.substring(1 + p);
s[1][2] = ltr.substring(1 + p);
}
if(s[0][1] != null)
t(s[0][1], s[1][1]);
if(s[0][2] != null)
t(s[0][2], s[1][2]);
System.out.print(s[0][0]);
}
public static void main(String[] args) {
String tlr = "abdecfg";
String ltr = "dbeacgf";
//Your program does not have to provide any error-checking.
t(tlr, ltr);
}
}
 
M

M.J. Dance

BTW, guys, I don't understand your complaining about doing homework for some
lazy student. If you want to be really nasty, you should always oblige. Remember
the fable about a hungry Chinaman?
 
O

Oliver Wong

M.J. Dance said:
Code is below. Beware, though, that it's straight out of "How to write
unmaintainable code" manual. Meaning: if you show it to your examiner,
he/she will flunk you in a blink of an eye.

You'd be surprised at what teachers will tolerate.

- Oliver
 
M

Mark Space

M.J. Dance said:
Code is below. Beware, though, that it's straight out of "How to write
unmaintainable code" manual. Meaning: if you show it to your examiner,

"Out of?" I think you're the author... wow, that burned my eyes. :D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top