{"id":220288,"date":"2023-10-28T10:52:38","date_gmt":"2023-10-28T10:52:38","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/"},"modified":"2023-10-28T10:52:38","modified_gmt":"2023-10-28T10:52:38","slug":"how-to-find-max-and-min-value-in-array","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/","title":{"rendered":"How to find max and min value in array?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#How_to_find_max_and_min_value_in_an_array\" title=\"How to find max and min value in an array?\">How to find max and min value in an array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Frequently_Asked_Questions_FAQs\" title=\"Frequently Asked Questions (FAQs)\">Frequently Asked Questions (FAQs)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Is_it_necessary_to_sort_the_array_to_find_the_maximum_and_minimum_values\" title=\"Q: Is it necessary to sort the array to find the maximum and minimum values?\">Q: Is it necessary to sort the array to find the maximum and minimum values?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_What_if_the_array_is_empty\" title=\"Q: What if the array is empty?\">Q: What if the array is empty?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Can_this_algorithm_handle_arrays_with_negative_values\" title=\"Q: Can this algorithm handle arrays with negative values?\">Q: Can this algorithm handle arrays with negative values?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Is_it_possible_to_find_the_maximum_and_minimum_values_using_built-in_functions_in_programming_languages\" title=\"Q: Is it possible to find the maximum and minimum values using built-in functions in programming languages?\">Q: Is it possible to find the maximum and minimum values using built-in functions in programming languages?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Can_this_algorithm_handle_arrays_with_duplicate_values\" title=\"Q: Can this algorithm handle arrays with duplicate values?\">Q: Can this algorithm handle arrays with duplicate values?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_What_is_the_time_complexity_of_this_algorithm\" title=\"Q: What is the time complexity of this algorithm?\">Q: What is the time complexity of this algorithm?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Will_this_algorithm_work_for_multidimensional_arrays\" title=\"Q: Will this algorithm work for multidimensional arrays?\">Q: Will this algorithm work for multidimensional arrays?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Can_I_find_the_maximum_and_minimum_values_in_an_array_using_recursion\" title=\"Q: Can I find the maximum and minimum values in an array using recursion?\">Q: Can I find the maximum and minimum values in an array using recursion?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Is_it_possible_to_find_the_maximum_and_minimum_values_in_the_array_in_a_single_iteration\" title=\"Q: Is it possible to find the maximum and minimum values in the array in a single iteration?\">Q: Is it possible to find the maximum and minimum values in the array in a single iteration?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_How_can_I_adapt_this_algorithm_to_return_the_indices_of_the_maximum_and_minimum_values\" title=\"Q: How can I adapt this algorithm to return the indices of the maximum and minimum values?\">Q: How can I adapt this algorithm to return the indices of the maximum and minimum values?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Does_the_array_need_to_be_sorted_in_ascending_or_descending_order_for_this_algorithm_to_work\" title=\"Q: Does the array need to be sorted in ascending or descending order for this algorithm to work?\">Q: Does the array need to be sorted in ascending or descending order for this algorithm to work?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Can_I_use_this_algorithm_to_find_the_second_largest_and_second_smallest_values_in_the_array\" title=\"Q: Can I use this algorithm to find the second largest and second smallest values in the array?\">Q: Can I use this algorithm to find the second largest and second smallest values in the array?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Is_there_any_limitation_on_the_size_of_the_array_for_this_algorithm\" title=\"Q: Is there any limitation on the size of the array for this algorithm?\">Q: Is there any limitation on the size of the array for this algorithm?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#Q_Are_there_any_special_cases_where_this_algorithm_may_fail\" title=\"Q: Are there any special cases where this algorithm may fail?\">Q: Are there any special cases where this algorithm may fail?<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"How_to_find_max_and_min_value_in_an_array\"><\/span>How to find max and min value in an array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished using various algorithms. Here, we will discuss a simple approach to fulfill this objective.<\/p>\n<p>To find the maximum and minimum values in an array, you can follow these steps:<\/p>\n<p>1. Initialize two variables, <b>max<\/b> and <b>min<\/b>, with the first element of the array.<br \/>\n2. Iterate through the remaining elements of the array.<br \/>\n3. For each element, compare it with the current values of <b>max<\/b> and <b>min<\/b>.<br \/>\n4. If the element is greater than <b>max<\/b>, update the value of <b>max<\/b> with the element.<br \/>\n5. If the element is smaller than <b>min<\/b>, update the value of <b>min<\/b> with the element.<br \/>\n6. Repeat steps 3-5 until all elements have been examined.<br \/>\n7. After the iteration, the variables <b>max<\/b> and <b>min<\/b> will contain the maximum and minimum values in the array, respectively.<\/p>\n<p>Here&#8217;s an example implementation in JavaScript:<\/p>\n<p>&#8220;`javascript<br \/>\nfunction findMaxAndMin(arr) {<br \/>\n  let max = arr[0];<br \/>\n  let min = arr[0];<\/p>\n<p>  for (let i = 1; i < arr.length; i++) {<br \/>\n    if (arr[i] > max) {<br \/>\n      max = arr[i];<br \/>\n    }<br \/>\n    if (arr[i] < min) {<br \/>\n      min = arr[i];<br \/>\n    }<br \/>\n  }<\/p>\n<p>  return { max, min };<br \/>\n}<\/p>\n<p>const array = [22, 11, 45, 8, 78, 36];<br \/>\nconst result = findMaxAndMin(array);<\/p>\n<p>console.log(&#8220;Maximum value:&#8221;, result.max);<br \/>\nconsole.log(&#8220;Minimum value:&#8221;, result.min);<br \/>\n&#8220;`<\/p>\n<p>This implementation iterates through the array once, comparing the current element with the current known maximum and minimum values. If a larger maximum or smaller minimum is found, the corresponding variables are updated accordingly.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions_FAQs\"><\/span>Frequently Asked Questions (FAQs)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"Q_Is_it_necessary_to_sort_the_array_to_find_the_maximum_and_minimum_values\"><\/span>Q: Is it necessary to sort the array to find the maximum and minimum values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, sorting the array is not necessary. The approach described above allows you to find the maximum and minimum values without sorting the array.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_What_if_the_array_is_empty\"><\/span>Q: What if the array is empty?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nIf the array is empty, there are no elements to compare, and both the maximum and minimum values would be undefined.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Can_this_algorithm_handle_arrays_with_negative_values\"><\/span>Q: Can this algorithm handle arrays with negative values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, this algorithm works perfectly fine with arrays that contain negative values. The comparison operations consider the numerical values, regardless of their sign.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Is_it_possible_to_find_the_maximum_and_minimum_values_using_built-in_functions_in_programming_languages\"><\/span>Q: Is it possible to find the maximum and minimum values using built-in functions in programming languages?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, many programming languages provide built-in functions like `max` and `min` that can directly find the maximum and minimum values of an array.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Can_this_algorithm_handle_arrays_with_duplicate_values\"><\/span>Q: Can this algorithm handle arrays with duplicate values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, the algorithm can handle arrays with duplicate values. It will correctly identify the maximum and minimum values, regardless of their occurrence frequency.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_What_is_the_time_complexity_of_this_algorithm\"><\/span>Q: What is the time complexity of this algorithm?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nThe time complexity of this algorithm is O(n), where n is the number of elements in the array. This linear time complexity ensures efficient performance.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Will_this_algorithm_work_for_multidimensional_arrays\"><\/span>Q: Will this algorithm work for multidimensional arrays?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, this algorithm is designed for one-dimensional arrays. It won&#8217;t work as-is for multidimensional arrays where each element itself is an array.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Can_I_find_the_maximum_and_minimum_values_in_an_array_using_recursion\"><\/span>Q: Can I find the maximum and minimum values in an array using recursion?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nWhile recursion is possible for this task, it is generally not the most efficient approach. Iterative solutions, like the one explained above, are simpler and more efficient.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Is_it_possible_to_find_the_maximum_and_minimum_values_in_the_array_in_a_single_iteration\"><\/span>Q: Is it possible to find the maximum and minimum values in the array in a single iteration?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, the algorithm provided takes only a single iteration through the array to find both the maximum and minimum values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_How_can_I_adapt_this_algorithm_to_return_the_indices_of_the_maximum_and_minimum_values\"><\/span>Q: How can I adapt this algorithm to return the indices of the maximum and minimum values?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTo return the indices along with the maximum and minimum values, you can modify the algorithm to keep track of the indices while comparing the elements.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Does_the_array_need_to_be_sorted_in_ascending_or_descending_order_for_this_algorithm_to_work\"><\/span>Q: Does the array need to be sorted in ascending or descending order for this algorithm to work?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, the array can be in any order. The algorithm iterates through all the elements, comparing them to find the maximum and minimum values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Can_I_use_this_algorithm_to_find_the_second_largest_and_second_smallest_values_in_the_array\"><\/span>Q: Can I use this algorithm to find the second largest and second smallest values in the array?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, this particular algorithm finds only the maximum and minimum values in the array. To find the second largest and second smallest values, you would need a different approach.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Is_there_any_limitation_on_the_size_of_the_array_for_this_algorithm\"><\/span>Q: Is there any limitation on the size of the array for this algorithm?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nNo, there is no inherent limitation on the size of the array. The algorithm can handle arrays of any size, as long as the memory constraints of the programming language are not exceeded.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Are_there_any_special_cases_where_this_algorithm_may_fail\"><\/span>Q: Are there any special cases where this algorithm may fail?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nThis algorithm is designed to handle most cases. However, if the array contains extremely large or small values that exceed the range of the data type being used, the algorithm may fail to produce accurate results.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to find max and min value in an array? Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished using various algorithms. Here, we will discuss a simple approach to fulfill this objective. To find the maximum and minimum values in an array, you can &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to find max and min value in array?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#more-220288\">Read more<span class=\"screen-reader-text\">How to find max and min value in array?<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-220288","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to find max and min value in array?<\/title>\n<meta name=\"description\" content=\"How to find max and min value in an array? Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to find max and min value in array?\" \/>\n<meta property=\"og:description\" content=\"How to find max and min value in an array? Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-28T10:52:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"164\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Darla Clarke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Darla Clarke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/\"},\"author\":{\"name\":\"Darla Clarke\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/8fb46297981687fe77339d265491391e\"},\"headline\":\"How to find max and min value in array?\",\"datePublished\":\"2023-10-28T10:52:38+00:00\",\"dateModified\":\"2023-10-28T10:52:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/\"},\"wordCount\":796,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/\",\"name\":\"How to find max and min value in array?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2023-10-28T10:52:38+00:00\",\"dateModified\":\"2023-10-28T10:52:38+00:00\",\"description\":\"How to find max and min value in an array? Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to find max and min value in array?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/8fb46297981687fe77339d265491391e\",\"name\":\"Darla Clarke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Darla Clarke\"},\"description\":\"Guest author Darla Clarke has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to find max and min value in array?","description":"How to find max and min value in an array? Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished","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:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/","og_locale":"en_US","og_type":"article","og_title":"How to find max and min value in array?","og_description":"How to find max and min value in an array? Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished","og_url":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2023-10-28T10:52:38+00:00","og_image":[{"width":500,"height":164,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","type":"image\/png"}],"author":"Darla Clarke","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Darla Clarke","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/"},"author":{"name":"Darla Clarke","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/8fb46297981687fe77339d265491391e"},"headline":"How to find max and min value in array?","datePublished":"2023-10-28T10:52:38+00:00","dateModified":"2023-10-28T10:52:38+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/"},"wordCount":796,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/","url":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/","name":"How to find max and min value in array?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2023-10-28T10:52:38+00:00","dateModified":"2023-10-28T10:52:38+00:00","description":"How to find max and min value in an array? Finding the maximum and minimum values in an array is a common programming task that can be easily accomplished","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-find-max-and-min-value-in-array\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to find max and min value in array?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/8fb46297981687fe77339d265491391e","name":"Darla Clarke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Darla Clarke"},"description":"Guest author Darla Clarke has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/220288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=220288"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/220288\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=220288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=220288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=220288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}