Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Prototype DeepClone()
- {
- Dataset clone = new Dataset();
- for(int i=0;i<this.data.Count; i++)
- {
- clone.data.Add(new List<string>());
- for(int j=0;j<data[i].Count; j++)
- {
- clone.data[i].Add(this.data[i][j]);
- }
- }
- return clone;
- }
- ------------------------------
- static void Main(string[] args)
- {
- Dataset DATA = new Dataset("CSV.txt");
- Dataset CLONE = (Dataset)DATA.DeepClone();
- Print(DATA);
- Console.WriteLine();
- Print(CLONE);
- }
- public static void Print(Dataset DATA)
- {
- for (int i = 0; i < DATA.GetData().Count; i++)
- {
- for (int j = 0; j < DATA.GetData()[i].Count; j++)
- {
- Console.Write(DATA.GetData()[i][j] +", ");
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement