MCPcopy Create free account
hub / github.com/apna-college/Alpha / friendsPairing

Method friendsPairing

7_RecursionBasics/RecursionBasics.java:141–147  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

139 }
140
141 public static int friendsPairing(int n) {
142 if(n == 1 || n == 2) {
143 return n;
144 }
145
146 return friendsPairing(n-1) + (n-1) * friendsPairing(n-2);
147 }
148
149 public static void printBinStrings(int n, int lastPlace, String str) {
150 //base case

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected