Sign in

Tech Enthusiast | Undergraduate | Blogger
Photo by Kai Wenzel on Unsplash

In this article, I will discuss how to complete an essential integration with Google Sign-In with Node JS and Passport JS.

Initializing a NodeJS Project

To begin with, let’s create an Express Application. Create a new…

Photo by Christopher Gower on Unsplash

In this article, you will learn about greedy algorithms and how these can be used in a lot of programming problems.

Greedy algorithms are simple instinctive algorithms used for optimization (either maximized or minimized) problems. This algorithm makes the best choice at every step and attempts to find the optimal way to solve the whole problem. This means that it makes a locally optimal choice in the hope that this choice will lead to a globally optimal solution. Generally, greedy algorithms do not provide globally optimized solutions.

This algorithm is very successful in many tasks but, in some cases, it…

Understanding the greedy algorithm

Photo by Red Zeppelin on Unsplash

Let’s think of an array of stick-lengths, find which three sticks form a non-degenerate triangle such that:

  • the triangle has a maximum perimeter
  • if there are two or more combinations with the same value of maximum perimeter, output the one with the longest side.
  • Output -1 if not possible

Are you confused about the non-degenerate triangle?

If a, b and c are the sides of the triangle, and if the following 3 conditions are true, then it is a non-degenerate triangle.

Basics of Model-View-Controller Architecture

Photo by Paul Skorupskas on Unsplash

What is MVC architecture?

The Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components is built to handle specific development aspects of an application. MVC is one of the most frequently used industry-standard web development frameworks to create scalable and extensible projects.

Photo by Derzulya Zaza on Unsplash

The above feature makes it a LIFO (Last-In-First-Out) data structure. Here, the element which is inserted last is accessed first. In stack…

Photo by Denis Cherkashin on Unsplash

In this article, I am going to discuss the most useful Widgets that we need when we are going to develop a flutter application.

  1. AppBar class
  2. Scaffold class
  3. Container class

1. AppBar class

AppBar is usually the topmost component of the app (or sometimes the bottom-most), it contains the toolbar and some other common action buttons. All the components in a flutter application is a widget or a combination of…

One of the main reasons to use threads in Java is to make a task run parallel to another task.

Photo by Alex Palmer on Unsplash

Why we use Threads in Java?

We use Threads to make Java applications faster by doing multiple things at the same time. In technical terms, Thread helps us to achieve parallelism in Java programs. Since the CPU is high-speed and it even contains multiple cores, just one Thread cannot take advantage of all the cores. This means our costly hardware will remain idle for most of the time.

Using multiple threads, we can take full advantage of multiple cores by serving more clients and serving them…

The Map interface is not a subtype of the Collection Interface. Therefore it behaves a bit differently from the rest of the collection types.

Photo by Dariusz Sankowski on Unsplash

In my previous article, we discussed Java lists, queues, and sets in the Java Collection Interface. If you are not familiar with lists, queues, and sets. Let’s dive into Java Map Interface.

What is the Java Map Interface?

The Map interface is present in java.util package and represents a mapping between a key and a value. The Map interface is not a subtype of the Collection Interface. Therefore it behaves a bit differently from the rest of the collection types.

A Map…

Architecture for storing and manipulating a group of objects

Photo by Leora Dowling on Unsplash

What is meant by the collection framework?

The Collection in Java is a framework that provides an architecture to store and manipulate the group of objects.

Java Collections can achieve all the operations we perform on data, such as searching, sorting, insertion, manipulation, and deletion.

Java Collection means a single unit of objects. Java Collection framework provides many interfaces (List, Set, Queue, Deque) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet).

Hierarchy of Collection Framework

The java.util package contains all the classes and interfaces for the Collection framework.

Photo by Sophie Elvis on Unsplash

Why is having a strong understanding of algorithms so important? Because when we are writing a solution for a problem we have to implement the most efficient, reliable, and fast code in a short time. If we haven’t got a proper grasp of algorithms then we are going to struggle with our code.

In this article, I am going to discuss two commonly used sorting algorithm techniques that reduce the time complexity.

  1. Quicksort
  2. Bubblesort

1. Quicksort

This is a highly efficient algorithm that uses the time complexity of O(n log n) for the worst case and n² for the average case. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store