Tricky Question!

Here's a tricky scenario question for anyone wanting to tackle!

You are working on an algorithm that deals with a large collection of items that are passed in as a sorted linked list. Since searches are performed far more frequently than inserts, you suggest that perhaps there would be efficiency gains if the linked list was converted to an array based collections. Bob the uber nerd snorts at you and says that it makes more sense to loop through the array adding it to a Binary Search program. You ponder Bob's input and wonder if the guy could be wrong? But in the end, confident that you will be the "alpha" nerd of this team you explain why your method would work and why Bob's is will......kinda dumb.

[725 byte] By [assistancepleasea] at [2007-11-27 8:56:44]
# 1
Tricky, tricky.That is a tricky question... I can't even find the question.
myncknma at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 2

To solve this exciting scenario I do the following:

1) I install malware on Bob's computer such that he sends emails with links to bestiality porn to everyone in the office.

2) I go play on Wikipedia.

3) I come back from Wikipedia and start implementing my own quicksort algorithm for use on LinkedLists for no particular reason other than I am bored.

4) I go for coffee

5) Bob is fired for sending pornographic spam emails (see 1)

6) I come back from coffee and smoke break to see Bob leaving.

7) I ask Bob if it matters who was right about the sorted list anymore

8) Bob cries

9) I make vague yet sarcastic remarks involving Bob not getting help from his beloved Kilngons.

10) Humming the Star Wars intro I return to my desk and go back to reading my NET tutorial.

Hope that helps.

cotton.ma at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 3
Give cotton the dukes. That post deserves it.
CaptainMorgan08a at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 4
> To solve this exciting scenario I do the following:....That was just so beautiful, I cried.
petes1234a at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 5
large collection of items that are passed in as a sorted linked list. Since searches are performed far more frequently than inserts is it benefical to convert the linked list to an array based collection or add it to a bindary search?
assistancepleasea at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 6

> large collection of items that are passed in as a

> sorted linked list. Since searches are performed far

> more frequently than inserts is it benefical to

> convert the linked list to an array based collection

> or add it to a bindary search?

It seems silly to ask this here. Rather, why don't you write the code and test it yourself. It wouldn't be hard to do.

petes1234a at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 7
I need help
assistancepleasea at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 8

> I need help

Let's get some things straight here. If you haven't learned by now, this is not a site where folks do your work for you. You have to do it yourself, otherwise you will be ridiculed from here to tomorrow. if you really want someone to do it for you, then you need to pay someone, period.

What we can do is help with specific questions. In other words you try to create a program but stumble at a specific step, we often can help you over that step.

Doing someone else's work (which is what you are asking) we won't and we shouldn't do.

petes1234a at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 9
> I need helpNo shit sherlock.
CaptainMorgan08a at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 10
> Rather, why don't you write the code and test it yourself.Becuase this is a homework question and they tried oh so cleverly to trick us into answering it for them.
floundera at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 11

> > Rather, why don't you write the code and test it

> yourself.

>

> Becuase this is a homework question and they tried oh

> so cleverly to trick us into answering it for them.

shoot, you wouldn't even need to use the timer class (or swing Timer). Just a simple stopwatch would probably suffice.

The OP's attempt at cheating is pathetic though.

petes1234a at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 12

> > Rather, why don't you write the code and test it

> yourself.

>

> Becuase this is a homework question and they tried oh

> so cleverly to trick us into answering it for them.

Yes, indeed. I've never seen the "Here's a tricky puzzle for all you geniuses and none of you professional programmers have ever seen anything like this before in your homework, etc., so your pathetic egos will force you to do this work for me" ploy before. Nope, never.

jverda at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 13
> 10) Humming the Star Wars intro I return to my desk and go back to reading my NET tutorial.Don't forget to snag Bob's stapler!
BigDaddyLoveHandlesa at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 14
I think "assistanceplease" has be severely chastised into never posting again.However, their level of intellect leads me to believe that they will register under a new nick and their first post will be "Another Tricky Question!!!!!!!!"
floundera at 2007-7-12 21:20:08 > top of Java-index,Java Essentials,Java Programming...
# 15
> > 10) Humming the Star Wars intro I return to my desk> and go back to reading my NET tutorial.> > Don't forget to snag Bob's stapler!That's my stapler. The red swingline.
cotton.ma at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 16

> > > 10) Humming the Star Wars intro I return to my

> desk

> > and go back to reading my NET tutorial.

> >

> > Don't forget to snag Bob's stapler!

>

> That's my stapler. The red swingline.

I could set this place on fire.

jverda at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 17

> > > > 10) Humming the Star Wars intro I return to my

> > desk

> > > and go back to reading my NET tutorial.

> > >

> > > Don't forget to snag Bob's stapler!

> >

> > That's my stapler. The red swingline.

>

> I could set this place on fire.

PC LOAD LETTER

cotton.ma at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 18
Forget the damn stapler. Grab his cubicle if it is better.
floundera at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 19
> Forget the **** stapler. Grab his cubicle if it> is better.Someone's got a case of the Mondays.
cotton.ma at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 20
> > Forget the **** stapler. Grab his cubicle if it> > is better.> > Someone's got a case of the Mondays.But how many pieces of flair are you wearing?
jverda at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 21

> > > Forget the **** stapler. Grab his cubicle if it

> > > is better.

> >

> > Someone's got a case of the Mondays.

>

> But how many pieces of flair are you wearing?

Damn! You just reminded me I forgot the cover letter on the TPS reports again.

cotton.ma at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 22

I think we were too rough on the OP too early on. We should have been gentler.

Don't get me wrong, he deserved every jibe, but it's just it's not as much fun when he bails out so early in the game. We need to reel him in slowly, carefully, like a fish, so we can watch him squirm a bit longer.

petes1234a at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...
# 23

> I think we were too rough on the OP too early on. We

> should have been gentler.

>

> Don't get me wrong, he deserved every jibe, but it's

> just it's not as much fun when he bails out so early

> in the game. We need to reel him in slowly,

> carefully, like a fish, so we can watch him squirm a

> bit longer.

Not tonight dear, I have a headache.

cotton.ma at 2007-7-21 22:50:58 > top of Java-index,Java Essentials,Java Programming...