Articles on Trending Technologies

Technical articles with clear explanations and examples

Shortest path between two points in a Matrix with at most K obstacles

Satvik Watts
Satvik Watts
Updated on 01-Nov-2023 343 Views

In this article, we will find the shortest path between two points in a matrix. The matrix contains two types of cells, empty cells and cells which have obstacles. We are given an integer K, which represents that we can remove at most K obstacles to reach our destination. In the approach discussed in this article, we will do a breadth first search (BFS) on the matrix to find the shortest path. We will use a queue data structure, which will store a vector of integers. The vector will have 3 integers, the x coordinate, the y coordinate and the ...

Read More

Maximum count of pairs such that element at position i is included in a[i] pairs

Satvik Watts
Satvik Watts
Updated on 01-Nov-2023 234 Views

In this article, we will find the number of the pair of indices, such that an index i can be included in at most a[i] number of pairs. In the approach discussed in this article, we will use a priority queue data structure which will contain the elements of the array. The priority queue data structure will be a maximum heap which will allow us to get the current maximum elements of the array on log(N) time. It will also allow us to modify the elements and insert them back in, in the same amount of time. We will ...

Read More

Maximum width of a Binary Tree with null values

Satvik Watts
Satvik Watts
Updated on 01-Nov-2023 295 Views

A binary tree is defined as a tree data structure where each has at most two children. The width of a binary tree for a level is defined as the number of nodes between the rightmost and leftmost nodes of that level, including the NULL nodes that come in between. The maximum width of a binary tree is defined as the maximum of all the widths at each level of the binary tree. In this first approach, we represent the binary tree as an array representation of the Heap data structure. At each level, the width of that level will ...

Read More

Longest subsegment of 1’s formed by changing at most k 0’s (Using Queue)

Satvik Watts
Satvik Watts
Updated on 01-Nov-2023 240 Views

In this article, we will find the longest subsegment of 1’s which can be formed by changing at most k 0’s to 1’s. We will be using queue data structure to solve this problem. In the approach discussed in this article, we will use a queue data structure to find the longest subarray containing only 1’s, which can be formed by changing at most k 0’s into 1’s. The queue data structure will be used to store the indices of 0 elements that have occurred previously. Whenever we encounter a new 0, we will check the size of the queue. ...

Read More

FIFO Push Relabel Algorithm

Satvik Watts
Satvik Watts
Updated on 01-Nov-2023 397 Views

The FIFO Push Relabel algorithm is an algorithm that is used to solve the maximum flow problem. The maximum flow problem is a problem in graph theory in which we have to find the maximum amount of flow of resources or information that can be sent via an interconnected network of components, like pipes, wires, etc. With constraints on how much capacity a single component can handle. In other words, we have a directed graph on N nodes. We are given a source node and a sink node. We also have M edges in the graph, each edge has a ...

Read More

Count of pair of nodes at even distance (Using BFS)

Satvik Watts
Satvik Watts
Updated on 01-Nov-2023 211 Views

In this article, we will find the number of the pair of nodes, which are at an even distance of each other in a graph. We will be using the breadth first search (BFS) approach to find the total count. In the approach discussed in this article, we will use a queue data structure which will contain pair of integers. The queue data structure will allow us to go through the graph using the breadth first search algorithm (BFS). We will pick a random node and apply the breadth first search from that node. We will use two variables to ...

Read More

Difference between BJT and MOSFET

Manish Kumar Saini
Manish Kumar Saini
Updated on 01-Nov-2023 62K+ Views

BJTs are three-terminal semiconductor devices used for switching and amplification of signals. MOSFETs, on the other hand, are four-terminal semiconductor devices used for switching applications. Read through this article to find out more about BJTs and MOSFETs and how they differ from each other.What is BJT?BJT stands for Bipolar Junction Transistor. It is a type of transistor in which the current flow is due to two types of charge carriers viz. electrons and holes. A BJT consists of three alternating layers of P-type and N-type semiconductor materials and two P-N junctions. The BJT has three terminals viz. emitter (E), base ...

Read More

Difference between Synchronous and Asynchronous Sequential Circuits

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 01-Nov-2023 60K+ Views

Both Synchronous and Asynchronous Sequential Circuits are types of sequential circuits that use feedback for the next output generation. On the basis of the type of this feedback, both circuits can be differentiated. A sequential circuit is one whose output depends upon both present and past inputs. The classification of sequential circuits into synchronous and asynchronous sequential circuits is done on the basis of their triggering. In a synchronous sequential circuit, the changes in all the state variables are synchronized with the universal clock signal. In contrast, in an asynchronous sequential circuit, the changes in all the state variables are ...

Read More

How to check if a file exists in Golang?

Mukul Latiyan
Mukul Latiyan
Updated on 01-Nov-2023 43K+ Views

In order to check if a particular file exists inside a given directory in Golang, we can use the Stat() and the isNotExists() function that the os package of Go's standard library provides us with.The Stat() function is used to return the file info structure describing the file. Let's first use the Stat() function only and see whether it will be enough to detect the presence of a file in Go.Example 1Consider the code shown below.package main import(    "fmt"    "os" ) func main() {    if _, err := os.Stat("sample.txt"); err == nil {       fmt.Printf("File ...

Read More

How to Convert Numbers to Words in Indian Rupees in Excel?

Pradeep Kumar
Pradeep Kumar
Updated on 01-Nov-2023 122K+ Views

When we need to convert numbers to words in Indian rupees in Excel, it can be a time‑consuming process if we do it manually as we need to type the large numbers. We can complete this time-consuming process much more quickly by using the VBA application. Even though the VBA code will be lengthy, we can use this process if there are many values to convert. Read this tutorial to learn how to convert numbers to words in Indian rupees in Excel. Converting Numbers to Words in Indian Rupees in Excel Here we will create a new VBA module, then ...

Read More
Showing 33161–33170 of 61,297 articles
Advertisements