Skip to main content

Posts

bubble sort algorithm in c++ || Bubble sort explained || sinking sort

 Bubble sort- Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass of the list is repeated until the list is sorted. Why bubble sort is called “bubble” sort? The “bubble” sort is called so  because the list elements with greater value than their surrounding elements “bubble” towards the end of the list . For example, after first pass, the largest element is bubbled towards the right most position. Worst complexity :  n^2 Average complexity :  n^2 Best complexity :  n Space complexity :  1 at the end of i th pass, we have the i th largest element placed at its correct place. look the example below. Example:   First Pass:   (  5   1  4 2 8 ) –> (  1   5  4 2 8 ) ( 1  5   4  2 8 ) –>  ( 1  4   5  2 8 ) ( 1 4  5   2  8 ) –>  ( 1 4  2   5  8 ) ( 1 4 2  5   8  ) –> ( 1 4 2  5   8  ) 1st largest placed at the correct place. Second

What is an algorithm in computer science ?

 What is an algorithm in computer science ?- You may have heard the term  algorithm  recently, whether it was online or perhaps in some conversation about technology. It's a word that gets thrown around a lot, but what does it mean exactly? suppose your mom gave you a task to prepare a cup of tea for her. How do you prepare a cup of tea for her ? definitely, to prepare a cup of tea you are gonna follow the following steps 1- Boil water. 2- Warm up teapot 3-  Put the tea into a teapot and add hot water. 4- Cover teapot and steep tea 5- Strain tea solids and pour hot tea into tea cups. Basically preparing tea was a problem and you follow some step-by-step procedures to solve this problem.  similarly, in computer science,  An algorithm is simply a  set of steps used to complete a specific task . They're the building blocks for programming, and they allow things like computers, smartphones, and websites to function and make decisions. An algorithm is a specific procedure for solvin

How to find all prime number till N? most efficient solution Sieve of Eratosthenes in c++

 How to find all prime number till N? most efficient solution Sieve of Eratosthenes- There are multiple ways to find prime numbers till N. but the sieve of Eratosthenes is the most efficient solution to find prime numbers till n. This efficient solution often used in competitive programming contests. algorithm step by step - step -1 Create a bool vector of size n  and initialize it by false value. step -2  create an empty vector to store prime numbers. step 3-  loop through the visited vector from 2 to n. step 4- if the current value is pointing to unvisited we will push this value to our answer vector and mark visited it's all multiple till n. check below image how it works.                Code for  most efficient solution Sieve of Eratosthenes in c++  

Entire work summary GSOC 2021 coding period || final wrap up blog

 Entire work summary GSOC 2021 coding period - Hey, reader Welcome to my blog.  In this blog post, I am going to share my entire work during GSOC 2021 coding period. take a cup of coffee and enjoy this blog post.  The coding period for GSoC 2021 started in June month. I was very excited about the coding period. I was part of  Improve LibreHealth Toolkit Cost of Care Explorer   Project. The goal of this project is to improve the existing flutter application and web application.   Robby O'Connor and Mua Rachmann   mentoring me in this project.  Task Done during GSOC 2021 coding period -  1- migrated flutter application to null safety  As soon as the coding period has begun I choose to improve the cost of care flutter application.  Since this flutter application was not migrated to null safety I migrated it to null safety. link of work -   https://gitlab.com/librehealth/toolkit/cost-of-care/lh-toolkit-cost-of-care-app/-/merge_requests/89 2- added bookmark feature  I added a bookmark f

Week 10 Coding period GSOC 2021 LibreHealth

       Week 10 Coding period GSOC 2021 LibreHealth- Hey, Reader's we are in the 10th week of the coding period. The 10th week started on  August. This week I write test file for web app. What progress have you made this week- In the 10th week of the coding period, I have done the following thing with the cost of care web application. 1-Write unit Test file for web app.  2- send I MR. MR link -  https://gitlab.com/librehealth/toolkit/cost-of-care/lh-toolkit-cost-of-care-explorer/-/merge_requests/15 My plan for next week- 1-Work Toward the final submission of the project. 2-bug finding and fix them  . GSOC 2021 coding period is about to end now we are entering the final evaluation of the coding period. Stay tuned for further updates.  See you next week.

Week 9 Coding period GSOC 2021 LibreHealth

      Week 9 Coding period GSOC 2021 LibreHealth- Hey, Reader's we are in the 9th week of the coding period. The 9th week started on 30 July. This week I completed the Hospital Rating feature. What progress have you made this week- In the 9th week of the coding period, I have done the following thing with the cost of care web application. 1-Completed Hospital Rating feature.  2- designed hospital rating UI. 3- Displayed Comparison data into the table. 4- send I MR. MR link -  https://gitlab.com/librehealth/toolkit/cost-of-care/lh-toolkit-cost-of-care-explorer/-/merge_requests/14 My plan for next week- I have planned to do the following task for week 10 1-Writing Unit testing for web app. 2-complete the previous task . UI for hospital rating designed based on my mentor Mua Rachmann's suggestion. He suggested displaying comparison data into tabular form and it is looking decent now. Thank you Mua Rachmann. See you next week.

Week 8 Coding period GSOC 2021 LibreHealth

     Week 8 Coding period GSOC 2021 LibreHealth- Hey, Reader's we are in the 8th week of the coding period. The 8th week started on 23rd July. This week I was working on compare hospitals with ratings. What progress have you made this week- In the 8th week of the coding period, I have done the following thing with the cost of care web application. 1-Started working on compare hospitals screens.  2- extracted JSON data from compare hospitals Excels file. 3- fixed pipeline. 4- completed pending task. MR link -  https://gitlab.com/librehealth/toolkit/cost-of-care/lh-toolkit-cost-of-care-explorer/-/merge_requests/13 My plan for next week- I have planned to do the following task for week 9 1-UI modification of compare hospital with star rating. 2- I will send 1 MR with compare hospitals feature. This week I was a bit busy because of college work.  See you next week.