The Graph Coloring

Mahesh Parahar
Updated on 07-Nov-2023 05:08:44

44K+ Views

Graph coloring is the procedure of assignment of colors to each vertex of a graph G such that no adjacent vertices get same color. The objective is to minimize the number of colors while coloring a graph. The smallest number of colors required to color a graph G is called its chromatic number of that graph. Graph coloring problem is a NP Complete problem.Method to Color a GraphThe steps required to color a graph G with n number of vertices are as follows −Step 1 − Arrange the vertices of the graph in some order.Step 2 − Choose the first ... Read More

Difference Between Leading and Lagging Power Factor

Manish Kumar Saini
Updated on 07-Nov-2023 05:06:13

73K+ Views

In electrical engineering, the power factor of an AC system is the expression of energy efficiency. The power factor (PF) is defined as the ratio of active power (measured in Watts) to the apparent power (measured in VA). The power factor expresses the ratio of true power which is used in an AC circuit to the total power delivered to the circuit. Mathematically, the power factor can be expressed using the following formula − $$\mathrm{Power \: factor \, \mathrm{=}\, \frac{Active \: power}{Apparent \: power}}$$ There are two major terms are associated with the power factor of an AC circuit viz. ... Read More

Silicon Controlled Rectifier Working Principle and Applications

Manish Kumar Saini
Updated on 07-Nov-2023 04:56:46

74K+ Views

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

Explain Two-Phase Locking (2PL) Protocol in DBMS

Bhanu Priya
Updated on 07-Nov-2023 04:51:34

62K+ Views

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

Check Triangle Type: Equilateral, Isosceles or Scalene in C

Bhanu Priya
Updated on 07-Nov-2023 04:45:51

65K+ Views

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

Linux Tar Command

Pradeep Jhuriya
Updated on 07-Nov-2023 04:39:46

105K+ Views

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 and Call by Reference in Java

Sravani S
Updated on 07-Nov-2023 04:25:11

71K+ Views

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

Difference Between Internal Fragmentation and External Fragmentation

Kiran Kumar Panigrahi
Updated on 07-Nov-2023 04:19:54

68K+ Views

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

What are Process States

Bhanu Priya
Updated on 07-Nov-2023 04:14:49

69K+ Views

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

Display All Prime Numbers Between 1 to N Using For Loop in C

Bhanu Priya
Updated on 07-Nov-2023 04:05:41

89K+ Views

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

Advertisements