pseudocode

Which is the best way to randomly generate a list of fixtures?

I have an even number of teams and I need to create a list of fixtures. The rule is that a team that plays a fixture at home will play the next one away. What do you think is the best aproach for this problem? So the problem is to generate half of the fixtures, the other will be generated reversing home - away. So, if I have 6 teams {A...

Pseudocode help

Hello all I have been given a strange requirement(challenging for me atleast) to write a logic in an application. I've to write a business logic wherein it should perform the following functionality Total current consumption = current from A elements + current from B elements. A and B are different types of devices Now lets say the b...

Basic syntax for an animation loop?

I know that jQuery, for example, can do animation of sorts. I also know that at the very core of the animation, there must me some sort of loop doing the animation. What is an example of such a loop? A complete answer should ideally answer the following questions: What is a basic syntax for an effective animation recursion that can ...

Help with understanding Pseudo-code

Hi all. Can someone please tell me how I can implement the following line of pseudo-code. c[k]=c[k] (mod M) with |c[k]|<=M/2 I do not understand what the 'with' means, does it mean that I have to ensure that after reduction modulo M, c[k] must be less than or equal to M/2. What does 'with' usually mean (if anything) in pseudo-code? ...

Help needed inorder to avoid recursion

Hello All I have a method, which gives me the required number of Boxes based on number of devices it can hold.Currently i have implemented this logic using recursion private uint PerformRecursiveDivision(uint m_oTotalDevices,uint m_oDevicesPerBox, ref uint BoxesRequired) { if (m_oTotalDevices< m_oDevicesPerBox) ...

What does "!" mean in pseudo-code? I know "!" stands for factorial but I can't translate it

What does ! mean in pseudo-code? I know ! stands for factorial but I can't translate it . ex: get operation if (operation!= ’B’ OR operation != ’D’ OR operation!= ’W’) then print "Invalid Operation" What does it mean? Please help my mid-term is in hours :S Thanks in advance for your help :) ...

NTRU Pseudo-code for computing Polynomial Inverses

Hello all. I was wondering if anyone could tell me how to implement line 45 of the following pseudo-code. Require: the polynomial to invert a(x), N, and q. 1: k = 0 2: b = 1 3: c = 0 4: f = a 5: g = 0 {Steps 5-7 set g(x) = x^N - 1.} 6: g[0] = -1 7: g[N] = 1 8: loop 9: while f[0] = 0 do 10: for i = 1 to N do 11: f[i ...

Pseudocode: a clear definition?

The following code is an example of what I think would qualify as pseudocode, since it does not execute in any language but the logic is correct. string checkRubric(gpa, major) bool brake = false num lastRange num rangeCounter string assignment = "unassigned" array bus['business']= array('person a'=>array(0, 2.9), 'p...

Pseudocode help

Hello All I've been banging my head over few hours for realising this particular logic My task is to have a masterlist ListM elements of which shall be list(again) in the form of ListA(type A) and ListB(type B) and ListC(type C)(some generic type). Also the lists A and ListB can contain elements of type C(some generic type). Coming ...

pseudocode help with FOR

for j = n − 1 to 1 step − 1 do does this means for all j in [1 .. n-1] or [2 .. n-1] ? ...

Is this a bad version of the Merge Sort algorithm?

merge1(int low, int high, int S[], U[]) { int k = (high - low + 1)/2 for q (from low to high) U[q] = S[q] int j = low int p = low int i = low + k while (j <= low + k - 1) and (i <= high) do { if ( U[j] <= U[i] ) { S[p] := U[j] j := j+1 } else ...

Need XOR Encryption Algorithm Pseudocode

I am trying to find the pseudocode for the XOR encryption algorithm. However I've had no luck so far. Anybody know where I can find it? EDIT: XOR 32 if that helps EDIT 2: For Passwords ...

Can someone explain/annotate this Ruby snippet with comments?

Could someone please add comments to this code? Or, alternatively, what would be the pseudocode equivalent of this Ruby code? It seems simple enough but I just don't know enough Ruby to convert this to PHP. data = Hash.new({}) mysql_results.each { |r| data[r['year']][r['week']] = r['count'] } (year_low..year_high).each do |year| (1....

Algorithm: Determine shape of two sectors delineated by an arbitrary path, and then fill one.

NOTE: This is a challenging problem for anybody who likes logic problems, etc. Consider a rectangular two-dimensional grid of height H and width W. Every space on the grid has a value, either 0 1 or 2. Initially, every space on the grid is a 0, except for the spaces along each of the four edges, which are initially a 2. Then consider a...

Recursive algorithm for coalescing / collapsing list of dates into ranges.

Given a list of dates 12/07/2010 13/07/2010 14/07/2010 15/07/2010 12/08/2010 13/08/2010 14/08/2010 15/08/2010 19/08/2010 20/08/2010 21/08/2010 I'm looking for pointers towards a recursive pseudocode algorithm (which I can translate into a FileMaker custom function) for producing a list of ranges, i.e. 12/07/2010 to 15/07/2010, 12/08/...

help in the Donalds B. Johnson's algorithm, i cannot understand the pseudo code

Hi , does anyone know the Donald B. Johnson's algorithm which enumerates all the elementary circuits (cycles) in a Directed graph? link text I have the paper he had published in 1975 but I cannot understand the pseudo-code. My goal is to implement this algorithm in Java. Some questions I have is for example what is the matrix Ak i...

help in the Donalds B. Johnson's algorithm, i cannot understand the pseudo code (PART II)

Hi all , i cannot understand a certain part of the paper published by Donald Johnson about finding cycles (Circuits) in a graph. More specific i cannot understand what is the matrix Ak which is mentioned in the following line of the pseudo code : Ak:=adjacency structure of strong component K with least vertex in subgraph of G ind...

C#, introduce a DragOver delay

In my application I catch a DragOver event and then perform an action. I'd like to wait for half a second before performing the action, the action should not be performed after that delay if the drag operation has ended. The only way I could think of to implement this feature is something like this: Function DragOver Event If TimerT...

Algorithm - Numbering for TOC (Table of Contents)

I want to implement a VBA function to number Excel rows based upon the grouping depth of the row. But I think a general algorithm for generating TOCs is more interesting. The problem is: Given a list of "indented" lines such as One Two Three Four Five Six (the "indentation level" may be assumed to be known and part of the in...

Can anyone would provide me an example of reference-based linked list?

I'm trying to create a reference based linked list anyone would be able to provide me an example of it?? ...