<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jpt code</title>
    <description>The latest articles on DEV Community by jpt code (@jptlearn).</description>
    <link>https://dev.to/jptlearn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2801875%2F3f9473d1-8385-4021-85a7-104355f92016.jpg</url>
      <title>DEV Community: jpt code</title>
      <link>https://dev.to/jptlearn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jptlearn"/>
    <language>en</language>
    <item>
      <title>How to measure Time Complexity and Space Complexity?</title>
      <dc:creator>jpt code</dc:creator>
      <pubDate>Sun, 02 Feb 2025 16:53:40 +0000</pubDate>
      <link>https://dev.to/jptlearn/how-to-measure-time-complexity-and-space-complexity-203p</link>
      <guid>https://dev.to/jptlearn/how-to-measure-time-complexity-and-space-complexity-203p</guid>
      <description>&lt;p&gt;Before diving into measuring time and space complexity, let's understand asymptotic notation. As described earlier, asymptotic notation helps us simply and &lt;strong&gt;compare growth trends&lt;/strong&gt; without getting lost in small details. Mathematically, it helps us understand how a function changes when it's variable approaches infinity.&lt;/p&gt;

&lt;p&gt;Among the three key asymptotic notation, Big O notation is particularly used in describing the &lt;strong&gt;upper bound&lt;/strong&gt; of an algorithm's growth rate, describing the &lt;strong&gt;worst-case scenario&lt;/strong&gt;. In simple term, it tells us the maximum amount of time or space an algorithm might take as input size grows.&lt;/p&gt;

&lt;p&gt;In order to measure or evaluate the time complexity of a particular algorithm we need to understand certain concepts. The first and fundamental concept required is &lt;strong&gt;looping&lt;/strong&gt;. Unless and until, we don't understand the looping concept, we cannot measure time complexity on our own and with accuracy. So, we must know the concept of loops. When I am saying this, you should not believe and think whether I am talking about some complex concept or skill. Looping is simply what you have studied in almost all the programming language. We can relate this concept with our real life. &lt;strong&gt;Whenever we perform repetitive task under certain conditions and stop after some moment, this is real world looping&lt;/strong&gt;. This is important because you have to understand &lt;strong&gt;the number of times certain operation&lt;/strong&gt; is done inside algorithm. By knowing this you can sum of the total number of operations.&lt;/p&gt;

&lt;p&gt;Similarly, there are few concepts and fundamental to understand when calculating the space complexity of the algorithm. Among them, &lt;strong&gt;variable&lt;/strong&gt; is the most to understand. While saying variable, you should understand &lt;strong&gt;variable assignment, variable scope, variable declaration in programming language&lt;/strong&gt;. If you can understand this, you can easily figure out the space complexity of the algorithm.&lt;/p&gt;

&lt;p&gt;In this blog, I have explained the two fundamental concepts to understand before measuring the time and space complexity of the algorithm in very simple way. This will be my first chapter for the series, "&lt;strong&gt;&lt;em&gt;how to measure the time and space complexity&lt;/em&gt;&lt;/strong&gt;".&lt;/p&gt;

&lt;p&gt;In the coming chapters, &lt;em&gt;I will explain the how looping and variables can impact the most in measuring the time and space complexity&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>webdev</category>
      <category>design</category>
      <category>coding</category>
    </item>
    <item>
      <title>How to measure Time Complexity and Space Complexity?</title>
      <dc:creator>jpt code</dc:creator>
      <pubDate>Sun, 02 Feb 2025 15:38:30 +0000</pubDate>
      <link>https://dev.to/jptlearn/how-to-measure-time-complexity-and-space-complexity-2554</link>
      <guid>https://dev.to/jptlearn/how-to-measure-time-complexity-and-space-complexity-2554</guid>
      <description>&lt;p&gt;Before diving into measuring time and space complexity, let's understand asymptotic notation. As described earlier, asymptotic notation helps us simply and &lt;strong&gt;compare growth trends&lt;/strong&gt; without getting lost in small details. Mathematically, it helps us understand how a function changes when it's variable approaches infinity.&lt;/p&gt;

&lt;p&gt;Among the three key asymptotic notation, Big O notation is particularly used in describing the &lt;strong&gt;upper bound&lt;/strong&gt; of an algorithm's growth rate, describing the &lt;strong&gt;worst-case scenario&lt;/strong&gt;. In simple term, it tells us the maximum amount of time or space an algorithm might take as input size grows.&lt;/p&gt;

&lt;p&gt;In order to measure or evaluate the time complexity of a particular algorithm we need to understand certain concepts. The first and fundamental concept required is &lt;strong&gt;looping&lt;/strong&gt;. Unless and until, we don't understand the looping concept, we cannot measure time complexity on our own and with accuracy. So, we must know the concept of loops. When I am saying this, you should not believe and think whether I am talking about some complex concept or skill. Looping is simply what you have studied in almost all the programming language. We can relate this concept with our real life. &lt;strong&gt;Whenever we perform repetitive task under certain conditions and stop after some moment, this is real world looping&lt;/strong&gt;. This is important because you have to understand &lt;strong&gt;the number of times certain operation&lt;/strong&gt; is done inside algorithm. By knowing this you can sum of the total number of operations.&lt;/p&gt;

