Velocity Reviews > OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!!

# OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!!

88888 Dihedral
Guest
Posts: n/a

 11-20-2011
PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!

PROBLEM 2: COMPUTE PI AS IN THE ABOVE!

PROBLEM 3: LIST ALL PERMUTATIONS OF A STRING WITHOUT ANY REPEATED STRING IN THE LIST!

PROBLEM 4: IMPLEMENT A HASH THAT COULD BE AS FAST AS POSSIBLE AND VERY STABLE AND ROBUST TO BE USED EVERYWHERE TO BEAT OTHER LANGUAGES WITH A HASH BUILT IN.

Ian Collins
Guest
Posts: n/a

 11-20-2011
On 11/21/11 08:12 AM, 88888 Dihedral wrote:
> PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
>
> PROBLEM 2: COMPUTE PI AS IN THE ABOVE!
>
> PROBLEM 3: LIST ALL PERMUTATIONS OF A STRING WITHOUT ANY REPEATED STRING IN THE LIST!
>
> PROBLEM 4: IMPLEMENT A HASH THAT COULD BE AS FAST AS POSSIBLE AND VERY STABLE AND ROBUST TO BE USED EVERYWHERE TO BEAT OTHER LANGUAGES WITH A HASH BUILT IN.

Problem 5: Locate and turn off caps-lock.

--
Ian Collins

88888 Dihedral
Guest
Posts: n/a

 11-20-2011
I solved those long time ago in C.

Eric Sosman
Guest
Posts: n/a

 11-20-2011
On 11/20/2011 2:23 PM, 88888 Dihedral wrote:
> I solved those long time ago in C.

Glad to hear it. Just to verify, please post the output of
your Problem 3 solution for the string

I solved those long time ago in C

.... and state whether you are considering or ignoring letter case,

--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)d

Kaz Kylheku
Guest
Posts: n/a

 11-20-2011
On 2011-11-20, Eric Sosman <(E-Mail Removed)> wrote:
> On 11/20/2011 2:23 PM, 88888 Dihedral wrote:
>> I solved those long time ago in C.

>
> Glad to hear it. Just to verify, please post the output of
> your Problem 3 solution for the string

I like problem 4, because of its well-quantified and concretely targettable
requirement: "as fast as possible".

88888 Dihedral
Guest
Posts: n/a

 11-20-2011
1. Define an order in the symbol set of the string by a sort.
2. Start from the smallest mapped by the ordered defined which will yield the maximum if reversed.
3. From the smallest string by the order defined, just generate the next until the maximum is reached.

I hate to answer trivial questions!

Ian Collins
Guest
Posts: n/a

 11-20-2011
On 11/21/11 09:13 AM, 88888 Dihedral wrote:
> 1. Define an order in the symbol set of the string by a sort.
> 2. Start from the smallest mapped by the ordered defined which will yield the maximum if reversed.
> 3. From the smallest string by the order defined, just generate the next until the maximum is reached.
>
> I hate to answer trivial questions!

Like you hate quoting context?

--
Ian Collins

Eric Sosman
Guest
Posts: n/a

 11-20-2011
On 11/20/2011 3:13 PM, 88888 Dihedral wrote:
> 1. Define an order in the symbol set of the string by a sort.
> 2. Start from the smallest mapped by the ordered defined which will yield the maximum if reversed.
> 3. From the smallest string by the order defined, just generate the next until the maximum is reached.
>
> I hate to answer trivial questions!

I'm sure you'll be happy to learn that you're tied for third
place in my fastest-to-PLONK list.

--
Eric Sosman
(E-Mail Removed)d

Joe Pfeiffer
Guest
Posts: n/a

 11-20-2011
88888 Dihedral <(E-Mail Removed)> writes:

> PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
>
> PROBLEM 2: COMPUTE PI AS IN THE ABOVE!
>
> PROBLEM 3: LIST ALL PERMUTATIONS OF A STRING WITHOUT ANY REPEATED STRING IN THE LIST!
>
> PROBLEM 4: IMPLEMENT A HASH THAT COULD BE AS FAST AS POSSIBLE AND VERY STABLE AND ROBUST TO BE USED EVERYWHERE TO BEAT OTHER LANGUAGES WITH A HASH BUILT IN.

our homework directly.

Lew Pitcher
Guest
Posts: n/a

 11-20-2011
On Nov 20, 2:12*pm, 88888 Dihedral <(E-Mail Removed)>
wrote:
> PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!

"Euler's Number"? Do you mean "the mathematical constant e"? Or
perhaps "a sequence En of integers defined by a specific Taylor series
expansion"?

If you mean /e/, then
a) the number starts with a /2/, not a /1/ (as in 2.718281828...),
b) Steve Wozniak published a solution to 116000 places, in 1981, and
c) /I/ wrote and published a C-language solution to 5000 places in the
1990s
What's so difficult about a /30 place/ solution?

> PROBLEM 2: COMPUTE PI AS IN THE ABOVE!

It's been done. Many times over.

> PROBLEM 3: LIST ALL PERMUTATIONS OF A STRING WITHOUT ANY REPEATED STRING IN THE
> LIST!

A little more difficult, but again, it's been done many times over.

> PROBLEM 4: IMPLEMENT A HASH THAT COULD BE AS FAST AS POSSIBLE AND VERY STABLE AND
> ROBUST TO BE USED EVERYWHERE *TO BEAT OTHER LANGUAGES WITH A HASH BUILTIN.

Again, it's been done, many times. And it's simpler than e or pi.

So, what's your point? Or is this a sad attempt to get others to do