Skip to main content

Posts

Segmentation In Operating System

      ⇰     SEGMENTATION :- In operating system segmentation is a memory management technique in which,    the memory is divided into the variable size parts. Each part is known as segment which can be allocated to a process.  Each segment is actually a different logical address space of the program. When a process want to be executed, its corresponding segmentation are loaded into non-contiguous memory, though every segment is loaded into a contiguous block of available memory.     Segmentation memory management technique is somehow works similar to the paging technique. But here difference is that the every segment is of different length where as in paging, pages are of fixed size or same size.  A program segment contains the program's main function, utility functions, data structures, and many others.    The details about each segment are stored in a table called as segment table which is  maintained by the operating system. The segment table contains segment num

Paging In Operating System

       ⇰  PAGING :-    In Operation System, paging is actually a memory management scheme that eliminates the need for contiguous memory allocation. It permits the physical address space of a process to be non–contiguous type.   Paging  also solves the considerable problem of fitting memory chunks of varying sizes onto the backing store. Most memory management schemes before the introduction of paging suffered from this problem. The problem arises because, when data residing in main memory need to be swapped out, space must be found on the backing store. The backing store has the same fragmentation problems. However, paging avoids external fragmentation   The basic method for implementing paging involves breaking physical memory or main memory  into fixed-sized blocks called frames and breaking logical memory or secondary memory ( Harddisk)  into blocks of the same size called pages.  And the size of a frame is kept the same as that of a page to have optimum utilization of

Selection Sort In Data Structure

   ⇰  SELECTION SORT :- Selection sort is one of the simple type of sorting algorithm. This sorting algorithm is based on In-place comparision of element in the array. In this technique the smallest element is selected from the unsorted array and swapped with the leftmost element. This process continues moving unsorted array boundary by one element to the right. The selection starts from first element and searches the entire list or array until it finds the minimum value in the first place, again selects the second element and searches for the second samllest element. This process continues untill the complete list becomes sort form.This algorithm is not suitable for large data as insertion sort. Its  worst case complexity is Ο(n 2 ), where n is the number of items. FOR EXAMPLE :- Let us take a unsorted list :-      4 3 5 2 1   ⇰  ALGORITHM OF SELECTION SORT :- Variable used:-  array= list of element, size= number of element,       I, J , temp = local vari

Contigeous Memory Allocation

  The main memory must accommodate or store both the operating system and the various user processes. So we need to allocate main memory in the most efficient way possible. As we know the memory is usually divided into two partitions: one for the operating system and other for the user processes. We can place the operating system in either low memory or high memory. Since the interrupt vector is often in low memory, programmers usually like to place the operating system in low memory.   We usually want several user processes to reside in memory at the same time. We therefore need to consider how to allocate available memory to the processes that are in the input queue waiting to enter into memory. In contiguous memory allocation, each process is contained in a single section of memory that is contiguous to the section containing the next process.  Thus we can say if the blocks are allocated to the file in such a way that all the logical blocks of the file get the contiguous phy

Types Of Memory Allocation

  Now we are ready to read about various types of memory allocation. One of the simplest  methods for allocating memory is to divide memory into several Fixed-Sized  partitions. Each partition may contain exactly one process.  In this multiple partition  method, when a partition is free, a process is selected from the input  queue and is loaded into the free partition. When the process terminates, the  partition becomes available for another process. But this method is  no longer in use.   In the Variable-Partition scheme, the operating system keeps a table  indicating which parts of memory are available and which are occupied.  All the memory is available for user processes and is considered one  large block of available memory, called hole. Eventually memory  contains a set of holes of various sizes.  As processes enter the system, they are put into an input queue. And when a process is allocated space, it is loaded into memory and it canthen compete for CPU time.  When a proce

Sorting Techniques In Data Structure

      ⇰  SORTING :- In our day-to-day life there are many things that we need to search for , like any page in book, phone number in directory, any record in database etc.  All these  would have been mixed up if these data was kept unordered and unsorted. For this purpose fortunately the concept of  sorting  is introduced. Sorting makes easier for everyone to arrange any data in an order, hence searching becomes easier. Means s orting  arranges data in a sequence or in order which makes searching easier. ⇾ After applying the sorting technique, If the contents do not change the sequence of similar content in which they appear, it is called stable sorting technique. ⇾ After applying the sorting technique, if  the contents do change the sequence of similar content in which they appear, it is called unstable sorting technique.       ⇰   SORTING ORDERS :- ⇾ Basically all sorting techniques sorts the given data in following orders :-     i > Increasing Order :- The or

Shell Sort In data Structure

    ⇰  SHELL SORT :-  Shell sort is also a type of sorting technique.   Shell sort is a highly efficient sorting technique. It is    mainly a variation of insertion sort.   This technique takes short shifts , avoids large shifts as in insertion sort.  This technique uses insertion sort on a large number of elements, first this technique sorts more  widely spaced elements then sorts the less widely spaced elements. This spacing is known as gap or intervals.     The shell sort is named after its developer Donald Shell. This sorting technique works by comparing list elements that are seperated by a specific distance called gap, until the element compared with the current gap are in order, and then divides gap and the process contineous. When the gap is reached to 0 and changes are not possible, then the list is sorted.  EXAMPLE :-               ⇰  ALGORITHM OF SHELL SORT :-  Variable Used :- array= list of element,                  size= number of element. gap, swap, i

Insertion Sort In Data Structure

    ⇰  INSERTION SORT :- Insertion sort  is one of the simplest method to sort an array.  This is an in-place comparison-based sorting algorithm.  The array is searched sequentially and unsorted items are moved left or right side according to order we want to sort. This sorting algorithm is not suitable for large data. Its average and worst case complexity is  Ο(n 2 ), where n  is the number of items in an array.       An example of insertion sort occurs in everyday life is while playing cards. Ones hand extract the card, and then shift the remaining cards and then insert the extracted card in the correct place. This process is repeated until all the cards are in the correct position or in correct sequence.   FOR EXAMPLE :-     Let us take an unsorted array:-                 3 7 4 1 8 2 now the insertion sort technique compare the 1st element of array to 2nd element, if sequence or order is not correct then corrects it.                 3 7 4 1 8 2 Comparing the 1s

Graph Traversal In Data Structure

  ⇰ GRAPH TRAVERSAL :-  Sometimes it is required to examine all the vertex in a graph in some systematic order, as in the case of  binary tree traversal  , where we use preorder, postorder or inorder to examine the vertices. For that we use graph traversal.  Graph traversal is a technique used to search vertex in a graph to perform any operation there. The graph traversal is also used to conclude the order of vertices visited in the searching process. A graph traversal finds the edges without creating loops. That means using graph traversal techniques we can visit all the vertices of the graph without any looping path.    ⇰ TYPE OF GRAPH TRAVERSAL :-  There are following two types of graph traversal techniques :-   i >  Depth First Search ( DFS).  ii >  Breadth First Search ( BFS).  i >  Depth First Search ( DFS) :- Depth first search of graph traversal is similar to depth first search of tree traversal. This  algorithm traverses a graph in a depthward motio