<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Coffee and Code]]></title><description><![CDATA[Developer | Community Evangelist]]></description><link>https://blog.advaith.co</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1636955339398/2fJ7kmYlQ.png</url><title>Coffee and Code</title><link>https://blog.advaith.co</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 02:11:36 GMT</lastBuildDate><atom:link href="https://blog.advaith.co/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I started technical writing]]></title><description><![CDATA[Reading ➡ Writing
I am an avid reader and hence I am a huge fan of writing. I have been reading technical blogs since I started college, I got to learn so many things from those blogs. One fine day I saw a blog on medium by one of my seniors on how t...]]></description><link>https://blog.advaith.co/how-i-started-technical-writing</link><guid isPermaLink="true">https://blog.advaith.co/how-i-started-technical-writing</guid><category><![CDATA[hashnodebootcamp]]></category><category><![CDATA[Technical writing ]]></category><category><![CDATA[Blogging]]></category><dc:creator><![CDATA[ADVAITH U]]></dc:creator><pubDate>Wed, 15 Sep 2021 19:23:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1631709416368/6VQwZxx_l.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="reading-writing">Reading ➡ Writing</h2>
<p>I am an avid reader and hence I am a huge fan of writing. I have been reading technical blogs since I started college, I got to learn so many things from those blogs. One fine day I saw a <a target="_blank" href="https://medium.com/@aravindvenugopal02/develop-your-first-app-action-for-google-assistant-aa0e8da56df0">blog on medium</a> by one of my seniors on how to build actions for Google Assistant.</p>
<p>Now you may think about what's so special in it. Being a complete beginner in tech the idea of creating an application for a Google product blew my mind. I have to be honest the idea of getting swag from Google was another reason to try it out. </p>
<p>Long story short I created a trivia based on Harry Potter  (unfortunately it is not currently available ). And yes I got a T-Shirt from Google.</p>
<iframe src="https://www.linkedin.com/embed/feed/update/urn:li:share:6535487907711553536" width="504" height="584"></iframe>


<h3 id="first-blog">🧾First Blog</h3>
<p>I was excited about the app and shared it with my friends, many of them asked how they could make one that is when the thought of writing a blog came to my mind. So I wrote my first blog about <a target="_blank" href="https://advaithunni.medium.com/actions-on-google-assistant-1a817b909a4e">Actions for Google Assistant</a>. The experience was really great, I learned how to handle criticisms and I started to appreciate technical writers more. </p>
<h3 id="the-fallback">📉 The Fallback</h3>
<p>I stopped publishing my blogs after a while. The main was thought that came to my mind <strong>"there are already so many articles on the same topic then why should I write one, will it be useful for people",</strong> well this thought fuelled by my imposter syndrome lead me to stop blogging. </p>
<p>When I joined the Hahsnode community back in April 2021, I was really inspired by the blogs of the community members, I thought of starting a blog again. So I started  <a target="_blank" href="https://blog.advaith.tech/">Coffee and Code </a> intending to get on track with blogging.</p>
<h2 id="hashnode-bootcamp">🎙 Hashnode Bootcamp</h2>
<p>When I learned about the recent Hashnode Bootcamp, I thought it would be a great opportunity to learn more about technical writing and restart my journey as a blogger. I was right the first session by  <a class="user-mention" href="https://hashnode.com/@tanoaksam">Sam Sycamore</a>, <a class="user-mention" href="https://hashnode.com/@didicodes">Edidiong Asikpo</a> and  <a class="user-mention" href="https://hashnode.com/@quincy">Quincy Larson</a> gave me a whole new perspective on technical writing and gave me the confidence to write this blog.</p>
<p>Well, my mindset changed after the first session, now I am more confident about writing blogs.</p>
<h3 id="motivation-to-keep-going">💭 Motivation to keep going</h3>
<ul>
<li><h4 id="i-love-to-teach-people">I love to teach people</h4>
<p>I have taught so many students as part of various community programs and the comments and responses I get after those sessions make me happy. Usually, the number of students is limited in these sessions. Writing blogs would help me share my knowledge with a larger audience. </p>
</li>
<li><h4 id="it-helps-me-to-think">It helps me to think</h4>
<p>We are humans and we always think. Writing a blog helps me to think from various perspectives, how to make it simple, how should I present this, how can I make it interesting. While writing I usually think deeply about a concept which helps to understand it better. I try to make notes before giving a talk or taking a session, this helps to increase my storytelling ability and hence helps to deliver the content in a simple and meaningful way. </p>
</li>
<li><h4 id="document-my-journey">Document my journey</h4>
<p>It applies to writing in general. While writing technical articles I try to document what I have learned, how I built a project, productivity, etc. In our life, wins and losses are common but the experience of each one will be different we need to document it. It will help us analyze how far we have come and our wins will inspire us to not give up and our losses will teach us to improve our life</p>
</li>
</ul>
<h3 id="my-goals-as-a-writer">🎯 My goals as a writer</h3>
<ul>
<li><h4 id="be-consistent">Be consistent</h4>
<p>I have failed to be consistent in the past. If you are surrounded by the right people you will have the ability to push yourself and get things done. The blogs by the Hashnode community members inspire me to write more.</p>
</li>
<li><h4 id="create-an-identity">Create an identity</h4>
<p>As a writer and a developer, I would like to create an identity through the content I share. I would like this to be " his articles are really helpful for individuals who are getting into tech, you should definitely check it out."</p>
</li>
</ul>
<hr />
<p>Thank you for reading till the end. I hope this is the beginning of many more blogs to come.</p>
<p>Let's connect on <a target="_blank" href="https://twitter.com/advaith_u">Twitter</a></p>
]]></content:encoded></item><item><title><![CDATA[Polymorphism in Java]]></title><description><![CDATA[💭 What is Polymorphism?

Polymorphism means representing more than one form with the same name.

Polymorphism is considered one of the important features of Object-Oriented Programming. Polymorphism allows us to perform a single action in different ...]]></description><link>https://blog.advaith.co/polymorphism-in-java</link><guid isPermaLink="true">https://blog.advaith.co/polymorphism-in-java</guid><category><![CDATA[Java]]></category><category><![CDATA[Object Oriented Programming]]></category><category><![CDATA[functions]]></category><dc:creator><![CDATA[ADVAITH U]]></dc:creator><pubDate>Mon, 19 Jul 2021 13:35:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1626716620171/GuKYa-T3U.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="what-is-polymorphism">💭 What is Polymorphism?</h2>
<blockquote>
<p><em>Polymorphism means representing more than one form with the same name.</em></p>
</blockquote>
<p>Polymorphism is considered one of the important features of Object-Oriented Programming. Polymorphism allows us to perform a single action in different ways. In other words, polymorphism allows you to define one interface and have multiple implementations. </p>
<p>We know Object-Oriented programming is inspired by real-world objects. In real life, the same person can have multiple roles and each role has specific responsibilities. For example, a person can be a father, a brother, a friend, and a manager at the same time. But his responsibilities may differ.</p>
<h2 id="types-of-polymorphism">Types of polymorphism</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626716670023/oZA67Q6aP3.png" alt="Polymorphism.png" /></p>
<p>Polymorphism is divided into two types:</p>
<ul>
<li>Compile Time Polymorphism</li>
<li>Run -Time Polymorphism</li>
</ul>
<h3 id="compile-time-polymorphism">Compile Time Polymorphism</h3>
<p>It is also known as static polymorphism. This type of polymorphism is achieved by function overloading or operator overloading. </p>
<h4 id="operator-overloading">Operator Overloading</h4>
<ul>
<li>Addition Operator
<code>int sum = 2+3;</code></li>
<li>Concatenation Operator
<code>System.out.println("Hello"+"World");</code></li>
</ul>
<h3 id="method-overloading">Method Overloading</h3>
<p>Method overloading occurs when there is more than one method with the same name but different method signatures. </p>
<p><strong>Why do we need method signature?</strong></p>
<p>The compiler uses the method signature to uniquely identify a method during method overloading. The method name along with the number and datatype of parameters is termed as a method signature.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626865266441/fJhnbz8Az.png" alt="Slide 4_3 - 1.png" /></p>
<p><strong>Example:</strong></p>
<p>Let us consider a program to find the area of a square, rectangle and circle implemented using method overloading.</p>
<pre><code><span class="hljs-keyword">class</span> Demo
{
    <span class="hljs-built_in">public</span> static <span class="hljs-type">void</span> Area(<span class="hljs-type">int</span> side){
        <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println("Area of square = "+ side*side);
    }

    <span class="hljs-built_in">public</span> static <span class="hljs-type">void</span> Area(<span class="hljs-type">int</span> l, <span class="hljs-type">int</span> b){
        <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println("Area of rectangle = "+ l*b);
    }

    <span class="hljs-built_in">public</span> static <span class="hljs-type">void</span> Area(<span class="hljs-type">double</span> r){
        <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println("Area of circle = "+ <span class="hljs-number">3.14</span>*r*r);
    }
    <span class="hljs-built_in">public</span> static <span class="hljs-type">void</span> main (String[] args) throws java.lang.<span class="hljs-keyword">Exception</span>
    {
        Area(<span class="hljs-number">5</span>);
        Area(<span class="hljs-number">5</span>,<span class="hljs-number">6</span>);
        Area(<span class="hljs-number">3.0</span>);
    }
}
</code></pre><h3 id="runtime-polymorphism">Runtime Polymorphism</h3>
<p>It is also known as Dynamic Polymorphism. It is a process in which a function call to the overridden method is resolved at Runtime. This type of polymorphism is achieved by Method Overriding.</p>
<h4 id="method-overriding">Method Overriding</h4>
<p>If a subclass (child class) has the same method as declared in the parent class, it is known as method overriding in Java. That parent method is said to be overridden.</p>
<blockquote>
<p>The main advantage of method overriding is that the class can give its own specific implementation to an inherited method <strong><em>without even modifying the parent class code</em></strong></p>
</blockquote>
<p><strong>Example:</strong></p>
<p>Let us understand this with an example. Consider a program to calculate the GPA of the semester. The way GPA is calculated differs according to the university so we need a specific implementation based on the university, in such scenarios we could use method overriding.</p>
<pre><code><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Education</span></span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">displayGPA</span><span class="hljs-params">()</span></span>{
        System.out.println(<span class="hljs-string">"GPA is calculated on a scale of 10"</span>);
    }
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">UniveristyOne</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Education</span></span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">displayGPA</span><span class="hljs-params">()</span></span>{
        System.out.println(<span class="hljs-string">"UniveristyOne caculates the GPA on a scale of 5"</span>);
    }
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">UniversityTwo</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Education</span></span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">displayGPA</span><span class="hljs-params">()</span></span>{
        System.out.println(<span class="hljs-string">"UniversityTwo calculates the GPA on a scale of 10"</span>);
    }
}

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">WorkAtTech</span>
</span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span> <span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> java.lang.Exception
    </span>{
        Education A = <span class="hljs-keyword">new</span> UniveristyOne();
        A.displayGPA();
        A=<span class="hljs-keyword">new</span> UniversityTwo();
        A.displayGPA();
    }
}
</code></pre><p>In the above example, the child class can implement their own version of displayGPA() without affecting the code in the parent class.</p>
<p>Hope this article was helpful. </p>
<p>Feel free to connect with me on <a target="_blank" href="https://twitter.com/advaith_u">Twitter</a> and share your feedback </p>
]]></content:encoded></item><item><title><![CDATA[The First Coffee]]></title><description><![CDATA[Hi folks 😀
Welcome to Coffee and Code. Let's talk about the title first Coffee and Code are my constant companions and thought it would be a perfect title for this blog. 
✍️ A Quick Intro
If you are reading this blog you may know me already but if y...]]></description><link>https://blog.advaith.co/the-first-coffee</link><guid isPermaLink="true">https://blog.advaith.co/the-first-coffee</guid><category><![CDATA[General Advice]]></category><category><![CDATA[newbie]]></category><dc:creator><![CDATA[ADVAITH U]]></dc:creator><pubDate>Thu, 15 Apr 2021 17:59:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1618419793006/huFOMvG8N.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="hi-folks">Hi folks 😀</h2>
<p>Welcome to Coffee and Code. Let's talk about the title first Coffee and Code are my constant companions and thought it would be a perfect title for this blog. </p>
<h3 id="a-quick-intro">✍️ A Quick Intro</h3>
<p>If you are reading this blog you may know me already but if you are new let me give you a quick intro. I'm Advaith, an engineering student who loves to think beyond the wall. I would describe myself as a jack of all trades who is on the journey to master some.  </p>
<p>I love to create web applications using  <a target="_blank" href="https://reactjs.org/">React</a>. Apart from being a developer, I am a people person and love being part of developer communities. I am always excited to talk about community building and technology. I spend my weekends attending meetups or hackathons. I love to implement what I have learned and consider side projects and hackathons are the best way to do it. </p>
<p><strong>Fun fact:</strong> I am a Potterhead and you could see a Harry Potter reference in anything  I build. </p>
<h3 id="why-coffee-and-code">💭 Why Coffee and Code?</h3>
<p>I was able to help many students during my tenure as a Google DSC Lead, I like to continue the journey thereafter.  This blog will be a platform to share what I have learned from my journey so far which would be helpful for students. </p>
<p><em>Some things are better said short and sweet. You could check out <a target="_blank" href="https://www.instagram.com/coffee.and.code._/">Coffee and Code</a> on Instagram where I share short content.</em></p>
<h3 id="what-to-expect-from-coffee-and-code">📢 What to expect from Coffee and Code?</h3>
<p>Through this platform, I'm planning to share content related to :</p>
<ul>
<li>Web Development</li>
<li>Azure </li>
<li>Python</li>
<li>Data Structures</li>
<li>Personal Development</li>
<li>Productivity</li>
<li>Personal branding</li>
</ul>
<p>The list may grow who knows. This blog is focused primarily on students. As we know there is nothing perfect but I assure you I will give this my best. </p>
<p>Feel free to connect wit me on <a target="_blank" href="https://twitter.com/advaith_u">twitter</a> </p>
<p>I would like to end this article with a quote that has helped me a lot.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1618509036958/PsJFGK39O.png" alt="DUMBLEDORE.png" /></p>
]]></content:encoded></item><item><title><![CDATA[Beginner’s Guide to Cloud Computing]]></title><description><![CDATA[Now we hear the term cloud computing quite often but do you know what it is. Then this article is for you. Consider an example while using a pen you don’t have to know how it’s made or how it works. You only want to know whether you can use it comfor...]]></description><link>https://blog.advaith.co/beginners-guide-to-cloud-computing-545698131be</link><guid isPermaLink="true">https://blog.advaith.co/beginners-guide-to-cloud-computing-545698131be</guid><dc:creator><![CDATA[ADVAITH U]]></dc:creator><pubDate>Fri, 21 Feb 2020 09:50:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1644122444722/g5f6fY6rG.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Now we hear the term cloud computing quite often but do you know what it is. Then this article is for you. Consider an example while using a pen you don’t have to know how it’s made or how it works. You only want to know whether you can use it comfortably right.</p>
<p><em>As a technology professional, it would be nice to have these same benefits when developing and deploying applications. Storing data, streaming video, or even hosting a website all require managing hardware and software. This management is an unnecessary obstacle when delivering your application to your users. The solution is for this scenario is cloud computing.</em></p>
<p>Cloud computing is renting resources, like storage space or CPU cycles, on another company’s computers. You only pay for what you use. The company providing these services is referred to as a cloud provider. Some example providers are Microsoft, Amazon, and Google.</p>
<p>The cloud provider is responsible for the physical hardware required to execute your work, and for keeping it up-to-date. The computing services offered tend to vary by the cloud provider. However, typically they include:</p>
<ul>
<li><strong>Compute power</strong> — such as Linux servers or web applications</li>
<li><strong>Storage</strong> — such as files and databases</li>
<li><strong>Networking</strong> — such as secure connections between the cloud provider and your company</li>
<li><strong>Analytics</strong> — such as visualizing telemetry and performance data</li>
</ul>
<blockquote>
<p>The goal of cloud computing is to make running a business easier and more efficient, whether it’s a small start-up or a large enterprise. Every business is unique and has different needs. To meet those needs, cloud computing providers offer a wide range of services.</p>
</blockquote>
<hr />

<p>In <strong>Compute Power</strong> we have three different choices</p>
<ul>
<li><p><strong>Virtual Machines - </strong> A VM is an emulation of a computer just like your desktop or laptop, you’re using now. Each VM includes an operating system and hardware that appears to the user like a physical computer running Windows or Linux. You can then install whatever software you need to do the tasks you want to run in the cloud.<em>The difference is that you don’t have to buy any of the hardware or install the OS. The cloud provider runs your virtual machine on a physical server in one of their data centers often sharing that server with other VMs (isolated and secure). With the cloud, you can have a VM ready to go in minutes at less cost than a physical computer.</em></p>
</li>
<li><p><strong>Containers -</strong> provide a consistent, isolated execution environment for applications. They’re similar to VMs except they don’t require a guest operating system. Instead, the application and all its dependencies are packaged into a “container” and then a standard runtime environment is used to execute the app. This allows the container to start up in just a few seconds because there’s no OS to boot and initialize. You only need the app to launch.</p>
</li>
<li><p><strong>Serverless computing -</strong> lets you run application code without creating, configuring, or maintaining a server. The core idea is that your application is broken into separate <em>functions</em> that run when triggered by some action. This is ideal for automated tasks  , for example, you can build a serverless process that automatically sends an email confirmation after a customer makes an online purchase.</p>
</li>
</ul>
<p><strong>Storage</strong> is an important service provided by cloud computing. The advantage of using cloud-based data storage is you can scale to meet your needs. If you find that you need more space to store your data, you can pay a little more and add it to your available space. In some cases, the storage can even expand and contract automatically  so you pay for exactly what you need at any given point in time. <strong><em>This makes cloud computing flexible and cost-efficient.</em></strong></p>
<hr />

<h3 id="heading-benefits-of-cloud-computing">Benefits of Cloud Computing</h3>
<p><strong>COST EFFECTIVE</strong></p>
<p>Cloud computing provides a <strong>pay-as-you-go</strong> or <strong>consumption-based pricing</strong> model. Prices for individual resources and services are provided so you can predict how much you will spend in a given billing period based on your expected usage.</p>
<p><strong>SCALABLE</strong></p>
<p>You can increase or decrease the services used based on the need at a given time. The scaling can be done manually or automatically based on the resources that can be allocated and de-allocated or the number of requests and CPU utilization.</p>
<p><strong>SECURE</strong></p>
<p>Think about how you secure your data center. You have physical security and digital security. Cloud providers offer a broad set of policies, technologies, controls, and expert technical skills that can provide better security than most organizations can otherwise achieve. The result is strengthened security, which helps to protect data, apps, and infrastructure from potential threats.</p>
<p>The major benefits of cloud computing are listed above. Apart from these cloud computing is</p>
<ul>
<li><p><strong>Reliable</strong>  —  When you are working in the industry or running an industry you should be confident that your data is secure and will be stored accordingly. Cloud computing providers offer data backup, disaster recovery, and data replication services to make sure your data is always safe.</p>
</li>
<li><p><strong>Elasticity</strong>  —  As your workload changes a cloud computing system can add or remove resources based on the increase or decrease in demand. Imagine that you own a startup and your product was featured in the media. So there will be a hike in persons visiting your website which results in increased traffic. Since the cloud is elastic, it automatically allocates more computing resources to handle the increased traffic.</p>
</li>
</ul>
<p>The major cloud service providers are:</p>
<ul>
<li>Google (<a target="_blank" href="https://cloud.google.com/">Google cloud platform</a>)</li>
<li>Microsoft (<a target="_blank" href="https://azure.microsoft.com/en-in/">Microsoft Azure</a>)</li>
<li>Amazon(<a target="_blank" href="https://aws.amazon.com/">Amazon Web Services</a>). </li>
</ul>
<p>There are so many resources available online to get started with cloud computing. <a target="_blank" href="https://www.qwiklabs.com/">Qwiklabs</a> is one such site with hands-on tutorials.</p>
<p>I hope this article will provide you with an overview of Cloud Computing. More blogs will be coming soon.</p>
]]></content:encoded></item><item><title><![CDATA[Analysis of Algorithms]]></title><description><![CDATA[What is an algorithm?
An algorithm is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are unambiguous specifications for performing the calculation...]]></description><link>https://blog.advaith.co/analysis-of-algorithms</link><guid isPermaLink="true">https://blog.advaith.co/analysis-of-algorithms</guid><category><![CDATA[algorithms]]></category><dc:creator><![CDATA[ADVAITH U]]></dc:creator><pubDate>Thu, 09 Jan 2020 17:42:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1644120751441/HzPlmaKV7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-what-is-an-algorithm">What is an algorithm?</h3>
<p>An algorithm is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation. Algorithms are unambiguous specifications for performing the calculation, data processing, automated reasoning, and other tasks.</p>
<h3 id="heading-analysis-of-algorithm">Analysis of algorithm</h3>
<p>After designing an algorithm, it has to be checked and its correctness needs to be predicted; this is done by analyzing the algorithm. The algorithm can be analyzed by tracing all step-by-step instructions, reading the algorithm for logical correctness, and testing it on some data using mathematical techniques to prove it correct. Another type of analysis is to analyze the simplicity of the algorithm. That is, simply design the algorithm so that it becomes easier to be implemented. However, the most straightforward way of solving a problem may not be sometimes the best one. Moreover, there may be more than one algorithm to solve a problem. The choice of a particular algorithm depends on the following performance analysis and measurements :  </p>
<ol>
<li>Space Complexity</li>
<li>Time Complexity</li>
</ol>
<p>The time used by a computer to solve a problem using the algorithm, when input values are of a specified size. There are three types of time complexity: </p>
<ul>
<li><strong>Best case</strong> — the minimum possible time depending on the output (<em>at least</em>) </li>
<li><strong>Worst case</strong> — the maximum possible time depending on the output (<em>at most</em>)</li>
<li><strong>Average case</strong> — the average time required to complete the execution</li>
</ul>
<p>Some common time complexities are listed below:</p>
<ul>
<li><strong>Constant Time</strong></li>
</ul>
<p>A simple statement that takes only a constant time. For example variable declaration, displaying the menu, etc. takes only constant time. The order of growth is considered as 1.</p>
<ul>
<li><strong>Linear Time</strong></li>
</ul>
<p>When the time taken by the code segment is proportional to n.This happens when a particular code block is repeated <strong>n</strong> no: of times. The order of growth is considered as n. Eg:-</p>
<pre><code><span class="hljs-keyword">int</span> i;  
<span class="hljs-keyword">for</span>(i<span class="hljs-operator">=</span><span class="hljs-number">1</span>;i<span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span>n;i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>)  
    print(<span class="hljs-string">"%d"</span>,i);
</code></pre><ul>
<li><strong>Logarithmic Time</strong></li>
</ul>
<p>It usually occurs when you are dividing something into two(binary search, binary trees). The order of growth is considered as log N. Eg:-</p>
<pre><code><span class="hljs-string">""</span><span class="hljs-string">"Code for binary search a represents the array and s represents the search element"</span><span class="hljs-string">""</span>  
<span class="hljs-keyword">int</span> start<span class="hljs-operator">=</span><span class="hljs-number">0</span>,end<span class="hljs-operator">=</span><span class="hljs-number">9</span>;  
<span class="hljs-keyword">while</span>(start<span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span>end)  
 mid<span class="hljs-operator">=</span>(start<span class="hljs-operator">+</span>end)<span class="hljs-operator">/</span><span class="hljs-number">2</span>  
 <span class="hljs-keyword">if</span>(a\[mid\]<span class="hljs-operator">=</span><span class="hljs-operator">=</span>s)  
    print(<span class="hljs-string">"Element is found"</span>);  
 <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(a\[mid\]<span class="hljs-operator">&lt;</span>s)  
    start<span class="hljs-operator">=</span>mid<span class="hljs-operator">+</span><span class="hljs-number">1</span>  
 <span class="hljs-keyword">else</span>  
    end<span class="hljs-operator">=</span>mid<span class="hljs-number">-1</span>
</code></pre><ul>
<li><strong>Polynomial Time</strong></li>
</ul>
<p>The order of growth is a polynomial. It occurs in the case of nested loops.</p>
<pre><code><span class="hljs-comment">//O(n^3)  </span>
<span class="hljs-keyword">for</span>(i<span class="hljs-operator">=</span><span class="hljs-number">1</span>;i<span class="hljs-operator">&lt;</span>n;i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>)  
 <span class="hljs-keyword">for</span>(j<span class="hljs-operator">=</span><span class="hljs-number">1</span>;j<span class="hljs-operator">&lt;</span>n;j<span class="hljs-operator">+</span><span class="hljs-operator">+</span>)  
  <span class="hljs-keyword">for</span>(k<span class="hljs-operator">=</span><span class="hljs-number">1</span>;k<span class="hljs-operator">&lt;</span>n;k<span class="hljs-operator">+</span><span class="hljs-operator">+</span>)  
    print(k)
</code></pre><ul>
<li><strong>Exponential Time</strong></li>
</ul>
<p>The order of growth is <strong>2^N.</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1644119106322/kfDSYBQkt.png" alt="ag.png" /></p>
<p>The function that involves ’n’ as an exponent, i.e., 2<sup>n</sup>, n<sup>n</sup>, n ! is called exponential functions, which is too slow except for small size input function where growth is less than or equal to n c,(where ‘c’ is a constant) i.e.; n<sup>3</sup>, n<sup>2</sup>, nlog<sub>2</sub>n, n, log<sub>2</sub>n are said to be polynomial. Algorithms with polynomial-time can solve reasonable-sized problems if the constant in the exponent is small.<br />When we analyze an algorithm it depends on the input data, there are three cases :  </p>
<ol>
<li>Best case  </li>
<li>Average case  </li>
<li>Worst case  </li>
</ol>
<p>In the best case, the amount of time a program might be expected to take on the best possible input data.  In the average case, the amount of time a program might be expected to take on typical (or average) input data.  In the worst case, the amount of time a program would take on the worst possible input configuration.</p>
<h3 id="heading-asymptotic-notations">Asymptotic Notations</h3>
<p><strong>Asymptotic Notations</strong> are languages that allow us to analyze an algorithm’s running time by identifying its behavior as the input size for the algorithm increases. This is also known as an algorithm’s growth rate.</p>
<p>The following 3 asymptotic notations are mostly used to represent the time complexity of algorithms:</p>
<h3 id="heading-big-oh-o">Big Oh (O)</h3>
<p>Big Oh is often used to describe the worst-case of an algorithm by taking the highest order of a polynomial function and ignoring all the constants' values since they aren’t too influential for sufficiently large input.</p>
<h3 id="heading-big-omega-w">Big Omega (Ω)</h3>
<p>Big Omega is the opposite of Big Oh, if Big Oh was used to describe the upper bound (worst-case) of an asymptotic function, Big Omega is used to describe the lower bound of an asymptotic function. In an analysis algorithm, this notation is usually used to describe the complexity of an algorithm in the best case, which means the algorithm will not be better than its <strong>best-case</strong>.</p>
<h3 id="heading-big-theta-8">Big Theta (Θ)</h3>
<p>When an algorithm has complexity with lower bound = upper bound, say that an algorithm has a complexity O(n log n) and Ω(n log n), it has the complexity Θ(n log n), which means the running time of that algorithm always falls in n log n in the best-case and worst-case.</p>
<h3 id="heading-space-complexity">SPACE COMPLEXITY</h3>
<p>Analysis of space complexity of an algorithm or program is the amount of memory it needs to run to completion.<br />Some of the reasons for studying space complexity are:</p>
<ol>
<li>If the program is to run on a multi-user system, it may be required to specify the amount of memory to be allocated to the program.  </li>
<li>We may be interested to know in advance whether sufficient memory is<br />available to run the program.  </li>
<li>There may be several possible solutions with different space requirements.  </li>
<li>Can be used to estimate the size of the largest problem that a program can solve.</li>
</ol>
<p>The space needed by a program consists of the following components.  </p>
<ul>
<li><strong>Instruction space</strong>: Space needed to store the executable version of the program and it is fixed.  </li>
<li><strong>Data space</strong>: Space needed to store all constants, variable values and has further two components :  </li>
<li>Space is needed by constants and simple variables. This space is fixed.  </li>
<li>Space is needed by fixed-sized structural variables, such as arrays and structures.  </li>
<li><p>Dynamically allocated space. This space usually varies.</p>
</li>
<li><p><strong>Environment stack space</strong>: This space is needed to store the information to resume the suspended (partially completed) functions. Each time a function is invoked the following data is saved on the environment stack :  </p>
</li>
<li><strong>Return address</strong>: i.e., from where it has to resume after completion of the<br />called function.  </li>
<li>Values of all lead variables and the values of formal parameters in the function being invoked.</li>
</ul>
<p><em>The amount of space needed by the recursive function is called the recursion stack space.</em> For each recursive function, this space depends on the space needed by the local variables and the formal parameter. In addition, this space depends on the maximum depth of the recursion i.e., the maximum number of nested recursive calls.</p>
<h3 id="heading-time-space-trade-off">TIME-SPACE TRADE-OFF</h3>
<p>There may be more than one approach (or algorithm) to solve a problem. The best algorithm (or program) to solve a given problem requires less space in memory and takes less time to complete its execution. But in practice, it is not always possible to achieve both of these objectives. One algorithm may require more space but less time to complete its execution while the other algorithm requires less time-space but takes more time to complete its execution. </p>
<p>Thus, we may have to sacrifice one at the cost of the other.  If the space is our constraint, then we have to choose a program that requires less space at the cost of more execution time. On the other hand, if time is our constraint such as in a real-time system, we have to choose a program that takes less time to complete its execution at the cost of more space.</p>
]]></content:encoded></item><item><title><![CDATA[Actions on Google Assistant]]></title><description><![CDATA[We all have heard about Google assistant. Google Assistant is an artificial intelligence-powered virtual assistant developed by Google. Google assistant is used widely around the world compared to other virtual assistants like Siri, Alexa, etc. Have ...]]></description><link>https://blog.advaith.co/actions-on-google-assistant-1a817b909a4e</link><guid isPermaLink="true">https://blog.advaith.co/actions-on-google-assistant-1a817b909a4e</guid><dc:creator><![CDATA[ADVAITH U]]></dc:creator><pubDate>Tue, 10 Sep 2019 09:23:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1644121404714/4bPwwgi-S.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We all have heard about Google assistant. Google Assistant is an artificial intelligence-powered virtual assistant developed by Google. Google assistant is used widely around the world compared to other virtual assistants like Siri, Alexa, etc. <strong>Have you ever thought that you could develop an app in google assistant even</strong> <strong>without a single line of code.</strong></p>
<p>I came to know about this when I reached this site, <a target="_blank" href="http://developers.google.com/actions/community/overview">Google Developers Site</a>. It gives you an introduction to the Google Assistant Community developer program and the perks that we could achieve. Don’t you think it's cool to have an app/action developed by us, which is accessible across all devices with google assistant?</p>
<h4 id="heading-why-you-should-build-actions"><strong>Why you should build actions?</strong></h4>
<p>The reason is simple technology is changing rapidly and the current trend is voice. Let’s take an example, we can consider the evolution of mobile phones. Initially, we had keypad phones and then it changed to smartphones where we communicated using touch and now the era is of sound. Now we can make a phone call, send a message send an email, etc. using our voice.</p>
<h4 id="heading-why-google-assistant">Why Google Assistant?</h4>
<p>Of the above-mentioned virtual assistants, Google assistant has the maximum reach in terms number of devices and languages. We can build actions that are available across different devices such as android phones, android TV, Google home, etc.</p>
<p>Apart from the above, your action would be available across 252 countries. Now you will be excited to build your actions right.</p>
<p>I will be sharing the ways to build your first action in my upcoming articles. If you are interested to learn more about this you can visit <a target="_blank" href="https://codelabs.developers.google.com/">Google Codelabs</a>. Okay let me show you some of my actions, so open your Google assistant and say this</p>
<ol>
<li>IPL Quiz-Talk to Cricket IPL</li>
<li>Harry Potter Quiz — Talk to Mischief Managed<strong>(especially for Potterheads)</strong></li>
</ol>
<p>All the best Guys.</p>
]]></content:encoded></item></channel></rss>