Minimum Circular Rotations to Obtain a Numeric String in C++

Satvik Watts
Updated on 01-Nov-2023 12:44:40

103 Views

In this article, we will find the minimum circular rotations that are needed to obtain a given numeric string, target, by avoiding a given set of strings. The target strings and the strings in the set of string both have a size of N. The initial string will be a string containing all zeroes and the length of the input string will also be N. In the approach discussed in this article, we will use a queue data structure and a set data structure. The queue data structure will hold the strings that we are currently at, i.e., the numeric ... Read More

Maximum Count of Pairs with Element at Position i

Satvik Watts
Updated on 01-Nov-2023 12:40:29

170 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
Updated on 01-Nov-2023 12:34:52

213 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
Updated on 01-Nov-2023 12:30:09

169 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
Updated on 01-Nov-2023 12:15:11

313 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
Updated on 01-Nov-2023 11:56:06

141 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
Updated on 01-Nov-2023 06:18:20

58K+ 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

What Are System Calls in Operating System

Kristi Castro
Updated on 01-Nov-2023 06:08:58

54K+ Views

The interface between a process and an operating system is provided by system calls. In general, system calls are available as assembly language instructions. They are also included in the manuals used by the assembly level programmers. System calls are usually made when a process in user mode requires access to a resource. Then it requests the kernel to provide the resource via a system call.A figure representing the execution of the system call is given as follows −As can be seen from this diagram, the processes execute normally in the user mode until a system call interrupts this. Then ... Read More

What is Congestion Control Algorithm

Ginni
Updated on 01-Nov-2023 06:04:30

63K+ Views

Congestion causes choking of the communication medium. When too many packets are displayed in a method of the subnet, the subnet's performance degrades. Hence, a network's communication channel is called congested if packets are traversing the path and experience delays mainly over the path's propagation delay. There is two congestion control algorithm which is as follows: Leaky Bucket The leaky bucket algorithm discovers its use in the context of network traffic shaping or rate-limiting. The algorithm allows controlling the rate at which a record is injected into a network and managing burstiness in the data rate. ... Read More

Differences Between 8085 and 8086 Microprocessor

Kiran Kumar Panigrahi
Updated on 01-Nov-2023 02:53:55

35K+ Views

A microprocessor is an integrated circuit which can function as a central processing unit (CPU) of a computer system or a microcontroller. It is constructed by integrating millions of transistors, diodes, and resistors on a single electronic chip.8085 and 8086 are two major types of microprocessors produced by Intel. Go through this article to find out the major differences between 8085 and 8086 microprocessors.What is 8085 Microprocessor?The 8085 microprocessor is an 8-bit microprocessor produced by Intel in 1976. The 8085 microprocessor has 8-bit long data bus, thus it can process 8-bit of data in a single cycle. The 8085 microprocessor ... Read More

Advertisements