Algorithm: Insertion Sort

Algorithms

Insertion Sort repeatedly takes the next element and inserts it into its correct position within the sorted part of the array.

Basically, it finds the correct position of an element and inserts it in that correct position. In that process, it shifts the rest of the elements to make space for that key element.

This is not a very efficient sorting algorithm, but it is easy to understand, as there are lots of swapping/shifting operations involved.

Algorithm: Selection Sort

Algorithms

Selection sort is a comparison-based sorting algorithm. It works by repeatedly finding the smallest element from the unsorted part of the array, and placing it at the beginning.

It is easy to understand and implement the algorithm, but it has a time complexity of O(n^2). So, very inefficient for large datasets.

Algorithm: Big O Notation

Algorithm

There are the big O notations that we commonly encounter- Big O Notation Name Description O(1) Constant O(n) Linear O(n^2) Quadratic O(n^3) Cubic O(log(n)) Logarithmic (Log Linear) O(n log(n)) Linearithmic O(n!) Factorial O(2^n) Exponintial

Kubernetes: Control Plane

Control Plane is the collection of components and process, that are responsible for managing a Kubernetes cluster. It makes the decision about the cluster and detects/responds to cluster events(like starting/restarting pods to maintain the desired deployment status). NOTE Control Plane is the brain of the Kubernetes cluster. It is not a single service, but Control … Read more

Kubernetes: Pods

As the first step, we take our application and create a Docker image. Once the image is created, it works as a portable runtime for our application. Now we can create a container from that image and run it in a Docker environment or in a container orchestration system like Kubernetes. What is a Pod? … Read more

PHP: __sleep() Magic Method

Summary Method Name __sleep() Type Magic Method Access Modifier public Parameters None Return Type array Purpose/Usage Returns an array of the property names of the classwhich should be included when an object of that class is serialized When Invoked Automatically invoked by the serialize() method. Limitations Can not serialize resource. Signature public function __sleep(): array … Read more

Kubernetes: Worker Node

Worker node provides runtime for the application. Pods run completely on the worker node. Worker Node Components Worker node components- Kubelet Kubelet is a service on the worker node, that communicates with the master node. Kubelet also connects the containers using a Container Runtime Interface(CRI). Container Runtime As a container orchestration system, Kubernetes does not … Read more