Skip to content

VDonC#ev

C{}d3

Categories

  • Abstract Data Structures
  • C# Algorithms
  • C# Snippets
  • Combinatorics
  • Java Algorithms
  • Java Snippets
  • Javascript Algorithms
  • PHP

Useful

  • Combinatorial Examples

MINI

Guess the number
Text 2 Array
Notepad

Recent Posts

  • Look And Say Sequence – PHP 7.4
  • Look and Say Sequence in PHP
  • Look and Say Sequence Generator – Javascript (ECMAscript 6)
  • Shortest Path In Graph – Dijkstra’s Algorithm – C# Implementation
  • Minimum Spanning Tree – Kruskal Algorithm – C# Implementation

Combinatorial Examples

Without Repetition With Repetition
Combinations
pick k from n where k < n
Order does not matter
\frac{n!}{(n-k)!k!}


C# Recursive Example
C# Iterative Example

\frac{(n+k-1)!}{(n-1)!k!}


C# Recursive Example

Permutations
arrange all elements
Order matters
n!


C# Recursive Example
C# Iterative Example

\frac{(\sum n_i)!}{(\Pi(n_i!)}


C# Recursive Example

Variations
arrange and pick k from n where k < n
Order matters
\frac{n!}{(n-k)!}


C# Recursive Example

n^k


C# Recursive Example
C# Iterative Example

Proudly powered by WordPress