Skip to main content

Posts

Graph In Data Structure

       ⇰ GRAPH A graph is a non-linear data structure. It  is a pictorial representation of a set of objects where some pairs of objects are connected by links. It  consisting of nodes and edges.  The nodes are sometimes also referred to as vertices and the edges are links that connect any two nodes or vertices in the graph.  Therefore we can say a graph is a collection of nodes and edges in which two nodes are coonected with edges . It can be seen as a cyclic tree, where the vertices maintain any other relationship among them instead of having parent child relationship as in tree.  Generally a graph 'G' is represented as G(V,E) , where V represents set of vertices of G  and E represents  set of edges or links of G. following is  a graph with five vertices and seven edges.  Graph with 5 vertices and 7 edges We can define the above graph as G(V,E). where V={A, B, C, D, E} and E={ (A,B), (A,C), (A,D), (B,D), (C,D), (B,E), (D,E) }.     ⇰  APPLICATIONS O

Types Of CPU Scheduling Algorithms

1. first Come First Serve (FCFS) :- This scheduling is a type of non-preemptive scheduling. FCFS scheduling is the simplest scheduling. In the "First come first serve" scheduling algorithm, as the name suggests, the process which arrives first, gets executed first, or we can say that the process which requests the CPU first, gets the CPU allocated first  The implementation of the FCFS policy is easily managed with a FIFO queue. When a process enters the ready queue, its  PCB is linked onto the tail of the queue. When the CPU is free, it is allocated to  the process at the head of the queue. the average waiting time under the FCFS policy is  often quite long. Consider the following set of processes that arrive at time 0 with CPU burst in ms. If the processes arrived in the order P1,P2,P3,P4 and served to CPU then the we can conclude the Average waiting time with the help of Gantt chart as follows:- 2. Shortest Job First (SJF) :- This scheduling

Memory Management In Operting System

        ⇰    MEMORY MANAGEMENT :- To improve both the utilization of the CPU and the speed of its response to users, a general-purpose computer must keep several processes in memory. Many memory-management schemes exist, reflecting various approaches, and the effectiveness of each algorithm depends on the situation. Selection of a memory-management scheme for a system depends on many factors, especially on the hardware design of the system. Most algorithms require hardware support. Memory management is one of the important functionality of operating system which handles or manages primary memory and moves processes back and forth between main memory and disk during execution (called swapping). Memory management keeps track of each and every memory location. It checks how much memory is to be allocated to processes. It decides which process will get memory at what time.  Hence Memory Management  is the process of controlling and coordinating computer memory, assigning porti

Swapping in Operating System

      ⇰  SWAPPING :- As we know a process must be in memory to be executed.  A computer has sufficient amount of physical memory but most of times we need more memory so we swap some memory on baking store or harddisk.  A process can be  swapped temporarily out of memory to a backing store and then brought back  into memory for continued execution. Swapping makes it possible  for the total physical address space of all processes to exceed the real physical  memory of the system, thus increasing the degree of multiprogramming in a  system. Thus swapping is a mechanism in which a process can be swapped temporarily out of main memory to secondary storage or harddisk and make that memory available to other processes. At some later time, the system swaps back the process from the secondary storage to main memory. Sometimes  performance is usually affected by swapping process but it helps in running multiple and big processes in parallel and that's the reason   Swapping is also k