{"id":2587,"date":"2021-08-27T00:44:12","date_gmt":"2021-08-27T00:44:12","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=2587"},"modified":"2021-09-20T10:56:04","modified_gmt":"2021-09-20T10:56:04","slug":"what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/","title":{"rendered":"What is the time complexity of adding three matrices of size NXN cell-by-cell ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<p class=\"color-pink\">What is the time complexity of adding three matrices of size NXN cell-by-cell ?<\/p>\n<div class=\"row\">\n<div class=\"col-sm-6\">\n<p>A. O(N)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>B. O(N<sup>2<\/sup>)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>C. O(N<sup>3<\/sup>)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>D. None of these<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-b-on2\"><b>Answer :\u00a0<\/b>B. O(N<sup>2<\/sup>)<\/h3>\n<div class=\"subheading\">\n<h2 id=\"explanation\">Explanation :<\/h2>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>Time complexity will be O(n<sup>2<\/sup>), because if we add all the elements one by one to other matrics we have to traverse the whole matrix at least 1 time and traversion takes O(n<sup>2<\/sup>) times.<\/li>\n<li>With this traversion we add 3 elements of location [ i, j ] and storing the result on other matrix at [ i, j ] location.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer :\u00a0B. O(N2)<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15949],"tags":[16158,16520,16161,16159,16155,16154,16156,16150,16157,16160,16162,16153,16152,16151],"class_list":["post-2587","post","type-post","status-publish","format-standard","hentry","category-programming","tag-adding-two-nxn-matrices","tag-amcat-previous-papers-with-solutions","tag-complexity-of-addition-of-two-matrices","tag-complexity-of-matrix-multiplication-algorithm","tag-if-the-depth-of-a-tree-is-3-levels","tag-in-which-area-of-a-class-are-data-and-function-directly-accessible-outside-the-class","tag-then-what-is-the-size-of-the-tree","tag-time-complexity-of-adding-three-matrices","tag-time-complexity-of-adding-two-matrices","tag-time-complexity-of-adding-two-numbers","tag-time-complexity-of-addition","tag-what-is-the-complexity-of-matrix-addition","tag-what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn","tag-what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is the time complexity of adding three matrices of size NXN cell<\/title>\n<meta name=\"description\" content=\"What is the time complexity of adding three matrices of size NXN cell-by-cell ? - Time complexity will be O(n2), because if we add all the elements one by one to other matrics\" \/>\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.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the time complexity of adding three matrices of size NXN cell\" \/>\n<meta property=\"og:description\" content=\"What is the time complexity of adding three matrices of size NXN cell-by-cell ? - Time complexity will be O(n2), because if we add all the elements one by one to other matrics\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-27T00:44:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-20T10:56:04+00:00\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\\\/\"},\"author\":{\"name\":\"Editor\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"headline\":\"What is the time complexity of adding three matrices of size NXN cell-by-cell ?\",\"datePublished\":\"2021-08-27T00:44:12+00:00\",\"dateModified\":\"2021-09-20T10:56:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\\\/\"},\"wordCount\":100,\"commentCount\":0,\"keywords\":[\"adding two nxn matrices\",\"AMCAT Previous Papers with Solutions\",\"complexity of addition of two matrices\",\"complexity of matrix multiplication algorithm\",\"if the depth of a tree is 3 levels\",\"in which area of a class are data and function directly accessible outside the class\",\"then what is the size of the tree?\",\"Time Complexity of Adding Three Matrices\",\"time complexity of adding two matrices\",\"time complexity of adding two numbers\",\"time complexity of addition\",\"What is the complexity of matrix addition?\",\"What is the time complexity of adding three matrices of size NXN\",\"What is the time complexity of adding three matrices of size NXN cell\"],\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\\\/\",\"name\":\"What is the time complexity of adding three matrices of size NXN cell\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"datePublished\":\"2021-08-27T00:44:12+00:00\",\"dateModified\":\"2021-09-20T10:56:04+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"What is the time complexity of adding three matrices of size NXN cell-by-cell ? - Time complexity will be O(n2), because if we add all the elements one by one to other matrics\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/author\\\/editor\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the time complexity of adding three matrices of size NXN cell","description":"What is the time complexity of adding three matrices of size NXN cell-by-cell ? - Time complexity will be O(n2), because if we add all the elements one by one to other matrics","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.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/","og_locale":"en_US","og_type":"article","og_title":"What is the time complexity of adding three matrices of size NXN cell","og_description":"What is the time complexity of adding three matrices of size NXN cell-by-cell ? - Time complexity will be O(n2), because if we add all the elements one by one to other matrics","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/","og_site_name":"Wikitechy","article_published_time":"2021-08-27T00:44:12+00:00","article_modified_time":"2021-09-20T10:56:04+00:00","author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/"},"author":{"name":"Editor","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"headline":"What is the time complexity of adding three matrices of size NXN cell-by-cell ?","datePublished":"2021-08-27T00:44:12+00:00","dateModified":"2021-09-20T10:56:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/"},"wordCount":100,"commentCount":0,"keywords":["adding two nxn matrices","AMCAT Previous Papers with Solutions","complexity of addition of two matrices","complexity of matrix multiplication algorithm","if the depth of a tree is 3 levels","in which area of a class are data and function directly accessible outside the class","then what is the size of the tree?","Time Complexity of Adding Three Matrices","time complexity of adding two matrices","time complexity of adding two numbers","time complexity of addition","What is the complexity of matrix addition?","What is the time complexity of adding three matrices of size NXN","What is the time complexity of adding three matrices of size NXN cell"],"articleSection":["Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/","name":"What is the time complexity of adding three matrices of size NXN cell","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-08-27T00:44:12+00:00","dateModified":"2021-09-20T10:56:04+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"What is the time complexity of adding three matrices of size NXN cell-by-cell ? - Time complexity will be O(n2), because if we add all the elements one by one to other matrics","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/programming\/what-is-the-time-complexity-of-adding-three-matrices-of-size-nxn-cell-by-cell\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=2587"}],"version-history":[{"count":1,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2587\/revisions"}],"predecessor-version":[{"id":2594,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2587\/revisions\/2594"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=2587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=2587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=2587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}