# Computer Science Problems

**URL:** <https://www.ruby-forum.com/t/computer-science-problems/128224>\
**Category:** Ruby\
**Created:** [February 6, 2008, 12:35am UTC](https://www.ruby-forum.com/t/computer-science-problems/128224 "2008-02-06T00:35:41Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 6, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/21 "2008-02-06T16:15:44Z")

</div>

2008/2/6, Thomas A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hello –
> 
> On 05/02/2008, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > 1. Is there a definitive book/web site/resource on this and other
> 
> Start by looking at know University sites – you’ll often come across some.  
> ).
> 
> > 1. Do people have favorite ‘Data Structure and Algorithm’ books?
> 
> Robert Sedgewick’s books are great, if not a little heavy-going:

I can recommend them as well - although I still wait for Algorithms in  
C++ Parts 6-8. Publishing date has been postponed a few times. He  
seems to be too busy. 🙂

Cheers

robert

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 6, 2008, 9:05pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/22 "2008-02-06T21:05:53Z")

</div>

On Feb 5, 6:31 pm, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> My questions are:  
> was a ‘famous computer science problem’.
> 
> cheers,
> 
> –  
> Mark

Some links:  
Algorithms and Data Structures Research & Reference Material –

> **[Monash](https://www.csse.monash.edu.au/~lloyd/tildeAlgDS/)**
>
> Monash

Dictionary of Algorithms and Data Structures –

> **[Dictionary of Algorithms and Data Structures](https://xlinux.nist.gov/dads/)**
>
> Definitions of algorithms, data structures, and classical
> Computer Science problems.
> Some entries have links to implementations and more information.

Structure and Interpretation of Computer Programs –  
[http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-1.html](http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-1.html)  
How to Design Programs – [http://www.htdp.org/](http://www.htdp.org/)

cheers

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 6, 2008, 9:38pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/23 "2008-02-06T21:38:22Z")

</div>

On Wed, Feb 06, 2008 at 10:47:51AM +0900, James G. wrote:

> A Ruby algorithms book would be really nice to have. (I have a Perl  
> book like that I’ve used a fair bit.)

I’d love to find a Ruby algorithms book, myself.

re: Perl . . .  
Are you talking about Mastering Algorithms with Perl, by Macdonald,  
Orwant, and Hietaniemi? I haven’t really had a chance to read it in any  
depth, but it looks like a great way to get a basic introduction for  
someone who knows Perl, and build a foundation for some of the more  
complex and in-depth algorithms books.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 6, 2008, 9:36pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/24 "2008-02-06T21:36:35Z")

</div>

On Feb 6, 2008, at 2:05 PM, Chris H. wrote:

> Algorithms and Data Structures Research & Reference Material –  
> [Monash](http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/)  
> Dictionary of Algorithms and Data Structures – [Dictionary of Algorithms and Data Structures](http://www.nist.gov/dads/)

The problem I keep seeing with the links posted in this thread is that  
you pretty much need to know the name of what you want to even find  
it. I don’t always know that when I’m algorithm hunting.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 6, 2008, 9:56pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/25 "2008-02-06T21:56:06Z")

</div>

On Feb 6, 2008, at 2:37 PM, Chad P. wrote:

> On Wed, Feb 06, 2008 at 10:47:51AM +0900, James G. wrote:
> 
> > A Ruby algorithms book would be really nice to have. (I have a Perl  
> > book like that I’ve used a fair bit.)
> 
> I’d love to find a Ruby algorithms book, myself.

Yeah, I’ve even considered submitting a proposal for one of these to a  
publisher. It would be a lot of work though, for sure. 😉

> re: Perl . . .  
> Are you talking about Mastering Algorithms with Perl, by Macdonald,  
> Orwant, and Hietaniemi?

Yes.

> I haven’t really had a chance to read it in any  
> depth, but it looks like a great way to get a basic introduction for  
> someone who knows Perl, and build a foundation for some of the more  
> complex and in-depth algorithms books.

It’s pretty good.

At times it gets a little into the download-this-library-to-do-the-  
work-for-you mode. While that’s often the way you should handle that  
kind of thing, I want an algorithm book to teach me instead.

It’s definitely good about raising your familiarity overall though.

The examples are also usually pretty easy to translate to Ruby. 🙂

James Edward G. II

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 9, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/26 "2008-02-09T23:54:05Z")

