Well I've to simulate exactly a recursive algorithm with an iterative one. Assuming that I have a binary search tree that contains only a key and two references at his right and left child I want to do this count:

```
CountOddRec(T)
ret = 0
if T != NIL then
if T->key % 2 = 1 then
ret = T->key
rsx = CountOddRec(T->sx);
rdx = CountOddRec(T->dx);
ret = ret + rsx + rdx;
return ret
```

It's very basic, just for learing purpose. My idea is to use this algorithm for a general binary tree visit:

```
VisitIter(T)
last = NIL
curr = T
stk = NULL
while (curr != NIL || stk != NIL) do
if curr != NIL then
//Pre-order visit
stk = push(stk, curr)
next = curr->sx
else
curr = Top(stk)
if (last != curr-> dx) then
//In-order visit
if (last != curr-> dx && curr->dx != NULL) then
next = curr->dx
else
//Post-order visit
stk = pop(stk)
next = NIL
last = curr
curr = next
```

And so this is the solution I've reached:

```
CountOddIter(T)
last = NIL
curr = T
stk = NULL //stack
Sret = NULL //stack
Srsx = NULL //stack
ret = 0
while (curr != NIL || stk != NIL) do
ret = 0
if curr != NIL then
//Pre-order block
if (curr->key % 2 == 1) then
ret = curr->key
Sret = push(Sret, ret)
stk = push(stk, curr)
next = curr->sx
else
curr = Top(stk)
if (last != curr-> dx) then
//In-order block
Srsx = push(Srsx, pop(Sret))
if (last != curr-> dx && curr->dx != NULL) then
next = curr->dx
else
//Post-order block
rdx = pop(Sret)
rsx = pop(Srsx)
r = pop(Sret)
ret = rdx + rsx + r
Sret = push(Sret, ret)
stk = pop(stk)
next = NIL
last = curr
curr = next
```

Now I've tested both visit and solution and as I can see they works. But I'm pretty unsure about its effective correction, moreover I would like to learn if there is a method to improve solution (if correct).

I hope that here someone could help me to understand this, maybe too much easy, problem.

Many thanks!

The teams of three may register up until March 9. They will compete in the qualifying round online on March 12.

For more information visit www.deadline24.pl

]]>]]>

I have been reading about ES a lot but I still confused , does rule-based system enough to build the system, or do I have to use matching algorithms like stable marriage or Maximum bipartite matching.

]]>It can help you learn Spanish too since it also has video and audio both in Spanish with which you can compare between your hearing, the actual text and its actual pronounciation.

This is the index of the minicourse:

archive.org/details/MentalCalendar

*Week 1: Learning the Sequence of Days 1 to 31*

**English:**

**Spanish:**

*Week 2: Calculating Freely for Any Month with Month Tables*

**English:**

**Spanish:**

*Week 3: HTML Program to Get the First Day of the Year and Number of Days (365 or 366)*

**English/Spanish:**

*Week 4: Original Docoments From When the Method Was Created*

**English:**

**Spanish:**

It's possible that there will be more videos for this course in the future, so to know if there are more, just refer to the URL of the index of the course. In the future there should be an index HTML page showing the full index of videos and resources.

]]>b) topological order

c) kosoraju sharir algorithm

d) prim algorithm ]]>

I've been reading about xfs filesystems vs. ext4 filesystems. From what I can understand, ext4 is certainly robust and fast (which is why I pick this one). Again, this question is theoretical though. For someone who can be considered a professional computer programmer, which filesystem is best?

For example, I am a mathematician. I program all the time, and sometimes the algorithms I program can run for even months. When computing on this type of scale, even the smallest speedups make a difference. Is xfs (which I think is my conclusion here) fastest for this type of programming? In what types of programs or algorithms could it make a difference?

To me, it should really only matter when using a lot file I/O. Which is certainly what a mathematician would probably need most for long running programs. Hence, my conclusion that xfs might be best for me (although, I am still using ext4).

Are there any gurus/nerds that care to share their opinion?

]]>My interface should allow user to write words and segmentate each character. Someone know some library or algoritm to use? ]]>

1234

2134

2143 ... n so on.

can any please tell me how do i proceed ? i have devised an algorithm myself, which swaps consecutive numbers... but it works only for 3 digit numbers. but the above mentioned problem needs to work for all numbers.

plzzz help ...

"[b]The[blue] GEEK[/blue] Shall Inherit The Earth" ;-) [/b]]]>

I'm Maria and I'm part of the CodinGame team. For those who are not familiar with our concept, we are a video games platform for programming fans. Players can solve our solo games available in the platform as well as join our multiplayer AI Battles once a month.

We have recently launched our new platform which includes features such as a full IDE, 20+ programming languages, game visuals, auto-completion,etc.

We are now trying to improve it and we are looking for feedback from the community to make it much more fun for everyone, so if you know the platform and are interested in giving us your opinion and ways of improvements, you are more than welcome to comment

Thank you very much!

Maria

]]>My answer:

Var x;

Function equate(list m)

If(length.m >=1)

Var l.list, r.list;

Var int middle = length.m /2;

For(int i = 0; i < middle; i++)

For(int j = 1;j < middle; j++)

l.list(i)*l.list(j)

if(l.list(i)*l.list(j) =x)

print l.list(i), l.list(j)

For(int i = middle; i < m; i++)

For(int j = middle; j < m; j++)

r.list(i)*r.list(j)

if(r.list(i)*r.list(j) = x)

print r.list(i),r.list(j)

