{"id":1130,"date":"2023-06-19T09:00:00","date_gmt":"2023-06-19T09:00:00","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=1130"},"modified":"2023-06-18T15:22:11","modified_gmt":"2023-06-18T15:22:11","slug":"c-dictionary-vs-list","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/","title":{"rendered":"C# Dictionary vs. List: Choosing the Right Data Structure"},"content":{"rendered":"\n<p>When working with data in <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/\" target=\"_blank\" rel=\"noreferrer noopener\">C#<\/a>, selecting the appropriate data structure is vital for efficient and optimized programming, C# Dictionary vs. List. Two commonly used data structures are the Dictionary and List. In this article, I&#8217;ll compare the Dictionary and List data structures, examining their characteristics and exploring scenarios where each excels. This will enable you to decide between the two for your specific programming needs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"720\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail.png\" loading=\"lazy\" alt=\"C# Dictionary vs. List\" class=\"wp-image-1134\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail.png 1280w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-300x169.png 300w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-1024x576.png 1024w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/06\/Green-Modern-Discussion-Topic-Youtube-Thumbnail-768x432.png 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding the Dictionary Data Structure<\/h2>\n\n\n\n<p>A <strong>Dictionary<\/strong> in C# is a <strong>collection of key-value pairs<\/strong>, providing fast access to values based on unique keys. It is implemented using hash tables, ensuring efficient searching and retrieval. Let&#8217;s look at an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Dictionary&lt;string, int&gt; studentScores = new Dictionary&lt;string, int&gt;();\nstudentScores.Add(\"John\", 90);\nstudentScores.Add(\"Lisa\", 85);\nstudentScores.Add(\"Mike\", 92);\n\nint score = studentScores&#091;\"John\"]; \/\/ Retrieve value by key\nConsole.WriteLine($\"John's score: {score}\");\n<\/code><\/pre>\n\n\n\n<p>In this example, we create a Dictionary named <strong>studentScores<\/strong>, where the keys are <strong>students&#8217; names<\/strong> (<strong>strings<\/strong>), and the <strong>values<\/strong> are their <strong>scores<\/strong> (<strong>integers<\/strong>). We can retrieve a specific student&#8217;s score by using their name as the key.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Exploring the List Data Structure<\/h2>\n\n\n\n<p>In contrast, a List in <strong>C#<\/strong> is an <strong>ordered collection of elements<\/strong>, allowing access based on position or index. It dynamically resizes itself as needed. Let&#8217;s see an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>List&lt;string&gt; fruits = new List&lt;string&gt;();\nfruits.Add(\"Apple\");\nfruits.Add(\"Banana\");\nfruits.Add(\"Orange\");\n\nstring firstFruit = fruits&#091;0]; \/\/ Access element by index\nConsole.WriteLine($\"First fruit: {firstFruit}\");\n<\/code><\/pre>\n\n\n\n<p>In this example, we create a List named <strong>fruits<\/strong> to store the names of fruits. We can access a specific fruit by using its index within the List.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Choosing the Right Data Structure | C# Dictionary vs. List<\/h2>\n\n\n\n<p>To determine whether to use a Dictionary or a List, consider the following factors:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Data Retrieval<\/h3>\n\n\n\n<p>If your primary requirement is <strong>fast data retrieval<\/strong> based on keys, a Dictionary is the better choice. Dictionaries provide constant-time complexity <strong>O(1)<\/strong> for retrieving values based on keys. Here&#8217;s an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int score = studentScores&#091;\"John\"]; \/\/ Retrieve value by key<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Sequential Access and Indexing<\/h3>\n\n\n\n<p>If your main concern is sequential access or indexing operations, a List is more suitable. Lists maintain the order of elements and allow for efficient sequential iteration. Here&#8217;s an example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>string firstFruit = fruits&#091;0]; \/\/ Access element by index<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Memory Usage<\/h3>\n\n\n\n<p>Consider the memory usage when deciding between a Dictionary and a List. Dictionaries require additional memory to store the key-value pairs and manage the hash table. Lists, on the other hand, are more memory-efficient since they only store the elements without associated keys.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Duplicate Keys or Elements<\/h3>\n\n\n\n<p>If your data includes duplicate keys or you require duplicate elements, a List is the better choice. Lists allow duplicate elements and preserve the order of insertion. Dictionaries, on the other hand, enforce unique keys and overwrite existing values if a duplicate key is added.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Complexity Considerations<\/h3>\n\n\n\n<p>Keep in mind the complexity of operations when selecting a data structure. Dictionaries have constant-time complexity for retrieval but may have higher overhead for insertion and deletion due to hash table management. Lists have linear-time complexity <strong>O(n)<\/strong> for searching, insertion, and deletion but perform well for sequential access.<\/p>\n\n\n\n<p>Read more useful <a href=\"https:\/\/www.naveedulhaq.com\/index.php\/category\/dot-net-core\/\" target=\"_blank\" rel=\"noreferrer noopener\">C# Blogs here!<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrap up<\/h2>\n\n\n\n<p>Choosing between a Dictionary and a List in C# depends on the specific requirements of your application. If you need fast retrieval based on keys or unique key-value pairs, a Dictionary is the optimal choice. On the other hand, if you require an ordered collection, sequential access, or indexing operations, a List is more suitable. Consider the characteristics, advantages, and trade-offs of each data structure to make an informed decision and ensure optimal performance and efficiency in your C# programs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Choosing between a Dictionary and a List in C# depends on the specific requirements of your application.<\/p>\n","protected":false},"author":3,"featured_media":641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[11,8,62,37,32,56],"class_list":["post-1130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dot-net-core","tag-dot-net-core","tag-dot-net-framework","tag-asp-net","tag-c","tag-developer","tag-visual-studio"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C# Dictionary vs. List: Choosing the Right Data Structure - Naveed Ul-Haq&#039;s blog<\/title>\n<meta name=\"description\" content=\"Choosing between a Dictionary and a List in C# depends on the specific requirements of your application. - Naveed Ul-Haq&#039;s blog\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# Dictionary vs. List: Choosing the Right Data Structure - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Choosing between a Dictionary and a List in C# depends on the specific requirements of your application. - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-19T09:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png\" \/>\n\t<meta property=\"og:image:width\" content=\"240\" \/>\n\t<meta property=\"og:image:height\" content=\"240\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abdul Mannan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abdul Mannan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/\"},\"author\":{\"name\":\"Abdul Mannan\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/8babf3cd198e47e5c727f67880ea7977\"},\"headline\":\"C# Dictionary vs. List: Choosing the Right Data Structure\",\"datePublished\":\"2023-06-19T09:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/\"},\"wordCount\":543,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"keywords\":[\".net core\",\".net framework\",\"asp.net\",\"c#\",\"developer\",\"visual-studio\"],\"articleSection\":[\".NET\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/\",\"name\":\"C# Dictionary vs. List: Choosing the Right Data Structure - Naveed Ul-Haq&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"datePublished\":\"2023-06-19T09:00:00+00:00\",\"description\":\"Choosing between a Dictionary and a List in C# depends on the specific requirements of your application. - Naveed Ul-Haq&#039;s blog\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/240px-.NET_Logo.svg_.png\",\"width\":240,\"height\":240,\"caption\":\".net\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/c-dictionary-vs-list\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# Dictionary vs. List: Choosing the Right Data Structure\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\",\"name\":\"Naveed Ul-Haq's blog\",\"description\":\"AI, Optimizely, Azure &amp; more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.naveedulhaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\",\"name\":\"Naveed Ul-Haq\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"caption\":\"Naveed Ul-Haq\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\"},\"description\":\"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\\\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\\\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.\",\"sameAs\":[\"https:\\\/\\\/www.naveedulhaq.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedulhaq\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/8babf3cd198e47e5c727f67880ea7977\",\"name\":\"Abdul Mannan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g\",\"caption\":\"Abdul Mannan\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C# Dictionary vs. List: Choosing the Right Data Structure - Naveed Ul-Haq&#039;s blog","description":"Choosing between a Dictionary and a List in C# depends on the specific requirements of your application. - Naveed Ul-Haq&#039;s blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/","og_locale":"en_GB","og_type":"article","og_title":"C# Dictionary vs. List: Choosing the Right Data Structure - Naveed Ul-Haq&#039;s blog","og_description":"Choosing between a Dictionary and a List in C# depends on the specific requirements of your application. - Naveed Ul-Haq&#039;s blog","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2023-06-19T09:00:00+00:00","og_image":[{"width":240,"height":240,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","type":"image\/png"}],"author":"Abdul Mannan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abdul Mannan","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/"},"author":{"name":"Abdul Mannan","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/8babf3cd198e47e5c727f67880ea7977"},"headline":"C# Dictionary vs. List: Choosing the Right Data Structure","datePublished":"2023-06-19T09:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/"},"wordCount":543,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","keywords":[".net core",".net framework","asp.net","c#","developer","visual-studio"],"articleSection":[".NET"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/","name":"C# Dictionary vs. List: Choosing the Right Data Structure - Naveed Ul-Haq&#039;s blog","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","datePublished":"2023-06-19T09:00:00+00:00","description":"Choosing between a Dictionary and a List in C# depends on the specific requirements of your application. - Naveed Ul-Haq&#039;s blog","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/11\/240px-.NET_Logo.svg_.png","width":240,"height":240,"caption":".net"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/c-dictionary-vs-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"C# Dictionary vs. List: Choosing the Right Data Structure"}]},{"@type":"WebSite","@id":"https:\/\/www.naveedulhaq.com\/#website","url":"https:\/\/www.naveedulhaq.com\/","name":"Naveed Ul-Haq's blog","description":"AI, Optimizely, Azure &amp; more","publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.naveedulhaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9","name":"Naveed Ul-Haq","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","caption":"Naveed Ul-Haq"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g"},"description":"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.","sameAs":["https:\/\/www.naveedulhaq.com","https:\/\/www.linkedin.com\/in\/naveedulhaq\/"]},{"@type":"Person","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/8babf3cd198e47e5c727f67880ea7977","name":"Abdul Mannan","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7021bf97f2da3c29882f0e194e341d6abcc2b18abbbbf1e8ea688017b2323d21?s=96&d=mm&r=g","caption":"Abdul Mannan"}}]}},"_links":{"self":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/1130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/comments?post=1130"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/1130\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/641"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=1130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=1130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=1130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}