&lt;p&gt;Similarly, there are few concepts and fundamental to understand when calculating the space complexity of the algorithm. Among them, &lt;strong&gt;variable&lt;/strong&gt; is the most to understand. While saying variable, you should understand &lt;strong&gt;variable assignment, variable scope, variable declaration in programming language&lt;/strong&gt;. If you can understand this, you can easily figure out the space complexity of the algorithm.&lt;/p&gt;

&lt;p&gt;In this blog, I have explained the two fundamental concepts to understand before measuring the time and space complexity of the algorithm in very simple way. This will be my first chapter for the series, "&lt;strong&gt;&lt;em&gt;how to measure the time and space complexity&lt;/em&gt;&lt;/strong&gt;".&lt;/p&gt;

&lt;p&gt;In the coming chapters, &lt;em&gt;I will explain the how looping and variables can impact the most in measuring the time and space complexity&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>webdev</category>
      <category>design</category>
      <category>coding</category>
    </item>
    <item>
      <title>Time Complexity and Space Complexity</title>
      <dc:creator>jpt code</dc:creator>
      <pubDate>Sat, 01 Feb 2025 17:19:59 +0000</pubDate>
      <link>https://dev.to/jptlearn/time-complexity-and-space-complexity-2k6a</link>
      <guid>https://dev.to/jptlearn/time-complexity-and-space-complexity-2k6a</guid>
      <description>&lt;p&gt;&lt;strong&gt;Time Complexity&lt;/strong&gt; is not about the exact execution time of an algorithm; rather, it measures how the algorithm's running time increases as the input size grows. It defines the rate at which the execution time changes concerning input size.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Space Complexity&lt;/strong&gt; refers to the amount of memory an algorithm uses as the input size increases. It consists of two parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auxiliary Space:&lt;/strong&gt; The extra space required apart from the input data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Input Space:&lt;/strong&gt; The space needed to store the input values.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both time and space complexity are analyzed using &lt;strong&gt;asymptotic notation&lt;/strong&gt;, which describes the behavior of an algorithm as input size approaches infinity. &lt;strong&gt;Asymptotic analysis&lt;/strong&gt; helps us understand how an algorithm scales, whether its performance improves or degrades as input size increases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Do We Use Big O Notation?
&lt;/h3&gt;

&lt;p&gt;If you have ever wondered why &lt;strong&gt;Big O notation&lt;/strong&gt; is used to measure time and space complexity, the answer lies in &lt;strong&gt;asymptotic analysis&lt;/strong&gt;. Among the three key asymptotic notations—Big O, Theta (Θ), and Omega (Ω)—Big O is the most commonly used because it describes the &lt;strong&gt;worst-case scenario&lt;/strong&gt; of an algorithm’s performance.&lt;/p&gt;

&lt;p&gt;When developing software, we must consider &lt;strong&gt;scalability&lt;/strong&gt; to ensure that our applications perform efficiently even under high loads. Since worst-case scenarios determine the upper limit of an algorithm’s performance, &lt;strong&gt;Big O notation&lt;/strong&gt; is the preferred choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of Big O Notation:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It focuses on the &lt;strong&gt;growth rate&lt;/strong&gt; of an algorithm.&lt;/li&gt;
&lt;li&gt;It remains independent of hardware specifications.&lt;/li&gt;
&lt;li&gt;It allows for easy comparison between different algorithms.&lt;/li&gt;
&lt;li&gt;It helps in selecting the most efficient algorithm for a given problem.&lt;/li&gt;
&lt;li&gt;It simplifies the analysis by ignoring constant factors and lower-order terms.&lt;/li&gt;
&lt;li&gt;It provides a high-level understanding of algorithm efficiency rather than exact execution time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other Asymptotic Notations:
&lt;/h3&gt;

&lt;p&gt;While Big O notation is widely used, it's essential to understand its counterparts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Theta (Θ) Notation:&lt;/strong&gt; Represents the average-case complexity and provides a tight bound on an algorithm’s behavior.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Omega (Ω) Notation:&lt;/strong&gt; Represents the best-case complexity, which gives the lower bound of an algorithm’s performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By understanding &lt;strong&gt;Big O notation&lt;/strong&gt; along with Theta and Omega, developers can analyze algorithms more effectively and optimize them for performance.&lt;/p&gt;

&lt;p&gt;In the next blog, I will cover &lt;strong&gt;how to measure time and space complexity in detail&lt;/strong&gt;!&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>algorithms</category>
      <category>javascript</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