I want to make sure if this is correct! If I have to change something please show me on my code what I have to change, and explain! Thanks!

]]>

This is what I have:

Var x;

Function equate( list m)

// if list size is 0 empty or 1 print computation can not be done

If(length m >=1)

Divide the lists into two parts

Var list left ,right ;

Var int middle = length (m) /2;

For each x in before middle

Add x to the left // left is an array

Loop : For (int i=0;i< middle;i++ )

For (int j= 1;j<middle;j++)

multiply left (i)xleft(j)

if (left (i)xleft(j) =x )

print left (i) , left(j)

For each x in after middle before length(m) // right is an array

Add x to the right

Loop : For (int i=middle ; i< m ;i++ )

For (int j= middle ;j<m ;j++)

multiply right (i)x right (j)

if (right (i)xright (j) =x )

print right (i), right j

Is this correct. Please, do not make it complicated. I want to keep it simple. If it is correct or I have to change something please tell me the line, and what it should look like, write the line out! Thank you!

]]>

Rank racon - the best search marketing secret formula for ranking your website in Google. Check it to find out more ]]>

I write QR decoder.

If I get distortion QR image,

decoder cannot recognize it.

For example, if I make QR photo angularly.

How can I adjust QR image?

]]>

Each group can also have n numbers of students.

Example:5 groups

group 1(math) : student a ,b,c,d ,e

group 2(english): student b,c,f,g

group 3(biology): h,i,g,k,s,m,n,o,p

group 4(chemistry): a,f,,n,z

group 5(computing):b,q,y,w

Result: i could create an algorithm that selects the first element of every group so all groups are covered however that isnt efficient

a good efficient minimum would be: b, n

where do I start? what data structures can i use to make it efficient?]]>

Each group can also have n numbers of students.

Example:5 groups

group 1(math) : student a ,b,c,d ,e

group 2(english): student b,c,f,g

group 3(biology): h,i,g,k,s,m,n,o,p

group 4(chemistry): a,f,,n,z

group 5(computing):b,q,y,w

Result: i could create an algorithm that selects the first element of every group so all groups are covered however that isnt efficient

a good efficient minimum would be: b, n

where do I start? what data structures can i use to make it efficient?

]]>

In the prospect of render a database anonym I need to generate certain ranges of data.

I have what I need for the USA.

http://www.highprogrammer.com/alan/numbers/dl_us_shared.html

Now I need something similar for a maximum of European countries.

If you already had to do something similar, any algos or tips for any countries is welcome.]]>

[[1, "a"], [2, "b"], [1, "c"]]

print:

1, "a"

1, "c"

Thanks a lot,

C

]]>

[[1, "a"], [2, "b"], [1, "c"]]

print:

1, "a"

1, "c"

Thanks a lot,

C

]]>

But, few recent software try to transcribe voice from multiple speaker to text, some with few hours of "calculation", other in real time.

What kind of algorithm can they use to transcribe more than 1 voice ?

Can you tell me some name of different projects about multiple speaker recognition software / algorithms ?

]]>

This is what I have so far, but I have no idea if I am even correct:

Finding the minimum key stored in a B-tree is quite simple, we just do the opposite of find the maximum and that would be by finding the left most leaf / subtree for the given root. Once, we find the left most leaf / subtree of the give root the smallest element in the node would be the minimum key.

Finding the predecessor first we would have to find the maximum

]]>

]]>

]]>

Any help would be appreciated.

]]>

Any help would be appreciated.

]]>

I am trying to build an artificial neural network.

So far my network is divided into several layers, all of which comprising a certain amount of neurons. Every neuron is connected to every other neuron in the previous and following layer. Neurons receive an input from all their connections. These inputs have been multiplied by a value which is the "weight" of the connection between the two. All inputs are summed and the output of the neuron is the result of a sigmoid function which takes the sum of inputs as a parameter. Overall, the network produces a result R. The "error" of the network is given by E = 1/2*(O-D)^2 where D is the desired result. At this point, having:

a) The individual output of all neurons stored within the neuron objects

b) The overall error of the network

How should I modify the weight of the connections between neurons?

Cheers

Dario

]]>

I am trying to build an artificial neural network.

So far my network is divided into several layers, all of which comprising a certain amount of neurons. Every neuron is connected to every other neuron in the previous and following layer. Neurons receive an input from all their connections. These inputs have been multiplied by a value which is the "weight" of the connection between the two. All inputs are summed and the output of the neuron is the result of a sigmoid function which takes the sum of inputs as a parameter. Overall, the network produces a result R. The "error" of the network is given by E = 1/2*(O-D)^2 where D is the desired result. At this point, having:

a) The individual output of all neurons stored within the neuron objects

b) The overall error of the network

How should I modify the weight of the connections between neurons?

Cheers

Dario

]]>

Please i need some learning materials, please

]]>

CLRS 30.1-3

You can find the problem in this list (not my list assignment), as problem 5 http://clweb.csa.iisc.ernet.in/meghana/courses/daa/as3.pdf

Solution may involve complex roots of a unitary circle. For those of you who dont know a point-value representation of a polinomial is simply representing a polinomial o degree n by n points in the cartesian space.

Thanks in advance.

]]>

CLRS 30.1-3

You can find the problem in this list (not my list assignment), as problem 5 http://clweb.csa.iisc.ernet.in/meghana/courses/daa/as3.pdf

Solution may involve complex roots of a unitary circle. For those of you who dont know a point-value representation of a polinomial is simply representing a polinomial o degree n by n points in the cartesian space.

Thanks in advance.

]]>