Skip to main content

Posts

Definition of Queue and its types with algorithms (Data structure)

                                 Queue  A queue is non-premitive linear data structure . It is based on first-in-first-out (FIFO) mechanism.In queue deletion can take place at one end of the list , the front of the list. And insertion can take place at the other end of the list , rear of the list.     Queues are often usde in programming networks , operating systems , and other situations in which many different processes must share resources such as CPU time. * Working Process on Queue :- By incrementing rear pointer we can insert an element in queue. By incrementing front pointer we can removew element from queue. If queue is empty then front and rear pointer must be incremented by 1 first time. When rear=size- 1 then queue is full. When front=rear then reset front=-1 and rear=-1. When front=rear=-1 then the queue is empty. Queue is different from stack in...

Definition of Stack and its algorithm with working process(data structure)

                  Stack                           A Stack is  an ordered collection of items where the addition of items and the removal of existing items always takes place at the same end. This end is commonly referred to as the “top". * working method of stack :- i> Initially top=-1 ii> By increasing top pointer we can insert element    in the stack. iii> when top=size of stack-1  then stack is full. iv> By decreasing the top pointer we can remove   the   element from stack. v> when top=-1 then the stack is empty. figure shows run time stack * The fundamental operations which are possible on a stack are:-         1. push operation (insertion).    2. pop operation (deletion).    3. peep opetation(extract informat...

Data Structure & its types:-

  The logical or mathematical model of a particular organisation of data is called data structure. It is the representation of the logical relationship existing between individual elements of the data.   In other words data structure is collection of data elements whose organisation is characterized by accessing operations that are used to store and retrieve the individual data elements.  A data structure mainly specifies the following things:-    i> Organisation of data.   ii> Accessing methods.  iii> degree of associativity.  iv> Processing alternative code for information. * Data structure is the basic building blocks of the program. * |The data structure is of two types:-  1. Primitive data structure.  2. Non-Primitive data structure. 1. Primitive data structure:-    These are the basic data structures and they are directly operated by a machine instructions.       In general...

Flow Chart with advantages and disadvantages in C Language:-

    A  flowchart  is a type of  diagram  that represents an  algorithm ,  workflow  or process. The flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with arrows. This diagrammatic representation illustrates a solution model to a given  problem . Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields.  Flow charts are used in analyzing , designing , documenting or managing a process or program in various fields. Like other types of diagrams , they help visualize what is going on and thereby help understand a process , and perhaps also find less-obvious features within the process.   There are several applications and visual programming languages that use flow charts to represent and execute programs.Generally these are used as teaching tools for beginner students. Many software packages exist that can create flowcharts automatic...

Languages in computer

                 LANGUAGES * Low level language:-           Low level language is machine dependent language. This language is the machine codes in which the instructions are given in machine language in the form of 0 and 1 to a computer system.the main function of low level language is to operate , manage and manipulate the hardware and system components.    Low level language is divided into two parts:-             i> Machine language             ii> Assembly language   i>  Machine language:-             It is one of the low level language which is the first generation language developed for communication with a computer. It is written in machine code which represents 0 and 1 binary digits inside the computer string which makes it easy to understand and perform the operations.   ...

'Array' data structure in 'c' language

In  programming languages , an  array  is a way of storing several items. These items must have the same type (only integers, only  strings , ...) because an array can not store different kinds of items. Every item in an array has a number so the  programmer  can get the item by using that number. This number is called the index. In some programming languages, the first item has index 0, the second item has index 1 and so on. But in other languages, the first item has index 1 (and then 2, 3, ...). When the programmer creates an array, they must give the  size  of the array. This is the number of items that can be stored in the array. If the programmer wants to store more items, then they must create a new array. This is because the size of an array can not be changed. Arrays in C :- I n the  programming language   C , arrays can be created like this: int array[5]; This creates an array of integers and it can store 5 in...

Tokens and its types in 'C'

   Tokens are the smallest individual unit of a program or in simple words it is a main part of C program.Tokens are the building blocks of any program. The smallest individual and basic unit of a C programming is called c tokens.      *    Normally there are six types of tokens in C:- i> Keywords:-          Keywords are special words that are used to give a special meaning to the program and can't be used as variable and constant.They are basically a sequence of characters that have fixed to mean. For example:-                 auto     double      long     break                 float    short        char     if                while    continue   int       void etc. All...