</div>

On 2/9/08, Christopher D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [Data Structures and Algorithms in Ruby | BRP](http://www.brpreiss.com/books/opus8/)  
> Once more into the breach dear friends!

> **[Re: Algorithm books for Ruby (was Re: Object-oriented solution to Tower of...](https://groups.google.com/g/comp.lang.ruby/c/XVAUdEnwtTI)**

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 10, 2008, 2:06am UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/27 "2008-02-10T02:06:08Z")

</div>

On 09.02.2008 23:53, Rick DeNatale wrote:

> Once more into the breach dear friends!
> 
> [http://groups.google.com/group/comp.lang.ruby/browse\_thread/thread/5d50147449f0b532/67382c9359422e2f?lnk=gst&q=algorithm+books+ruby#67382c9359422e2f](http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/5d50147449f0b532/67382c9359422e2f?lnk=gst&q=algorithm+books+ruby#67382c9359422e2f)

You wrote:

> Since Ruby arrays are dynamically sized, the second needs to  
> reallocate and copy the contents.
> 
> So in these cases certain array stores might actually be O(n) where n  
> is the length of the array rather than O(1).

This is actually not true: you need to compare apples with apples. You  
cannot assign a C array beyond its boundaries (well, you _can_ -  
sometimes). So you would have to compare assignments within the  
preallocated size. Same reasonings apply to the size in memory. Fact  
is, you can use Ruby Arrays like C Arrays but most of the time you  
don’t.

The fact that Ruby is interpreted and a completely different language  
than C does not invalidate complexity theory. Keep in mind that O(n) is  
just an approximation really meaning “the effort grows asymptotically  
linear for n larger than a certain threshold” - or, slightly different,  
“the effort is O(n\*X+C)” with X and C being constants. Eventually  
runtime will be determined by the number of input parameters and  
duplication of this number will duplicate runtime.

So even though Ruby exposes different runtime characteristics it can be  
still used to study algorithms (actually I believe it is well suited  
because the clutterfree syntax eases focusing on the algorithmic part)  
and complexity theory.

Of course, this does not free us from measuring and performance tuning.  
Often some implementations in Ruby are faster because the use library  
code implemented in C although in theory they should be slower.

You have one point though: often these ported books do not use features  
of the target language well and the code presented tends to look  
strange.

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2008, 12:54am UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/28 "2008-02-11T00:54:47Z")

</div>

If you’re looking for some interesting problems, and ways to solve  
them this book is pretty good (it’s similar to Ruby Q. style  
problems):  
[http://www.amazon.com/Programming-Challenges-Steven-S-Skiena/dp/0387001638/ref=sr\_1\_1?ie=UTF8&s=books&qid=1202686974&sr=1-1](http://www.amazon.com/Programming-Challenges-Steven-S-Skiena/dp/0387001638/ref=sr_1_1?ie=UTF8&s=books&qid=1202686974&sr=1-1)

This is a website that lets you submit source code, and it will be  
tested for you.  
[http://acm.uva.es/problemset/](http://acm.uva.es/problemset/)

Joe

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2008, 3:38pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/29 "2008-02-11T15:38:07Z")

</div>

If challenge is what you REALLY want, look no further than the ultimate  
authority in computer algorithms:  
(The Art of Computer Programming  
Series)[http://www.amazon.com/Art-Computer-Programming-Volumes-Boxed/dp/0201485419/ref=pd\_bbs\_sr\_1?ie=UTF8&s=books&qid=1202740125&sr=8-1](http://www.amazon.com/Art-Computer-Programming-Volumes-Boxed/dp/0201485419/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1202740125&sr=8-1)By:  
Donald E. Knuth.

Victor

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 15, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/30 "2008-02-15T21:01:25Z")

</div>

Joe wrote:

> If you’re looking for some interesting problems, and ways to solve  
> them this book is pretty good (it’s similar to Ruby Q. style  
> problems):  
> [Programming Challenges: The Programming Contest Training Manual (Texts in Computer Science): Skiena, Steven S, Revilla, Miguel A.: 9780387001630: Amazon.com: Books](http://www.amazon.com/Programming-Challenges-Steven-S-Skiena/dp/0387001638/ref=sr_1_1?ie=UTF8&s=books&qid=1202686974&sr=1-1)

Skiena is _my_ CS professor!  
His new algorithms books is quite good. He’s distributed printer’s  
darft copies to the students in the class.

-Ben Kudria

–

> **[Benjamin Kudria](https://ben.kudria.net/)**
>
> Benjamin Kudria's personal site — resumé, source code, and professional profile.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 15, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/31 "2008-02-15T21:10:50Z")

</div>

That book is terrible. It should be titled “Data Structures and  
Algorithms with Object Oriented Design Patterns in C++ or Java That  
Happen to Be Written in Ruby”.

It doesn’t use any Ruby or functional idioms. It looks like he paid a  
minimum wage code monkey to translate the book into a lot of languages  
(or used some automated means).

–Jeremy

On Sat, Feb 9, 2008 at 5:01 PM, Christopher D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> [Data Structures and Algorithms in Ruby | BRP](http://www.brpreiss.com/books/opus8/)

–

> **[Jeremy McAnally](http://www.jeremymcanally.com/)**

My books:  
Ruby in Practice

> **[Ruby in Practice - Jeremy McAnally and Assaf Arkin](https://www.manning.com/books/ruby-in-practice)**
>
> Like Ruby itself, Ruby in Practice will make you more productive. The book shows you practical techniques and strategies for small projects and large-scale…

My free Ruby e-book

> **[Site not found · DreamHost](http://www.humblelittlerubybook.com/)**
>
> The owner of this domain has not yet uploaded their website.

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 15, 2008, 9:12pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/32 "2008-02-15T21:12:00Z")

</div>

On Feb 15, 2008, at 2:01 PM, Benjamin K. wrote:

> Joe wrote:
> 
> > If you’re looking for some interesting problems, and ways to solve  
> > them this book is pretty good (it’s similar to Ruby Q. style  
> > problems):  
> > [Programming Challenges: The Programming Contest Training Manual (Texts in Computer Science): Skiena, Steven S, Revilla, Miguel A.: 9780387001630: Amazon.com: Books](http://www.amazon.com/Programming-Challenges-Steven-S-Skiena/dp/0387001638/ref=sr_1_1?ie=UTF8&s=books&qid=1202686974&sr=1-1)
> 
> Skiena is _my_ CS professor!  
> His new algorithms books is quite good. He’s distributed printer’s  
> darft copies to the students in the class.

What’s the title?

James Edward G. II

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 9, 2008, 11:05pm UTC](https://www.ruby-forum.com/t/computer-science-problems/128224/33 "2008-02-09T23:05:06Z")

</div>

On Feb 6, 2008 12:37 PM, Chad P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Wed, Feb 06, 2008 at 10:47:51AM +0900, James G. wrote:
> 
> > A Ruby algorithms book would be really nice to have. (I have a Perl  
> > book like that I’ve used a fair bit.)
> 
> I’d love to find a Ruby algorithms book, myself.

Interestingly, I just ran into this online book, _Data Structures and  
Algorithms  
with Object-Oriented Design Patterns in Ruby_, at

> **[Data Structures and Algorithms in Ruby | BRP](https://brpreiss.com/books/opus8/)**
>
> Learn Ruby data structures and algorithms with examples covering arrays, hashes, heaps, graphs, sorting, blocks, and runtime tradeoffs.

[Previous page](https://www.ruby-forum.com/t/computer-science-problems/128224.md?page=1)
