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
We can convert an array to arraylist using following ways.Using Arrays.asList() method - Pass the required array to this method and get a List object and pass it as a parameter to the constructor of the ArrayList class.Collections.addAll() method - Create a new list before using this method and then add array elements using this method to existing list.Iteration method - Create a new list. Iterate the array and add each element to the list.Example import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; public class Tester { public static void main(String args[]) { String[] array ... Read More
A schedule is serialized if it is equivalent to a serial schedule. A concurrent schedule must ensure it is the same as if executed serially means one after another. It refers to the sequence of actions such as read, write, abort, commit are performed in a serial manner.ExampleLet’s take two transactions T1 and T2, If both transactions are performed without interfering each other then it is called as serial schedule, it can be represented as follows −T1T2READ1(A)WRITE1(A)READ1(B)C1READ2(B)WRITE2(B)READ2(B)C2Non serial schedule − When a transaction is overlapped between the transaction T1 and T2.ExampleConsider the following example −T1T2READ1(A)WRITE1(A)READ2(B)WRITE2(B)READ1(B)WRITE1(B)READ1(B)Types of serializabilityThere are two types ... Read More
Process Control Block is a data structure that contains information of the process related to it. The process control block is also known as a task control block, entry of the process table, etc.It is very important for process management as the data structuring for processes is done in terms of the PCB. It also defines the current state of the operating system.Structure of the Process Control BlockThe process control stores many data items that are needed for efficient process management. Some of these data items are explained with the help of the given diagram −The following are the data ... Read More
In this article, we are going to study Rename and Alias. Both these have their specific role when we talk in terms of DBMS. Renaming and aliases to the elements of the database provide a layer of abstraction and make the attributes of the relation presentable for the viewer. Mostly, Database store crucial information the concepts of renaming and aliasing plays an important role in representing data with efficiency. Let's gain an understanding of these concepts, their syntax, and the difference between them. What is Alias? Alias is an alternative name given to a column in the database Management System. This practice ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP