Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace DemoSortedDictionary
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- SortedDictionary<int, string> people = new SortedDictionary<int, string>();
- //ключовете да са сортирани в ascending order (нарастващ ред)
- people.Add(34, "Aleks");
- people.Add(10, "Pesho");
- people.Add(23, "Gosho");
- //10 -> Pesho
- //23 -> Gosho
- //34 -> Aleks
- Console.WriteLine(people.Count);
- SortedDictionary<string, int> animals = new SortedDictionary<string, int>();
- //ключовете да са сортирани в ascending order (азбучен ред) -> a към z
- animals.Add("zebra", 1500);
- animals.Add("elephant", 3500);
- animals.Add("antilope", 700);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment