<?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>Forem: Sangeethraj</title>
    <description>The latest articles on Forem by Sangeethraj (@sangeeth_raj).</description>
    <link>https://forem.com/sangeeth_raj</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%2F383578%2F788129f5-cb16-4f88-80a4-7115a8744414.jpeg</url>
      <title>Forem: Sangeethraj</title>
      <link>https://forem.com/sangeeth_raj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sangeeth_raj"/>
    <language>en</language>
    <item>
      <title>Usage of Node.js Cluster vs Worker</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Sun, 17 Nov 2024 06:47:25 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/usage-of-nodejs-cluster-vs-worker-4fdf</link>
      <guid>https://forem.com/sangeeth_raj/usage-of-nodejs-cluster-vs-worker-4fdf</guid>
      <description>&lt;p&gt;&lt;strong&gt;The Cluster&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The cluster module allows node.js to spawn multiple processes that can share the same server port and handle incoming requests each process runs. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics of Cluster&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Manager Role&lt;/li&gt;
&lt;li&gt;Worker Processes&lt;/li&gt;
&lt;li&gt;Load Balancing&lt;/li&gt;
&lt;li&gt;Fault Tolerance&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j0tc6h5zli4r4xevprq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j0tc6h5zli4r4xevprq.png" alt="Image description" width="507" height="749"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantage of Cluster&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;high availability of service&lt;/li&gt;
&lt;li&gt;little to no downtime&lt;/li&gt;
&lt;li&gt;basic scalability based on demand&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Worker&lt;/strong&gt;&lt;br&gt;
The Worker thread as a separate CPU core making it more efficient on the other hand worker threads allow a single node.js process to create and manage multiple threads for parallel execution of tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics of Worker&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Independent Execution&lt;/li&gt;
&lt;li&gt;Concurrency&lt;/li&gt;
&lt;li&gt;Scalability&lt;/li&gt;
&lt;li&gt;Resource Isolation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4mdqrnkahbjyiuvivfyx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4mdqrnkahbjyiuvivfyx.png" alt="Image description" width="459" height="741"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantage of Worker&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;freeing up the main thread&lt;/li&gt;
&lt;li&gt;processing of CPU-intensive requests&lt;/li&gt;
&lt;li&gt;native JS multithreading&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use the cluster module when you want your node.js application to be highly available and scalable because it's gonna scale&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use worker threads if you want to be able to process CPU intensive tasks in one go.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>cluster</category>
      <category>workerthread</category>
    </item>
    <item>
      <title>GitHubGraduation-2022🎓</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Fri, 06 May 2022 13:56:56 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/githubgraduation-2022-31bo</link>
      <guid>https://forem.com/sangeeth_raj/githubgraduation-2022-31bo</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1czhru9u6t4ifhmr991.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1czhru9u6t4ifhmr991.png" alt="coverpic" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub Graduation 2022 is here, join the GitHub Education Team on June 11th in an online ceremony to celebrate the Class of 2022.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are you graduating this year?&lt;/strong&gt;&lt;br&gt;
GitHub Education invites any student who has graduated, or plans to graduate, in 2022 to apply to the yearbook. This includes bootcamps, code camps, high school graduates, Master's graduates, Ph. D. Graduates, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The eligibility criteria are -&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have been verified as a student with the GitHub Student Developer Pack. Not yet a part of the Pack? &lt;a href="https://education.github.com/discount_requests/student_application?utm_source=2022-06-11-GitHubGraduation"&gt;Apply here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;You have not participated in a past GitHub Graduation event.&lt;/li&gt;
&lt;li&gt;You identify as a graduate in the year 2022.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Click here to join the &lt;a href="https://github.us11.list-manage.com/track/click?u=9d7ced8c4bbd6c2f238673f0f&amp;amp;id=af5c4ba6ed&amp;amp;e=c8cc71e38f"&gt;GitHubGraduation-2022&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to join the Class of 2022
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Fill out the shipping form.&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://airtable.com/shrVMo8ItH4wjsO9f"&gt;Fill out the shipping form&lt;/a&gt;⚠️ the form needs to be done before creating your Pull Request (PR) and does not guarantee participation in the event. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add yourself to Yearbook&lt;/strong&gt; 🏫&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fork the project, click on the forking on the left side of the project.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnpn4hemtuyfrt5x2m26a.png" alt="Fork the project" width="800" height="402"&gt;
&lt;/li&gt;
&lt;li&gt;Make sure the GitHub repository is in your username not the original repository after forking.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhh6r7s8gcpzzbf49x6jc.png" alt="GitHub repository" width="800" height="403"&gt;
&lt;/li&gt;
&lt;li&gt;Select the _data folder, create the folder _data/YOUR-USERNAME/
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5aginhql7l313w94fkq.png" alt="create the folder" width="800" height="403"&gt;
&lt;/li&gt;
&lt;li&gt;Select Add file -&amp;gt; Create new
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff49vyzmeiu6bzmmvar35.jpg" alt="Add file" width="800" height="450"&gt;
&lt;/li&gt;
&lt;li&gt;Enter your GitHub username(which on the left top) and close the tab with "/", again enter GitHub username to create the file name and using .md as extension as per the below example.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73zspf2vzuabbfpydywi.png" alt="username" width="800" height="422"&gt;
&lt;/li&gt;
&lt;li&gt;Copy the temple given in the Readme file in the main page of the repository.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funzghofbrejq9jtipekq.jpg" alt="Readme" width="800" height="450"&gt;
&lt;/li&gt;
&lt;li&gt;Delete the boilerplate data and fill the information with yours, as given in the below example.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vs9jooo2m60hurk841a.png" alt="boilerplate" width="800" height="298"&gt;
&lt;/li&gt;
&lt;li&gt;Submit your Pull Request, Select Contribute -&amp;gt; Open Pull Request
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6191xp2ljv9bq4mon9sf.png" alt="Pull Request" width="800" height="404"&gt;
&lt;/li&gt;
&lt;li&gt;Go through the checklist on the pull request template to guarantee your submission is valid. The GitHub Education team will review your application, approve and merge your submission if everything is correct.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Special Note:&lt;/strong&gt; Submit a pull request before May 27 to join the event and "walk the stage." Only the first 7,500 graduates to merge their Pull Request to the GitHub Yearbook will receive a shipment.&lt;/p&gt;

&lt;p&gt;Happy Coding❤️❤️❤️&lt;/p&gt;

</description>
      <category>github</category>
      <category>programming</category>
      <category>opensource</category>
      <category>git</category>
    </item>
    <item>
      <title>Reverse Integer without converting into a String</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Fri, 01 Apr 2022 16:47:21 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/reverse-integer-without-converting-into-a-string-370p</link>
      <guid>https://forem.com/sangeeth_raj/reverse-integer-without-converting-into-a-string-370p</guid>
      <description>&lt;p&gt;Explanation :&lt;br&gt;
&lt;em&gt;Everyone is familiar with String reverse by when it comes to Integer we must go foe a different technique using Java operators. Here in the method will initialize the return with zero, then create a while loop to iterate until the user input becomes zero, within the loop we will assign value to return variable use Modulo or Remainder Operator by 10 to get only one reminder at the end and store it in in the return variable by adding the answer. After that divide the user input by 10 using Divide Operator so the last value in the Integer will be remove and assign value to input variable. Finally once the user input becomes 0 the loop will stop iteration and return the reversed value. We can call the created method in the main using print statement.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class revNum {

    public static int revNumber(int num) {
        /* Declare the return variable*/
        int ans = 0;

        /* Loop to iterate until the int becomes zero*/
        while (num &amp;gt; 0) {
            /* assign value to return variable
               use Modulo or Remainder Operator in Java
               add to declared return variable */
            ans = ans * 10 + num % 10;

            /* assign value to input variable
               Divide Operator in Java */
            num = num / 10;
        }
               /*return the declared variable*/
        return ans;
    }

    public static void main(String[] args) {
        /* Declare the input*/
        int num = 4567;

        /* Call the revNumber method */
        System.out.println("Before Swap: "+num+"\nAfter Swap: "+ revNumber(num));
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;Before Swap: 4567&lt;br&gt;
After Swap: 7654&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a revNumber() method returning int&lt;/li&gt;
&lt;li&gt;Declare the return variable and initialize with 0 &lt;/li&gt;
&lt;li&gt;Create for loop to iterate until the user input becomes zero&lt;/li&gt;
&lt;li&gt;Assign value to return variable use Modulo or Remainder Operator in Java add to declared return variable&lt;/li&gt;
&lt;li&gt;Assign value to input variable divide Operator in Java&lt;/li&gt;
&lt;li&gt;Return the declared variable&lt;/li&gt;
&lt;li&gt;Declare the input in main method&lt;/li&gt;
&lt;li&gt;Call the revNumber() method in the print statement &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Special Note:&lt;/strong&gt; The reverse function is familiar to you but when it comes to integer we must special logic, this is how you can optimize code without a reverse function to reverse integer. Hope this will help someone in future!! I welcome your feedback and solutions-oriented suggestions, thank you for your time.&lt;/p&gt;

&lt;p&gt;Happy Coding❤️❤️❤️&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Reverse Integer without converting into a String</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Fri, 01 Apr 2022 16:35:25 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/reverse-int-without-converting-into-a-string-1gpf</link>
      <guid>https://forem.com/sangeeth_raj/reverse-int-without-converting-into-a-string-1gpf</guid>
      <description>&lt;p&gt;Explanation :&lt;br&gt;
&lt;em&gt;Everyone is familiar with String reverse by when it comes to Integer we must go foe a different technique using Java operators. Here in the method will initialize the return with zero, then create a while loop to iterate until the user input becomes zero, within the loop we will assign value to return variable use Modulo or Remainder Operator by 10 to get only one reminder at the end and store it in in the return variable by adding the answer. After that divide the user input by 10 using Divide Operator so the last value in the Integer will be remove and assign value to input variable. Finally once the user input becomes 0 the loop will stop iteration and return the reversed value. We can call the created method in the main using print statement.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class revNum {

    public static int revNumber(int num) {
        /* Declare the return variable*/
        int ans = 0;

        /* Loop to iterate until the int becomes zero*/
        while (num &amp;gt; 0) {
            /* assign value to return variable
               use Modulo or Remainder Operator in Java
               add to declared return variable */
            ans = ans * 10 + num % 10;

            /* assign value to input variable
               Divide Operator in Java */
            num = num / 10;
        }
               /*return the declared variable*/
        return ans;
    }

    public static void main(String[] args) {
        /* Declare the input*/
        int num = 4567;

        /* Call the revNumber method */
        System.out.println("Before Swap: "+num+"\nAfter Swap: "+ revNumber(num));
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;Before Swap: 4567&lt;br&gt;
After Swap: 7654&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a revNumber() method returning int&lt;/li&gt;
&lt;li&gt;Declare the return variable and initialize with 0 &lt;/li&gt;
&lt;li&gt;Create for loop to iterate until the user input becomes zero&lt;/li&gt;
&lt;li&gt;Assign value to return variable use Modulo or Remainder Operator in Java add to declared return variable&lt;/li&gt;
&lt;li&gt;Assign value to input variable divide Operator in Java&lt;/li&gt;
&lt;li&gt;Return the declared variable&lt;/li&gt;
&lt;li&gt;Declare the input in main method&lt;/li&gt;
&lt;li&gt;Call the revNumber() method in the print statement &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Special Note:&lt;/strong&gt; The reverse function is familiar to you but when it comes to integer we must special logic, this is how you can optimize code without a reverse function to reverse integer. Hope this will help someone in future!! I welcome your feedback and solutions-oriented suggestions, thank you for your time.&lt;/p&gt;

&lt;p&gt;Happy Coding❤️❤️❤️&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Palindrome</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Thu, 17 Mar 2022 14:13:56 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/palindrome-2gn9</link>
      <guid>https://forem.com/sangeeth_raj/palindrome-2gn9</guid>
      <description>&lt;p&gt;&lt;em&gt;A palindrome, such as madam or racecar, is a word, number, phrase, or other sequence of letters that reads the same backward as forward. The following are some examples of when palindrome is used:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get the number from user&lt;/li&gt;
&lt;li&gt;Hold the number in temporary variable&lt;/li&gt;
&lt;li&gt;Reverse the number&lt;/li&gt;
&lt;li&gt;Compare the temporary number with reversed number&lt;/li&gt;
&lt;li&gt;If both numbers are same, print palindrome number&lt;/li&gt;
&lt;li&gt;Else print not palindrome number&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Method 01&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explanation :&lt;br&gt;
Here we will be using a simple logic to check palindrome in easy steps. STEP 01 get the string and reverse it, then STEP 02 compare the original String and Reverse string values if they are equal return true(palindrome) else return false(palindrome).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhh8nmirhohoykqpz8zi4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhh8nmirhohoykqpz8zi4.png" alt="Original String and Reverse string" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Palindrome {

    public static String palindromeCheck(String n) {
        /* return variable */
        String ans = "";        

        /* variable to store reverse string */
        String temp = "";

        /* for loop to reverse the string */
        for (int i = n.length() - 1; i &amp;gt;= 0; i--) {
            /* concatenate character in string */
            temp += n.charAt(i);
        }

        /* compares two strings return true is they are equal */
        if (n.equals(temp)) {
            ans = "Palindrome";
        } else {
            ans = "Not Palindrome";
        }

        /* Return the result*/
        return ans;
    }

    public static void main(String[] args) {
        /* declare the string to check palindrome */
        String name = "dfhh";

        /* call the palindromeCheck method */
        System.out.println(palindromeCheck(name));

    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;Not Palindrome&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define and declare a string variable in the main method.&lt;/li&gt;
&lt;li&gt;Call the user defined method in the print statement.&lt;/li&gt;
&lt;li&gt;Define a variable for return value.&lt;/li&gt;
&lt;li&gt;Define a temp variable to store reverse string.&lt;/li&gt;
&lt;li&gt;Using For loop to reserve the string.&lt;/li&gt;
&lt;li&gt;Use charAt() function to retrieve value and concatenate string value the in temp variable.&lt;/li&gt;
&lt;li&gt;Use equals() function to compares two strings return true is they are equal.&lt;/li&gt;
&lt;li&gt;Return the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Method 02&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explanation :&lt;br&gt;
This a complex code but efficient, we will be comparing the character in the front value(i) of the string to rear value(j) of the string as mentioned in the below image. We will iterate the loop half the time of the length of the string. In the iteration when comparison is done front value will be incremented and rear value will be decremented. Example if the length of the string is 6 the loop will be iterate for 3 time, using the equality operator "==" we will compare primitives then if all the condition is true then it will true return.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foww2wc2pe9tc7x46qmph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foww2wc2pe9tc7x46qmph.png" alt="Character comparision" width="696" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Palindrome {

    public static boolean palindromeCheck(String n) {
        /* Declare variable for front */
        int i = 0;

        /* Declare variable for rear */
        int j = n.length() - 1;

        /* Declare variable for middle */
        int k = (i + j) / 2;

        /* loop to iterate half the length of the string */
        for (int l = 0; l &amp;lt;= k; l++) {

            /* condition to compare primitives */
            if (n.charAt(i) == n.charAt(j)) {

                /* increase value the front */
                i++;

                /* decrease the value of rear */
                j--;
            } else {

                /* Return the result */
                return false;
            }
        }

        /* Return the result */
        return true;
    }

    public static void main(String[] args) {
        /* declare the string to check palindrome */
        String name = "MADAM";

        /* call the palindromeCheck method */
        System.out.println(palindromeCheck(name));

    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;true&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define and declare a string variable in the main method.&lt;/li&gt;
&lt;li&gt;Call the user defined method in the print statement.&lt;/li&gt;
&lt;li&gt;Define a variable for front value.&lt;/li&gt;
&lt;li&gt;Define a variable for rear value.&lt;/li&gt;
&lt;li&gt;Define a variable for middle value.&lt;/li&gt;
&lt;li&gt;Run for loop half the value of string.&lt;/li&gt;
&lt;li&gt;Compare primitives of string from front value and rear value using "==" operator.&lt;/li&gt;
&lt;li&gt;Increase front value and decrease rear value in iteration.&lt;/li&gt;
&lt;li&gt;Return the result.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Special Note&lt;/strong&gt;: Palindrome is commonly asked in interview, method 01 is an easy implementation and method 02 is an efficient implementation. Hope this will help someone in future!! I welcome your feedback and solutions-oriented suggestions, thank you for your time.&lt;/p&gt;

&lt;p&gt;Happy Coding❤️❤️❤️&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Swap two numbers with &amp; without using the third variable</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Wed, 16 Mar 2022 09:51:14 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/swap-two-numbers-with-without-using-the-third-variable-35b7</link>
      <guid>https://forem.com/sangeeth_raj/swap-two-numbers-with-without-using-the-third-variable-35b7</guid>
      <description>&lt;p&gt;&lt;strong&gt;Swap two numbers with using the third variable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explanation :&lt;br&gt;
&lt;em&gt;We will be define two variables and a temp variable. Initialize variable(a),(b) from user input using Scanner class. Here we will simply use 3 step logic to swap the two variables with the help of temp variable. STEP 01 assign variable(a) to variable(temp). STEP 02 assign variable(b) to variable(a). STEP 03 assign variable(temp) to variable(b). Finally print the swapped variables.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.Scanner;

public class SwapTwo {

    public static void main(String[] args) {
        /* initialize variables */
        int a, b, temp;

        /* Input from the user */
        System.out.println("Enter values:");
        Scanner sc = new Scanner(System.in);

        System.out.print("a = ");
        a = sc.nextInt();

        System.out.print("b = ");
        b = sc.nextInt();

        /*Assign value of variable a to temp*/
        temp = a;

        /*Assign value of variable b to a*/
        a = b;

        /*Assign value of variable temp to b*/
        b = temp;

        /* finally print the swapped values */
        System.out.println("After swap : a = " + a + ", b = " + b);
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;Enter values:&lt;br&gt;
a = 45&lt;br&gt;
b = 64&lt;br&gt;
After swap : a = 64, b = 45&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define two variables and a temp variable.&lt;/li&gt;
&lt;li&gt;Initialize variable from the users inputs.&lt;/li&gt;
&lt;li&gt;Assign value of variable(a) to variable(temp).&lt;/li&gt;
&lt;li&gt;Assign value of variable(b) to variable(a).&lt;/li&gt;
&lt;li&gt;Assign value of variable(temp) to variable(b).&lt;/li&gt;
&lt;li&gt;Finally, print the swapped variables.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Swap two numbers without using the third variable&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explanation :&lt;br&gt;
&lt;em&gt;We will be define two variables and declare them from user end using Scanner class. Using simple logic to swap the two variables with 3 steps. STEP 01 we will get the sum of two variables and assign it to 1st variable(a). STEP 02 we will be deduct the value of 2nd variable(b) from the sum(a=a+b) and assign it to the 2nd variable(b). STEP 03 we will repeat the STEP 02 but here the value of 2nd variable is changed so that the answer will be the initial value of 2nd variable. Finally print the swapped variables.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.Scanner;

public class SwapTwoNum {

    public static void main(String[] args) {
        /* initialize variables */
        int a, b;

        /* Input from the user */
        System.out.println("Enter values:");
        Scanner sc = new Scanner(System.in);

        System.out.print("a = ");
        a = sc.nextInt();

        System.out.print("b = ");
        b = sc.nextInt();

        /*get sum of both a and b, assign it to a*/
        a = a + b;

        /* Subtracting the value of b from the sum(a=a+b), assign it to b*/
        b = a - b;

        /* assign a by subtracting sum(a=a+b) by b where b value is swapped*/
        a = a - b;

        /* finally print the swapped values */
        System.out.println("After swap : a = " + a + ", b = " + b);
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;Enter values:&lt;br&gt;
a = 34&lt;br&gt;
b = 56&lt;br&gt;
After swap : a = 56, b = 34&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Define two variables.&lt;/li&gt;
&lt;li&gt;Initialize variables from the users inputs.&lt;/li&gt;
&lt;li&gt;Get sum of both a and b(a+b) and assign it to variable "a".&lt;/li&gt;
&lt;li&gt;Subtract the value of "b" from the sum(a=a+b), assign it to variable "b".&lt;/li&gt;
&lt;li&gt;Assign "a" with the value of sum(a=a+b) - "b" the new swapped variable.&lt;/li&gt;
&lt;li&gt;Finally, print the swapped variables.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Special Note&lt;/strong&gt;: This may see simple but expressing the logic is the difficult part in explanation. Hope this will help someone in future!! I welcome your feedback and solutions-oriented suggestions, thank you for your time.&lt;/p&gt;

&lt;p&gt;Happy Coding❤️❤️❤️&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Reverse a String in Java</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Tue, 15 Mar 2022 18:46:05 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/reverse-a-string-in-java-50eo</link>
      <guid>https://forem.com/sangeeth_raj/reverse-a-string-in-java-50eo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Java Program to reverse a string using StringBuilder&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Explanation :&lt;br&gt;
&lt;em&gt;Strings are Objects in Java that are internally supported by a char array. Strings are immutable because arrays are immutable(closed for modification). Every time you make a change to a String, a new String is produced. So that we are using StringBuilder which is mutable.&lt;/em&gt; Note: we can use StringBuffer class as well.&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ReverseStringBuilder {

    public static void main(String[] args) {

        /* String is immutable */
        String name = "Palindrome";

        /* Create StringBuilder(mutable) object */
        StringBuilder s1 = new StringBuilder();

        /* Using append() and reverse() in StringBuilder */
        s1.append(name);
        s1 = s1.reverse();

        /* Print the reverse */
        System.out.println(s1);

    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;emordnilaP&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps : &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a String class object and initialize it.&lt;/li&gt;
&lt;li&gt;Create a object of string builder class.&lt;/li&gt;
&lt;li&gt;Use the inbuilt function of string builder append() and reverse().&lt;/li&gt;
&lt;li&gt;Finally print string builder object. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Java Program to reverse a string without using String inbuilt function reverse().&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Method 01&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
Explanation :&lt;br&gt;
The toCharArray() function is used to transform that string into a character array. Following that, we'll use the for loop to run through each character in reverse order, get output for each character.&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Reverse {

    public static void main(String[] args) {

        /* String is immutable */
        String name = "Palindrome";

        /* Using toCharArray() function */
        char[] ch = name.toCharArray();

        /* Temp string */
        String rev = "";

        /* Iterating for loop in reverse to store */
        for (int i = ch.length - 1; i &amp;gt;= 0; i--) {
            /* Concatenating Strings */
            rev += ch[i];
        }

        /* Print the reverse */
        System.out.println(rev);

    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;emordnilaP&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a String class object and initialize it.&lt;/li&gt;
&lt;li&gt;Create a char array and call the toCharArray() function with String object.&lt;/li&gt;
&lt;li&gt;Creating a String class object for temp variable.&lt;/li&gt;
&lt;li&gt;Iterating the for loop in reverse to get each character in reverse order.&lt;/li&gt;
&lt;li&gt;Concatenating each character in Temp variable. &lt;/li&gt;
&lt;li&gt;Finally print Temp. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Method 02&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
Explanation :&lt;br&gt;
&lt;em&gt;Using the for loop, we printed the string in reverse order. The charAt(index) method, on the other hand, returns the character at any given index. The character will be concatenated after each iteration to reverse the string variable.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ReverseCharAt {

    public static void main(String[] args) {

        /* String is immutable */
        String name = "Palindrome";

        /* Temp string */
        String rev = "";

        /* Iterating for loop in reverse to store */
        for (int i = name.length() - 1; i &amp;gt;= 0; i--) {
            /* Concatenating Strings */
            rev = rev + name.charAt(i);
        }

        /* Print the reverse */
        System.out.println(rev);

    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output :&lt;br&gt;
&lt;code&gt;emordnilaP&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Steps :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a String class object and initialize it.&lt;/li&gt;
&lt;li&gt;Creating a String class object for temp variable.&lt;/li&gt;
&lt;li&gt;Iterating the for loop in reverse to get each character in reverse order.&lt;/li&gt;
&lt;li&gt;Concatenating each character to Temp variable by calling charAt() function. &lt;/li&gt;
&lt;li&gt;Finally print Temp.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Special Note&lt;/strong&gt;&lt;/em&gt;: The reverse function is familiar to you but the motive is to introduce the possibility of StringBuilder and how you can optimize code without a reverse function. Hope this will help someone in future!! I welcome your feedback and solutions-oriented suggestions, thank you for your time&lt;/p&gt;

&lt;p&gt;Happy Coding❤️❤️❤️&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Find Third Largest Number in an Array</title>
      <dc:creator>Sangeethraj</dc:creator>
      <pubDate>Tue, 15 Mar 2022 11:21:16 +0000</pubDate>
      <link>https://forem.com/sangeeth_raj/find-third-largest-number-in-an-array-17gp</link>
      <guid>https://forem.com/sangeeth_raj/find-third-largest-number-in-an-array-17gp</guid>
      <description>&lt;p&gt;Problem to be solved:&lt;br&gt;
&lt;em&gt;You are given an unsorted array of integers, what is the optimal way to find the third largest number in the array? Note: the array contains duplicate values and negative values as well, and also this code should work if the array length increase by N number of times.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The solution is given in JAVA:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1: Unsorted array with Negative values&lt;/strong&gt;&lt;br&gt;
Input: [87, 99, -14, 05, 46, 54]&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ThirdLargestNumInArray {

    public static void main(String[] args) {

        /*
         * unsorted Array with duplicate and negative values
         */
        Integer arr[] = { 87, 99, -14, 05, 46, 54 };

        /* Variable initialization */
        int largest = 0, secondLargest = 0, thirdLargest = 0;

        /* Condition to find */
        for (int i = 0; i &amp;lt; arr.length; i++) {
            if (arr[i] &amp;gt; largest) {
                /*
                 * if condition is true assign large value to second large value
                 */
                secondLargest = largest;

                /* assign new large value */
                largest = arr[i];

            } else if (arr[i] &amp;gt; secondLargest) {
                /*
                 * if condition is true assign second large value to third large value
                 */
                thirdLargest = secondLargest;

                /* assign new second large value */
                secondLargest = arr[i];

            } else if (arr[i] &amp;gt; thirdLargest) {
                /*
                 * if condition is true the third largest value will be assigned
                 */
                thirdLargest = arr[i];
            }
        }

        /* Print the values */
        System.out.println("Largest = " + largest);
        System.out.println("Second Largest = " + secondLargest);
        System.out.println("Third Largest = " + thirdLargest);

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Largest = 99
Second Largest = 87
Third Largest = 54
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;As mentioned above the array is initialized with both positive and negative values&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We are initialized variables to store the largest, second largest and third largest respectively. &lt;em&gt;Note: variables are initialized with 0 for one special case which is, if 3rd max element is not present in the array then it will return 0.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Iterate the loop N(length of the array) number time to find the 3 largest value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If condition is to assign large value to second large value and initialize the new large value in the array.&lt;br&gt;
1st elseif condition is to assign second large value to third large value and initialize the new second large value in the array.&lt;br&gt;
2nd elseif condition is to assign third large value in the array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally print the variables.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Example 2: Unsorted array with negative and duplicate values&lt;/strong&gt;&lt;br&gt;
Input: [77, 101, 95, 14, 05, 46, -47, 94, 00, 95, 52, 86, 36, -54, 94, 89]&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;

public class ThirdLargestNumInSet {

    public static void main(String[] args) {

        /*
         * unsorted Array with duplicate and negative values
         */
        Integer arr[] = { 77, 101, 14, 05, 46, -47, 94, 00, 95, 52, 86, 36, -54, 94, 89 };

        /* Variable initialization */
        int largest = 0, secondLargest = 0, thirdLargest = 0;

        /*
         * using LinkedHashSet - Map to remove duplication in Array
         */
        Set&amp;lt;Integer&amp;gt; newSet = new LinkedHashSet&amp;lt;&amp;gt;();

        for (int i = 0; i &amp;lt; arr.length; i++) {
            newSet.add(arr[i]);
        }

        /* Condition to find */
        for (Integer i : newSet) {
            if (i &amp;gt; largest) {
                /*
                 * if condition is true assign large value to second large value
                 */
                secondLargest = largest;

                /* assign new large value */
                largest = i;

            } else if (i &amp;gt; secondLargest) {
                /*
                 * if condition is true assign second large value to third large value
                 */
                thirdLargest = secondLargest;

                /* assign new second large value */
                secondLargest = i;

            } else if (i &amp;gt; thirdLargest) {
                /*
                 * if condition is true the third largest value will be assigned
                 */
                thirdLargest = i;
            }
        }

        /* Print the values */
        System.out.print("Largest = " + largest);
        System.out.print("\nSecond Largest = " + secondLargest);
        System.out.print("\nThird Largest = " + thirdLargest);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Largest = 101
Second Largest = 95
Third Largest = 94
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation: &lt;br&gt;
The pseudocode used in both codes are same but only diference in Example 02 is we use LinkedHashSet which is a Java collections where we store unique objects this result in removal of duplicate values in the array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other Preference :&lt;/strong&gt; &lt;br&gt;
We can use Bubble Sort Algorithm (sort by smallest to largest order) to sort the array and find the largest value of the array.&lt;/p&gt;

&lt;p&gt;Input: [87, 99, 14, 05, 46, 54]&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;

public class Main {

    public static void bubblesort(Integer[] arr) {

        int n = arr.length;
        int temp;

        for (int i = 0; i &amp;lt; n - 1; i++) {
            for (int j = 0; j &amp;lt; n - 1; j++) {
                if (arr[j] &amp;gt; arr[j + 1]) {
                    temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }

            }
        }

    }

    public static void main(String[] args) {

        Integer[] arr = { 87, 99, 14, 05, 46, 54 };

        bubblesort(arr);

        System.out.print("array after sorting : ");
        for (int i = 0; i &amp;lt; arr.length; i++) {
            System.out.print(arr[i] + " ");
        }

        int n = arr.length;

        int max = arr[n - 3];
        System.out.println("\n3rd largest value: " + max);
    }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array after sorting : 5 14 46 54 87 99 
3rd largest value: 54
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Special Note:&lt;/strong&gt; &lt;em&gt;I came up with this solution after facing an interview which is to find O(n) time complexity for code without having O(n^2) time complexity. Hope this will help someone in future!! I welcome your feedback and solutions-oriented suggestions, thank you for your time&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Happy Coding❤️❤️❤️&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
