public void Testadd() { var a = new MyDictionary.MyDictionary(); a.Add("aaa", "bbb"); int res = a.alikeWords; Assert.AreEqual(1, res); }
public void Testdelete() { var a = new MyDictionary.MyDictionary(); a.Add("aaa", "bbb"); a.Add("aaa", "bsaas"); a.Delete("aaa"); int v = a.alikeWords; Assert.AreEqual(0, v); }
public void Testd() { var a = new MyDictionary.MyDictionary(); a.Add("aaa", "bbb"); a.Add("nhf", "baaaa"); a.Collector(); var n = a.wordswithonevalue.Count; Assert.AreEqual(2, n); }
static void Main(string[] args) { MyDictionary <string, int> dictionary = new MyDictionary <string, int>(); dictionary.Add("Kodlama", 8); dictionary.Add("Geliştirme", 2); dictionary.Add("Eğitim", 5); dictionary.Add("Yazılım", 10); dictionary.Add("Bİlgisayar", 1); dictionary.Add("C#", 9); dictionary.Add("Kelime", 12); foreach (var key in dictionary.Keys) { Console.WriteLine("Key: " + key); } foreach (var value in dictionary.Values) { Console.WriteLine("Value: " + value); } }
static void Main(string[] args) { Console.WriteLine("Dictionary"); Dictionary <string, string> liste = new Dictionary <string, string>(); liste.Add("Adı", "Canan"); liste.Add("Soyadı", "Kan"); Console.WriteLine(liste.Count); foreach (KeyValuePair <string, string> item in liste) { Console.WriteLine(item.Key.ToString() + ":" + item.Value.ToString()); } Console.WriteLine(); Console.WriteLine("MyDictionary"); MyDictionary <string, string> liste2 = new MyDictionary <string, string>(); liste2.Add("Adı", "Veli"); liste2.Add("Adı", "Kan"); Console.WriteLine(liste2.Count()); liste2.List(); }
static void Main(string[] args) { MyDictionary <int, string> myDictionary = new MyDictionary <int, string>(); myDictionary.Add(333, "Burak"); myDictionary.Add(639, "Hasan"); myDictionary.Add(412, "Seda"); myDictionary.Add(1024, "Sinan"); myDictionary._Print(); Console.WriteLine("Key sayısı : " + myDictionary._KeyCount); Console.WriteLine("Value Sayısı : " + myDictionary._ValueCount); myDictionary.Clear(); //Sözlüğü siler. Console.WriteLine("\n ***Clear Metodundan Sonra \n"); Console.WriteLine("Key sayısı : " + myDictionary._KeyCount); Console.WriteLine("Value Sayısı : " + myDictionary._ValueCount); Console.WriteLine("\n"); myDictionary._Print(); }
static void Main(string[] args) { Dictionary <int, string> dizim1 = new Dictionary <int, string>(); dizim1.Add(1, "a"); MyDictionary <int, string> dizim = new MyDictionary <int, string>(); dizim.Add(1, "Nuri"); dizim.Add(2, "Bilge"); dizim.Add(3, "Ceylan"); dizim.Add(4, "İzel"); dizim.Add(5, "Çelik"); dizim.Add(6, "Ercan"); dizim.Add(7, "Mazhar"); dizim.Add(8, "Fuat"); dizim.Add(9, "Özkan"); Console.Write("Eleman Sayısı: "); dizim.Count(); dizim.ShowList(); }
static void Main(string[] args) { List <string> ogrenciler = new List <string>(); ogrenciler.Add("Çağrı"); ogrenciler.Add("Jale"); ogrenciler.Add("Engin"); ogrenciler.Add("Murat"); ogrenciler.Add("Ali"); Console.WriteLine(ogrenciler.Count); MyDictionary <string> ogrenciler1 = new MyDictionary <string>(); ogrenciler1.Add("Rana"); ogrenciler1.Add("Ferhat"); ogrenciler1.Add("Yunus"); ogrenciler1.Add("Berkay"); ogrenciler1.Add("Kenan"); ogrenciler1.Add("Ahmet"); Console.WriteLine(ogrenciler1.Count); }
static void Main(string[] args) { MyDictionary <string, string> Ogrenci = new MyDictionary <string, string>(); Ogrenci.Add("334", "Ersin"); Ogrenci.Add("376", "Şenol"); Ogrenci.Add("992", "Cemile"); Ogrenci.Add("222", "Kaan"); // Console.WriteLine(Ogrenci.MyLength); Ogrenci.PrintAll(); //Console.WriteLine(Ogrenci.Count); for (int a = 0; a < Ogrenci.MyLength; a++) { Console.WriteLine(Ogrenci.Items1[a] + " " + Ogrenci.Items2[a]); } }
static void Main(string[] args) { Console.WriteLine("Ekleyeceğiniz ürün miktarını yazınız"); int x = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Ekleyeceğiniz ürünün seri numarasını ve ismini giriniz:"); MyDictionary <int, string> myDictionary = new MyDictionary <int, string>(); for (int i = 1; i <= x; i++) { int y = Convert.ToInt32(Console.ReadLine()); string z = Console.ReadLine(); myDictionary.Add(y, z); Console.WriteLine("{0} nolu {1} ürünü eklendi.", y, z); Console.WriteLine(); if (i < x) { Console.WriteLine("{0}. ürünü giriniz", i + 1); } } }
static void Main(string[] args) { MyDictionary <string, int> burclar = new MyDictionary <string, int>(); burclar.Add(1, "Koç Burcu : 21 Mart – 20 Nisan"); burclar.Add(2, "Boğa Burcu : 21 Nisan – 21 Mayıs"); burclar.Add(3, "İkizler Burcu : 22 Mayıs – 22 Haziran"); burclar.Add(4, "Yengeç Burcu : 22 Haziran – 22 Temmuz"); burclar.Add(5, "Aslan Burcu : 23 Temmuz – 22 Ağustos"); burclar.Add(6, "Başak Burcu : 23 Ağustos – 22 Eylül"); burclar.Add(7, "Terazi Burcu : 23 Eylül – 22 Ekim"); burclar.Add(8, "Akrep Burcu : 23 Ekim – 21 Kasım"); burclar.Add(9, "Yay Burcu : 22 Kasım – 21 Aralık"); burclar.Add(10, "Oğlak Burcu : 22 Aralık – 21 Ocak"); burclar.Add(11, "Kova Burcu : 22 Ocak – 19 Şubat"); burclar.Add(12, "Balık Burcu : 20 Şubat – 20 Mart"); for (int i = 0; i < burclar.Keys.Length; i++) { Console.WriteLine("Key: " + burclar.Keys[i] + "\tValue: " + burclar.Values[i]); Console.WriteLine(); } }
static void Main(string[] args) { MyDictionary <int, string> name1 = new MyDictionary <int, string>(); name1.Add(1, "Bengisu"); name1.Add(2, "Nursu"); name1.Add(3, "Ahmet"); name1.Add(4, "Mehmet"); name1.Add(5, "Fatma"); name1.Add(6, "Mustafa"); Console.WriteLine("MyDictionary : " + name1.count); MyDictionary <int, string> name2 = new MyDictionary <int, string>(); name2.Add(1, "Kerem"); name2.Add(2, "Ayşe"); name2.Add(3, "Dicle"); name2.Add(4, "Mahmut"); name2.Add(5, "Efe"); name2.Add(6, "Mert"); Console.WriteLine("MyDictionary : " + name2.count); }
static void Main(string[] args) { Console.WriteLine("Hello MyDictionary!" + "\n"); MyDictionary <int, string> languages = new MyDictionary <int, string>(); languages.Add(1, "C#"); languages.Add(2, "Java"); languages.Add(3, "Python"); languages.Add(4, "Javascript"); foreach (var key in languages.Keys) { Console.WriteLine("Key: " + key); } foreach (var value in languages.Values) { Console.WriteLine("Value: " + value); } Console.ReadLine(); }
static void Main(string[] args) { //Dictionary<int, string> dictionary = new Dictionary<int, string>(); //dictionary.Add(1, "Adana"); //dictionary.Add(2, "Adıyaman"); //dictionary.Add(3, "Afyon"); //dictionary.Add(4, "Ağrı"); //dictionary.Add(5, "Amasya"); //dictionary.Add(6, "Ankara"); //Console.WriteLine(dictionary.Count); MyDictionary <int, string> myDictionary = new MyDictionary <int, string>(); myDictionary.Add(1, "Adana"); myDictionary.Add(2, "Adıyaman"); myDictionary.Add(3, "Afyon"); myDictionary.Add(4, "Ağrı"); myDictionary.Add(5, "Amasya"); myDictionary.Add(6, "Ankara"); Console.WriteLine(myDictionary.Count); }
static void Main(string[] args) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary.Add("a", "Fırat"); System.Console.WriteLine(dictionary.Count); MyDictionary <int, string> dictionary1 = new MyDictionary <int, string>(); dictionary1.Add(1, "Fırat"); dictionary1.Add(2, "Fırat2"); dictionary1.Add(3, "Fırat3"); foreach (var item in dictionary1.Values) { System.Console.WriteLine("Değer : " + item); } foreach (var item in dictionary1.Keys) { System.Console.WriteLine("Anahtar : " + item); } Console.WriteLine(dictionary1.Count); }
static void Main(string[] args) { MyDictionary <int, string> myDictionary = new MyDictionary <int, string>(); myDictionary.Add(1, "Yunus"); }
static void Main(string[] args) { MyDictionary <string, string> myDictionary = new MyDictionary <string, string>(); myDictionary.Add("Çağatay", "Çoban"); }
static void Main(string[] args) { MyDictionary <string> isimler = new MyDictionary <string>(); isimler.Add("Timur"); }
static void Main(string[] args) { MyDictionary <string> kelimeler = new MyDictionary <string>(); kelimeler.Add("Justice"); }
static void Main(string[] args) { MyDictionary <string, string> myDictionary = new MyDictionary <string, string>(); myDictionary.Add("Erdoğan", "IŞIK"); }
static void Main(string[] args) { // Console.WriteLine("My Dictionary"); MyDictionary <int, int> intDict = new MyDictionary <int, int>(); intDict.Insert(0, 5); intDict.Insert(1, 4); intDict.Insert(2, 3); intDict.Insert(3, 6); intDict.Insert(4, 7); //intDict.Insert(4, 1); foreach (Tuple <int, int> kvp in intDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } int value; bool found = intDict.GetValueByKey(3, out value); Console.WriteLine(String.Format("Value at key 3 is {0}, value found = {1}", value, found)); found = intDict.GetValueByKey(10, out value); Console.WriteLine(String.Format("Value key 10 found = {0}", found)); Console.WriteLine("------------------------------------------"); MyDictionary <int, string> intStringDict = new MyDictionary <int, string>(); intStringDict.Insert(0, "First"); intStringDict.Insert(1, "Second"); intStringDict.Insert(2, "Third"); intStringDict.Insert(3, "Fourth"); intStringDict.Insert(4, "Fifth"); intStringDict.Insert(5, "Sixth"); foreach (Tuple <int, string> kvp in intStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); MyDictionary <string, string> stringStringDict = new MyDictionary <string, string>(); stringStringDict.Insert("Zero", "First"); stringStringDict.Insert("One", "Second"); stringStringDict.Insert("Two", "Third"); stringStringDict.Insert("Three", "Fourth"); stringStringDict.Insert("Four", "Fifth"); stringStringDict.Insert("Five", "Sixth"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Removing Key Five..."); stringStringDict.RemoveKey("Five"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Removing Key Four..."); stringStringDict.RemoveKey("Four"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Removing Key Three..."); stringStringDict.RemoveKey("Three"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Removing Key Two..."); stringStringDict.RemoveKey("Two"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Removing Key One..."); stringStringDict.RemoveKey("One"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Removing Key Zero..."); stringStringDict.RemoveKey("Zero"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Removing Key Zero..."); stringStringDict.RemoveKey("Zero"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); stringStringDict.Insert("Zero", "First"); foreach (Tuple <string, string> kvp in stringStringDict) { Console.WriteLine(String.Format("Key: {0} :: Value {1}", kvp.Item1, kvp.Item2)); } Console.WriteLine("------------------------------------------"); Console.WriteLine("Press any key to contiue..."); Console.ReadKey(); }
static void Main(string[] args) { MyDictionary <int, string> myDictionary = new MyDictionary <int, string>(); myDictionary.Add(123, "Keş"); }
static void Main(string[] args) { myDictionary = new MyDictionary <string, string>(); Dictionary_Add(); Dictionary_List(); }
static void Main(string[] args) { MyDictionary <int, string> ogrenciler = new MyDictionary <int, string>(); ogrenciler.Add(1, "Fatih Sultan Mehmet"); }
static void Main(string[] args) { MyDictionary <int, string> ogranciler = new MyDictionary <int, string>(); }
static void Main(string[] args) { MyDictionary <int, string> dictionary = new MyDictionary <int, string>(); dictionary.Add(5, "orkun"); }
static void Main(string[] args) { MyDictionary <string, int> lisDictionary = new MyDictionary <string, int>(); lisDictionary.Add("yusuf", 2); }