using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Memory_understanding { class Reapting_elements { public void getfirstrepeatingelements(int[] arr) { int min = -1; int element=0; HashSet<int> set = new HashSet<int>(); for (int i = arr.Length-1; i >= 0; i--) { if(set.Contains(arr[i])) { min=i; element=arr[i]; ...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Threading; using System.IO; namespace Memory_understanding { class writer { //private static Mutex mutex = new Mutex(); public void writer_method(string inputline) { Monitor.Enter(this); using (StreamWriter str = new StreamWriter("sharedfile.txt",true)) { str.WriteLine(inputline); ...
Comments
Post a Comment