User Tools

Site Tools


computer_science:programming:algorithm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computer_science:programming:algorithm [2021/09/25 20:38] manacomputer_science:programming:algorithm [2021/10/14 03:35] (current) – [Gauss Sum] mana
Line 85: Line 85:
  
 ===== Sequential Search ===== ===== Sequential Search =====
-Data set of N elements: ''13'' ''4'' ''-20'' ''45'' ''112'' ''・・・'' ''N=10¹³ / 38944''+Data set of N elements: ''13'' ''4'' ''-20'' ''45'' ''112'' ・・・ ''N=10¹³ / 38944''
 Therefore the list will be L<sub>1</sub>, L<sub>2</sub>, L<sub>3</sub>... L<sub>N</sub> Therefore the list will be L<sub>1</sub>, L<sub>2</sub>, L<sub>3</sub>... L<sub>N</sub>
 Target: 45 〇 130 × Target: 45 〇 130 ×
Line 105: Line 105:
 Step 9 stop Step 9 stop
 </code> </code>
 +
 +===== The Swap =====
 +x y
 +5 3
 +Swap the content of both variable so that X=3 and Y=5
 +<code>
 +Step 1 get x, y
 +Step 2 set temp = x
 +Step 3 x = y
 +Step 4 y = temp
 +Stop 5 Stop
 +</code>
 +
 +* For swapping in other algorithm ''swap(x,y)'' can be used instead.
 +
 +===== Gauss Sum =====
 +n ≥ 1 
 +1+2+3+4+...+n
 +
 +Formula: $\frac{(n+1)*n}{2}$  $\Theta$
 +FIXME (double check this information)
 +When talking about efficiency we say that the efficiency of n is $\Theta(n^2)$
 +
computer_science/programming/algorithm.1632569901.txt.gz · Last modified: 2021/09/25 20:38 by mana