An SCR is a three-terminal, three-junction, and four-layer semiconductor device that is used to perform switching functions in power circuits.Sometimes the SCR is also called as Thyristor.Constructional Details of SCRThe SCR has three pn – junctions, and four layer of p and n type semiconductor joined alternatively to get pnpn device. The three terminals are taken – one from outer p – type layer called anode (A), second from the outer n – type layer called cathode (K) and the third from the internal p –type layer called gate (G).Working of SCRIn a SCR, the load is connected in series ... Read More
Locking and unlocking of the database should be done in such a way that there is no inconsistency, deadlock, and no starvation.2PL locking protocolEvery transaction will lock and unlock the data item in two different phases.Growing Phase − All the locks are issued in this phase. No locks are released, after all changes to data-items are committed and then the second phase (shrinking phase) starts.Shrinking phase − No locks are issued in this phase, all the changes to data-items are noted (stored) and then locks are released.The 2PL locking protocol is represented diagrammatically as follows −In the growing phase transaction ... Read More
Triangle consists of three sides and three angles. Based on the three sides, there are three types of triangle −Equilateral triangle: All three sides are equal.Isosceles triangle: All two sides are equal.Scalene triangle: No sides are equal.Follow the algorithm given below for writing the respective program.AlgorithmStep 1: Declare three sides of triangle. Step 2: Enter three sides at run time. Step 3: If side1 == side2 && side2 == side3 Go to step 6 Step 4: If side1 == side2 || side2 == side3 || side3 == side1 Go to Step 7 Step 5: Else Go to step 8 Step ... Read More
Introduction The tar command in Linux is one of the most essential commands when it comes to file management. It is short for Tape Archive and is used to create and extract archive files. An archive file is a compressed file that contains one or more files bundled together for more accessible storage and portability. In this guide, we'll demonstrate, through examples, how to create, list, edit, and extract tar archive files, and cover some of the more commonly used tar command options. Syntax of the tar command The tar command accepts the following syntax − $ $ tar [options][archive-file] ... Read More
Call by Value means calling a method with a parameter as value. Through this, the argument value is passed to the parameter.While Call by Reference means calling a method with a parameter as a reference. Through this, the argument reference is passed to the parameter.In call by value, the modification done to the parameter passed does not reflect in the caller's scope while in the call by reference, the modification done to the parameter passed are persistent and changes are reflected in the caller's scope.Following is the example of the call by value −The following program shows an example of ... Read More
As processes are loaded and removed from memory, the free memory space is broken into little pieces. It may so happen after sometime that processes cannot be allocated to memory blocks considering their small size and memory blocks remain unused. This problem is known as Fragmentation. There are two types of fragmentation namely, Internal Fragmentation and External Fragmentation. Read this article to learn more about these two types of fragmentation and how they are different from each other. What is Internal Fragmentation? Internal fragmentation is defined as the difference between memory allocated and the memory space required by a process. ... Read More
A process is a program in execution and it is more than a program code called as text section and this concept works under all the operating system because all the task perform by the operating system needs a process to perform the taskThe process executes when it changes the state. The state of a process is defined by the current activity of the process.Each process may be in any one of the following states −New − The process is being created.Running − In this state the instructions are being executed.Waiting − The process is in waiting state until an ... Read More
ProblemWrite a C program to display all the prime numbers between 1 and n is a value given by the user at run time.SolutionC program to display all the prime numbers between 1 and n is a value given by the user at run time is explained below −AlgorithmGiven below is an algorithm to display all the prime numbers between 1 and n is a value given by the user at run time.Step 1 − Read n value.Step 2 − Initialize count = 0Step 3 − for i = 2 to n a. for j = 1 to i b. ... Read More
The readers-writers problem relates to an object such as a file that is shared between multiple processes. Some of these processes are readers i.e. they only want to read the data from the object and some of the processes are writers i.e. they want to write into the object.The readers-writers problem is used to manage synchronization so that there are no problems with the object data. For example - If two readers access the object at the same time there is no problem. However if two writers or a reader and writer access the object at the same time, there ... Read More
The all pair shortest path algorithm is also known as Floyd-Warshall algorithm is used to find all pair shortest path problem from a given weighted graph. As a result of this algorithm, it will generate a matrix, which will represent the minimum distance from any node to all other nodes in the graph.At first the output matrix is same as given cost matrix of the graph. After that the output matrix will be updated with all vertices k as the intermediate vertex.The time complexity of this algorithm is O(V3), here V is the number of vertices in the graph.Input − ... Read More