{"id":2591,"date":"2021-08-27T00:51:34","date_gmt":"2021-08-27T00:51:34","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=2591"},"modified":"2021-09-03T06:34:37","modified_gmt":"2021-09-03T06:34:37","slug":"there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/","title":{"rendered":"There are 2 buildings and on each\u2019s window, a flower pot is kept. Ravi\u2019s mother tells him to multiply each cell\/window to the other and store in a matrix ? What would be time complexity if he writes a code to do so ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<p class=\"color-pink\">There are 2 buildings and on each\u2019s window, a flower pot is kept. Ravi\u2019s mother tells him to multiply each cell\/window to the other and store in a matrix ? What would be time complexity if he writes a code to do so ?<\/p>\n<div class=\"row\">\n<div class=\"col-sm-6\">\n<p>A. Omega(n)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>B. Omega(n<sup>2<\/sup>)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>C. Theta (n)<\/p>\n<\/div>\n<div class=\"col-sm-6\">\n<p>D. Theta (n<sup>2<\/sup>)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 id=\"answer-d-thetan2\"><b>Answer :\u00a0<\/b>D. Theta(n<sup>2<\/sup>)<\/h3>\n<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"explanation\">Explanation:<\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li>The multiplication involved will use two for loops and hence the complexity will be Theta(n<sup>2<\/sup>)<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer :\u00a0D. Theta(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":[16231,16221,16222,16224,16225,16227,16228,16235,16214,16236,16229,16276,16230,16232,16237,16233,16234,3121,16223,16226],"class_list":["post-2591","post","type-post","status-publish","format-standard","hentry","category-programming","tag-a-flower-pot-is-kept","tag-c-how-do-i-find-the-time-complexity-big-o","tag-c-time-complexity-analysis-in-finding-index","tag-finding-time-complexity-of-algorithms-using-big-o","tag-how-to-analyse-time-complexity","tag-how-to-calculate-time-complexity-for-a-given-algorithm","tag-how-to-calculate-time-complexity-of-a-program-in-c","tag-how-to-calculate-time-complexity-of-nested-loops","tag-how-to-find-time-complexity-of-an-algorithm","tag-how-to-reduce-time-complexity-of-for-loop","tag-java-what-is-time-complexity-and-how-to-find-it","tag-most-asked-sapient-nitro-interview-questions","tag-there-are-2-buildings-and-on-eachs-window","tag-time-and-space-complexity","tag-time-complexity-analysis","tag-time-complexity-calculation-examples","tag-time-complexity-examples","tag-time-complexity-of-algorithms","tag-time-complexity-of-algorithms-examples","tag-time-complexity-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>There are 2 buildings and on each\u2019s window, a flower pot is kept -Wikitechy<\/title>\n<meta name=\"description\" content=\"There are 2 buildings and on each\u2019s window - Programming - The multiplication involved will use two for loops and hence the complexity will be Theta(n2).\" \/>\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\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"There are 2 buildings and on each\u2019s window, a flower pot is kept -Wikitechy\" \/>\n<meta property=\"og:description\" content=\"There are 2 buildings and on each\u2019s window - Programming - The multiplication involved will use two for loops and hence the complexity will be Theta(n2).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-27T00:51:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-03T06:34:37+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\\\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\\\/\"},\"author\":{\"name\":\"Editor\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"headline\":\"There are 2 buildings and on each\u2019s window, a flower pot is kept. Ravi\u2019s mother tells him to multiply each cell\\\/window to the other and store in a matrix ? What would be time complexity if he writes a code to do so ?\",\"datePublished\":\"2021-08-27T00:51:34+00:00\",\"dateModified\":\"2021-09-03T06:34:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\\\/\"},\"wordCount\":121,\"commentCount\":0,\"keywords\":[\"a flower pot is kept\",\"c - How do I find the time complexity (Big O)\",\"c - Time complexity analysis in finding index\",\"Finding time complexity of algorithms using big-O\",\"How to analyse time complexity\",\"how to calculate time complexity for a given algorithm\",\"how to calculate time complexity of a program in c\",\"how to calculate time complexity of nested loops\",\"How to find time complexity of an algorithm\",\"how to reduce time complexity of for loop\",\"java - What is time complexity and how to find it\",\"Most Asked Sapient Nitro Interview Questions\",\"There are 2 buildings and on each\u2019s window\",\"Time and Space Complexity\",\"time complexity analysis\",\"time complexity calculation examples\",\"time complexity examples\",\"time complexity of algorithms\",\"time complexity of algorithms examples\",\"time complexity tutorial\"],\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\\\/\",\"url\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\\\/\",\"name\":\"There are 2 buildings and on each\u2019s window, a flower pot is kept -Wikitechy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#website\"},\"datePublished\":\"2021-08-27T00:51:34+00:00\",\"dateModified\":\"2021-09-03T06:34:37+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/#\\\/schema\\\/person\\\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"There are 2 buildings and on each\u2019s window - Programming - The multiplication involved will use two for loops and hence the complexity will be Theta(n2).\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.wikitechy.com\\\/interview-questions\\\/programming\\\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\\\/\"]}]},{\"@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":"There are 2 buildings and on each\u2019s window, a flower pot is kept -Wikitechy","description":"There are 2 buildings and on each\u2019s window - Programming - The multiplication involved will use two for loops and hence the complexity will be Theta(n2).","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\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/","og_locale":"en_US","og_type":"article","og_title":"There are 2 buildings and on each\u2019s window, a flower pot is kept -Wikitechy","og_description":"There are 2 buildings and on each\u2019s window - Programming - The multiplication involved will use two for loops and hence the complexity will be Theta(n2).","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/","og_site_name":"Wikitechy","article_published_time":"2021-08-27T00:51:34+00:00","article_modified_time":"2021-09-03T06:34:37+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\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/#article","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/"},"author":{"name":"Editor","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"headline":"There are 2 buildings and on each\u2019s window, a flower pot is kept. Ravi\u2019s mother tells him to multiply each cell\/window to the other and store in a matrix ? What would be time complexity if he writes a code to do so ?","datePublished":"2021-08-27T00:51:34+00:00","dateModified":"2021-09-03T06:34:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/"},"wordCount":121,"commentCount":0,"keywords":["a flower pot is kept","c - How do I find the time complexity (Big O)","c - Time complexity analysis in finding index","Finding time complexity of algorithms using big-O","How to analyse time complexity","how to calculate time complexity for a given algorithm","how to calculate time complexity of a program in c","how to calculate time complexity of nested loops","How to find time complexity of an algorithm","how to reduce time complexity of for loop","java - What is time complexity and how to find it","Most Asked Sapient Nitro Interview Questions","There are 2 buildings and on each\u2019s window","Time and Space Complexity","time complexity analysis","time complexity calculation examples","time complexity examples","time complexity of algorithms","time complexity of algorithms examples","time complexity tutorial"],"articleSection":["Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/","name":"There are 2 buildings and on each\u2019s window, a flower pot is kept -Wikitechy","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-08-27T00:51:34+00:00","dateModified":"2021-09-03T06:34:37+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"There are 2 buildings and on each\u2019s window - Programming - The multiplication involved will use two for loops and hence the complexity will be Theta(n2).","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/programming\/there-are-2-buildings-and-on-eachs-window-a-flower-pot-is-kept-ravis-mother-tells-him-to-multiply-each-cell-window-to-the-other-and-store-in-a-matrix-what-would-be-time-complexit\/"]}]},{"@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\/2591","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=2591"}],"version-history":[{"count":2,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2591\/revisions"}],"predecessor-version":[{"id":2684,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/2591\/revisions\/2684"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=2591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=2591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=2591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}