return to tranceaddict TranceAddict Forums Archive > Main Forums > Chill Out Room

Pages: [1] 2 3 4 
Calling out programmers
View this Thread in Original format
Gauss
I'll be doing some more research about it, but in the meantime, if someone feels like it, I need an example of algorithm.

It has to have at least 20 lines and has to be written in 3 forms:
- data flow diagram
- pseudocode
- in C language (implementation)

Shouldn't be hard for someone good at progreamming. Thanks in advance.
elFreak
25$
ziptnf
Here's Heap Sort, an efficient method for sorting large collections. All it took was a simple wikipedia search. If you need code or a diagram, you'd better pay me.

quote:
function heapSort(a, count) is
input: an unordered array a of length count

(first place a in max-heap order)
heapify(a, count)

end := count - 1
while end > 0 do
(swap the root(maximum value) of the heap with the last element of the heap)
swap(a[end], a[0])
(decrease the size of the heap by one so that the previous max value will
stay in its proper placement)
end := end - 1
(put the heap back in max-heap order)
siftDown(a, 0, end)

function heapify(a,count) is
(start is assigned the index in a of the last parent node)
start := (count - 2) / 2

while start ≥ 0 do
(sift down the node at index start to the proper place such that all nodes below
the start index are in heap order)
siftDown(a, start, count-1)
start := start - 1
(after sifting down the root all nodes/elements are in heap order)

function siftDown(a, start, end) is
input: end represents the limit of how far down the heap
to sift.
root := start

while root * 2 + 1 ≤ end do (While the root has at least one child)
child := root * 2 + 1 (root*2 points to the left child)
(If the child has a sibling and the child's value is less than its sibling's...)
if child + 1 ≤ end and a[child] < a[child + 1] then
child := child + 1 (... then point to the right child instead)
if a[root] < a[child] then (out of max-heap order)
swap(a[root], a[child])
root := child (repeat to continue sifting down the child now)
else
return
Akridrot
My friend, this is not hard. An algorithm is literally a recipe , a simple set of instructions on how to perform a task , as complete as can possibly be. The instructions for making a peanut butter and jelly sandwich (if you are thorough enough , down to "remove the green lid from the peanut butter jar with your right hand , rest it on your countertop , with your left hand insert your knife into the jar of peanut butter , swirl it around , remove it , place your right hand on the top slice of your two slice whitebread sandwich , spread the peanut butter , remove your right hand , clean the knife , etc )

An algorithm is basically like that. Think of it as the outline to the computer program you're writing. The pseudocode implementation is closer to the actual implementation, but you aren't using real code... so you will use some fake programming language : "while x is less than 20 x == x + 1"
Gauss
quote:
Originally posted by Akridrot
My friend, this is not hard. An algorithm is literally a recipe , a simple set of instructions on how to perform a task , as complete as can possibly be. The instructions for making a peanut butter and jelly sandwich (if you are thorough enough , down to "remove the green lid from the peanut butter jar with your right hand , rest it on your countertop , with your left hand insert your knife into the jar of peanut butter , swirl it around , remove it , place your right hand on the top slice of your two slice whitebread sandwich , spread the peanut butter , remove your right hand , clean the knife , etc )

An algorithm is basically like that. Think of it as the outline to the computer program you're writing. The pseudocode implementation is closer to the actual implementation, but you aren't using real code... so you will use some fake programming language : "while x is less than 20 x == x + 1"

Thanks, but I already know all that... Thing is, I'm fresh out of ideas and when it comes to writing whatever I think of in C, I encounter a block. :p
ziptnf
quote:
Originally posted by ********
I've taken to start learning Delphi , I have some basic experience with c vb and turing and a basic knowledge of assembly.

Most of the software ideas are music related.

Those are all completely unrelated languages that won't help you create a "music studio" or whatever the you want to make. C maybe, but using VB to try to program something professional looking will end up looking like a childs plaything. Learn C++ and C# if you want something that doesn't feel like FruityLoops.
WhatTF
quote:
Originally posted by ziptnf
Those are all completely unrelated languages that won't help you create a "music studio" or whatever the you want to make. C maybe, but using VB to try to program something professional looking will end up looking like a childs plaything. Learn C++ and C# if you want something that doesn't feel like FruityLoops.


BTW FL Studio is written in Delphi. Also, you can make applications looking very different in any of those languages, as you do not have to use their standard forms, you can design your own.
LeopoldStotch
There are a whole bunch of categorial
algorithms you can research.
It all depends on how complex you want to research.

You can do a basic algorithm involving a
recursive function to figure
the factorial function of a certain number.

Or you can do something a bit more complex like a sorting algorithm,
Like the above poster said, or something more original and old
School like bubblesort,linkedsort, or quicksort. You can
Also do a tree walking algorithm discussing the different
Type of trees are out there, and the relationship between
Xml and sql.

Or you can do something more computational, covering the mathematical
Field, such as trigonometry or calculus. If you want to do
Something real complex, look into biomedical informatics and
The progress it has made to perform data mining and analysis of
Several dna structures.




My 2 cents .......... :)
Joss Weatherby
Not to be an ass, but do your own homework.

Otherwise you will get hired by some idiot who just looks at degrees and end up not knowing anything that will help you in the real work place.

where you are "fresh out of ideas" happens all the time in professional programming but guess what, it doesn't help the deadline, so you think harder. Nothing is impossible (only inefficient and stupid).
ziptnf
quote:
Originally posted by WhatTF
BTW FL Studio is written in Delphi. Also, you can make applications looking very different in any of those languages, as you do not have to use their standard forms, you can design your own.

Sure, you can use a variety of libraries from a bunch of languages to create something. Delphi isn't bad, as FL Studio is pretty powerful if you know how to use it. You can create a music studio with anything these days, really. Learning Python wouldn't be bad, in fact, I'm sure you could do a lot of stuff with it.

T-Soma
You need to either suck it up or call it quits.
Wait until you get a real problem.
Such as ambiguous segment faults... :(
Joss Weatherby
quote:
Originally posted by T-Soma
You need to either suck it up or call it quits.
Wait until you get a real problem.
Such as ambiguous segment faults... :(



Yea or work with something like Flex.

Yay Flash player and it silently handling and trying to continue on what should be a fatal error, only to have it resurface in some totally unrelated place much later.

I HATE ADOBE. :whip:
CLICK TO RETURN TO TOP OF PAGE
Pages: [1] 2 3 4 
Privacy Statement