Skip to main content
10 votes
Accepted

What does " i , j <-- 1"mean in pseudocode?

Assuming this is the algorithm for a Fibonacci number generator, it represents simultaneous/parallel assignment; the comma is not separating two statements, but two operands to the <- operator. In ...
IMSoP's user avatar
  • 5,957
8 votes

Meaning of infinity sign in pseudocode?

That line (3) is simply saying initialize the Minimum value to the highest feasible value. In pseudocode that is infinity. If min was UInt32 in real code, then min would be UInt32.Max. In other ...
Sentinel's user avatar
  • 432
4 votes
Accepted

Parallel execution: 1 thread pool or N thread pools?

There are two basic reasons to run a thread pool. Creating threads as you go is expensive. With a pool, you create them only once, and re-use them as needed, saving the overhead. The optimum number of ...
John Wu's user avatar
  • 27k
3 votes

Scrabble Grid Word Detection Algorithm

To detect a 'word' start with the square in which a tile has been placed and check adjacent squares for tiles. If a tile is found follow the squares in the same direction untill you reach an empty ...
Ewan's user avatar
  • 84.6k
3 votes

Algorithm to identify differences between two sorted data sets

I would simplify WHILE LEFT_DATA_NOT_EOF AND RIGHT_DATA_NOT_EOF IF LEFT_KEY IS LESS THAN RIGHT_KEY PRINT LEFT_KEY LEFT_DATA_NOT_EOF = CALL READ_LEFT_RECORD() ELSE IF ...
paparazzo's user avatar
  • 1,927
3 votes

What does " i , j <-- 1"mean in pseudocode?

It most likely is a tuple assignment, i.e. assigning multiple values on the right to multiple variables on the left, with a shortcut to have only one value on the right which will be assigned to all ...
Michael Borgwardt's user avatar
3 votes

Algorithm for scheduling shifts

The supposed algorithm will not work, because it contains no collision handling. But there is a simple way to extend it to make it at least produce some solution: in step 1, if there are collisions ...
Doc Brown's user avatar
  • 221k
3 votes

Inefficient Pseudocode

Improving the pseudocode structure In line 7 it appears that you restart every time you find a new element to add to D. However, in pseudocode and mathematical language, you have no guarantee about ...
Christophe's user avatar
  • 82.3k
2 votes

Many if conditions

You have many conditions, and you have results that are created by combining data for true conditions. Creat a class that can combine these values. Then your code might look like StringResult calcs;...
gnasher729's user avatar
  • 49.4k
2 votes

Scrabble Grid Word Detection Algorithm

If you separate the problem into smaller pieces, you will see that this is not as hard. Note that since you did not post any code, I can't give you the direct answer, but I'll help you get started on ...
Flater's user avatar
  • 59.5k
2 votes

Algorithm for scheduling shifts

It sounds like you are trying to solve the "Nurse Scheduling Problem" (NSP), although your problem seems to be a simplified version of it. There are many articles written about how to find feasible ...
David's user avatar
  • 21
1 vote

Should I write integration test that test my code with real-network servers, before I start writing my code?

You need a development or test environment which has these things setup the same as you live environment. Sure it takes time and maybe for your particular case cutting corners is fine. But generally ...
Ewan's user avatar
  • 84.6k

Only top scored, non community-wiki answers of a minimum length are eligible