Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Fusion
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here List<int> U=new List<int>(){1,2,3,3,6,7,8}; List <int> V=new List<int>(){0,4,5,7}; U=fusion(U,V); foreach(int a in U) Console.WriteLine(a); } public static List<int> fusion (List<int> U, List<int> V){ List<int> l=new List<int>(); if (U.Count==0) return(V); else if (V.Count==0) return(U); else if (U[0]<=V[0]){ l=fusion(U.GetRange(1, U.Count-1),V); l.Insert(0, U[0]); return(l); } else { l=fusion(U,V.GetRange(1, V.Count-1)); l.Insert(0, V[0]); return(l); } } } }
run
|
edit
|
history
|
help
0
nr
sdfgtgrfedcdf
PYRAMIDPATTERN
out parameters
tablecsv
s 3
Strings Mix Complete
SortedDictionary : Add と foreach
Fibonacci and finding nth fibo number
ASCII table generator