Tuesday, March 31, 2015

Addition of two polynomials

#include<stdio.h>
#include<conio.h>
#include<alloc.h>
struct poly
{
 float constant ;
float expo;
struct poly * next;
};
void append(struct poly **q)
{
   struct poly *temp;
    temp=*q;
   if(temp==NULL)
   {
     *q=(struct poly *)malloc(sizeof(struct poly));
     printf("\nenter the constant");
     scanf("%d",&(*q)->constant);
     printf("\nenter the expo");
     scanf("%d",&(*q)->expo);
     (*q)->next=NULL;
    }
else
{
 while(temp->next!=NULL)
   temp=temp->next;

   temp->next=(struct poly *)malloc(sizeof(struct poly));
    temp=temp->next;

   printf("\nenter the data");
     scanf("%d",&temp->data);
   printf("\nenter the expo");
    scanf("%d",&temp->expo);
  temp->next=NULL;
 }
}


void add_poly(struct node **q,struct poly **q2,struct poly *q3)
{
 struct poly *temp,*t,*t1;
temp=*q;
t=*q2;
t1=*q3;

 while(temp->next!=NULL||t->next!=NULL)
 {
   if(temp->expo=t->expo)
    {
       t1->data=temp->constant+t->constant;
       t1->expo=temp->expo;
     }
  }
}

void display(struct node *q)
{
  struct node *temp;
  temp=q;
    while(temp!=NULL)
    {
      printf(" %d^%d",temp->data);
       if(temp->expo!=0)
        printf("+");
      temp=temp->next;
     }


}

void main()
{
 struct poly *start,*start2;
 start=NULL; //empty list1
start2=NULL; //empty list 2
start3=NULL; //empty list 3

 printf("\nenter theequation : ")
 append(&start);
 append(&start);
 append(&start);

printf("\now the equationis :");
display(start);

printf("\nenter the second equation :");
append(&start2);
 append(&start2);
 append(&start2);

printf('\now the list is :')
display(start2);

printf("\nenter the Third equation :");
append(&start3);
 append(&start3);
 append(&start3);


add_poly(&start,%start2,&start3);



printf('\now the equation is :')

display(start3);


}

Merge in order list 1 list 3 list 2

#include<stdio.h>
#include<conio.h>
#include<alloc.h>
struct node
{
   int data;
  struct node * next;
};

void append(struct node **q)
{
 struct node *temp;
    temp=*q;
   if(temp==NULL)
  {
   *q=(struct node *)malloc(sizeof(struct node));
    printf("\nenter the data");
   scanf("%d",&(*q)->data);
   (*q)->next=NULL;
}
else
{
  while(temp->next!=NULL)
   temp=temp->next;

   temp->next=(struct node *)malloc(sizeof(struct node));
    temp=temp->next;

  printf("\nenter the data");
    scanf("%d",&temp->data);
  temp->next=NULL'
  }
}

void merge(struct node **q,struct node **q2,struct node *q3)
{
 struct node *temp,*t,*t1;
  temp=*q;
  t=*q2;
  t1=*q3;
  p=temp; //saving initial address of list 3

while(t1->next!=NULL)
     t1=t1->next;
   t1->next=t;

  while(temp->next!=NULL)
    temp=temp->next;
  temp->next=p;

}

void display(struct node *q)
{
  struct node *temp;
  temp=q;
    while(temp!=NULL)
    {
      printf(" %d",temp->data);
      temp=temp->next;
     }
}

void display(struct node *q)
{
  struct node *temp;
  temp=q;
    while(temp!=NULL)
    {
      printf(" %d",temp->data);
      temp=temp->next;
     } }

void main()
{
 struct node *start,*start2;
 start=NULL; //empty list1
start2=NULL; //empty list 2
start3=NULL; //empty list 3
  printf("\nenter the first list : ")
 append(&start);
 append(&start);
 append(&start);
printf("\now the list is :");
display(start);
printf("\nenter the second list :");
append(&start2);
 append(&start2);
 append(&start2);
printf('\now the list is :')
display(start2);
printf("\nenter the Third list :");
append(&start3);
 append(&start3);
 append(&start3);
printf('\now the list is :')
display(start3);
 merge(&start,&start2);
prinf("\nlist in order List3 list1 list 2");
display(&start);
}

Mege in order list3 list1 list 2

#include<stdio.h>
#include<conio.h>
#include<alloc.h>
struct node
{
 int data;
struct node * next;
};
void append(struct node **q)
{
 struct node *temp;
 temp=*q;
 if(temp==NULL)
{
*q=(struct node *)malloc(sizeof(struct node));
printf("\nenter the data");
scanf("%d",&(*q)->data);
(*q)->next=NULL;
}
else
{
while(temp->next!=NULL)
  temp=temp->next;

temp->next=(struct node *)malloc(sizeof(struct node));
temp=temp->next;

printf("\nenter the data");
scanf("%d",&temp->data);
temp->next=NULL'
  }
}


void merge(struct node **q,struct node **q2,struct node *q3)
{
 struct node *temp,*t,*t1;
temp=*q;
t=*q2;
t1=*q3;
p=temp; //list 1
 while(temp->next!=NULL)
 temp=temp->next;
 temp->next=t;

while(t1->next!=NULL)
  t1=t1->next;
 t1->next=p;

}

void main()
{
 struct node *start,*start2;
 start=NULL; //empty list1
start2=NULL; //empty list 2
start3=NULL; //empty list 3
  printf("\nenter the first list : ")
 append(&start);
 append(&start);
 append(&start);
printf("\now the list is :");
display(start);
printf("\nenter the second list :");
append(&start2);
 append(&start2);
 append(&start2);
printf('\now the list is :')
display(start2);
printf("\nenter the Third list :");
append(&start3);
 append(&start3);
 append(&start3);
printf('\now the list is :')
display(start3);
 merge(&start,&start2);
prinf("\nlist in order List3 list1 list 2");
display(&start3);
}

Monday, March 30, 2015

Data Structure

Display those nodes which are having even data.
 void display_even(struct node *q)
{
 struct node *temp;
 temp=q;
  while(temp!=NULL)
  {
    if(temp->data%2==0)
    printf("%d",temp->data);
   temp=temp->next;
}

Display those nodes which are having odd data.
 void display_even(struct node *q)
{
struct node *temp;
temp=q;
 while(temp!=NULL)
 {
   if(temp->data%2!=0)
   printf("%d",temp->data);
 temp=temp->next;
}

Display those nodes having even numbers on its left node.
 void display_even(struct node **q)
{
struct node *temp,*t;
temp=*q;
t=*q;
 while(temp!=NULL)
 {
  t=temp;
 temp=temp->next;
   if(t->data%2==0)
   printf("%d",temp->data);

}

sort the given link list :
(a)ascending

void sort_ascending(struct node **q)
{
 struct node *temp;
 temp=q;
  while(temp!=NULL)
  {
    if(temp->data%2==0)
    printf("%d",temp->data);
   temp=temp->next;
}

void append(struct noe **q)
{
struct node *temp;
temp=*q;
 if(temp==NULL)
{
*q=(struct node *)malloc(sizeof(struct node));
printf("\nenter the data");
scanf("%d",&(*q)->data);
(*q)->next=NULL;
}
else
{
while(temp->next!=NULL)
  temp=temp->next;

temp->next=(struct node *)malloc(sizeof(struct node));
temp=temp->next;

printf("\nenter the data");
scanf("%d",&temp->data);
temp->next=NULL'
  }
}

Delete last node
void delete(struct noed **q)
{

struct nodde *temp,*t;
t=*q;
temp=*q;
 while(temp-next!=NULL)
 {
   temp=temp->next;
 }
  free(temp);
t->next=NULL;

}

SDLC

The six phases of system development life cycle is used for examining an information system and improving it.The six phases make up what is known as SDLC.
The SDLC is thye step by step process that many organisation follow during system analysis and design.Phases often overlap and a new one may start before the old one is finished.After the first four phases management must decide whether to proceed to the next phase.
 User input & review is a critical partt of each phase.
System Development Life Cycle
Lets have an example given below to illustrate it
Example Of SDLC
Phase 1:System Analysis Or Requirement 
The purpose is alternative solutions describe costs & benifits and submit a preliminary plan wuth recommendation surintg the phase.
  Conduct prelimanary analysis to find at what the organisations objectives

Computer Based Information System-CBIS

Computer Based Information System
*CBIS includes hardware,software process.
*nedd of CBIS grow many organisations have information processong requirement that are virtually impossible without computer assistance,hogh industry technology,firms with story commitment to research gps have need for CBIS fir their reasons.
*It relies on computer for handling business applications.
It is an organised information of hardware * software technologies & human elements designed to produce timely integrated,accurate & useful information for making purpose.CBIS is compared of hardware,software data telecommunication people & procedures to collect,manipulate stores & process data information into information

Data:Raw facts i.e age,gender, worked on aparticular date.
Information:Facts organised in such a way that they have value beyond the decision (i,e worker under 21)



TRANSACTION PROCESSING:
It substitute computer based processing for manual procedure deals with well structured routines.
Includes record keeping application.
Transcations are bussiness events such as orders,invoices,vequistions,etc some organisations includes their transcation processing system to be seperate from their information system.

to produce information we must capture data.Bussiness transcation represents 90% or more of all the data that must be captured.if we capture that data,we can support most information needs,Thes are two types of transcation processing:
The most common is the processing of input transcation.
another type of transcation processing is the output transcation triggers responses from or confirm action to those who eventually receives those transactions.

Sunday, March 29, 2015

what is a system?

What is a system?
A  system is an arrangement of various elements which  are in orderly manner to accomplish an ojective.
                    OR
system means an organised relationship among functioning units or components.A system exists because it is designed to achieve one or more objectives
Examples :
Transportation
Production
Computer
Telephone System
A Food Production System

Production system


A system is governed with some logic governeed  by rules,regulations,principles and polices.Sucha an arrangement is also infuenced by the objective the systemm desire to achieve.
system are created to solve problems.

A system may have single input & multiple outputs.All the system operate in the environment.The environment may in fluence the system in its design & performance.
When a system is designed to achieve certain abjectives,it automtically sets the boundaries for itself.

Elements of system:
1.output & inputs
2.processors
3.control
4.environment.
5.boundaries and interfaces

1.Output and inputs
The major objective of a system is to produce  an output that has value to its user.
Inputs are the physical objectives & information that cross the boundaries to enter system from its environment 

Outputs are the physical objectives & informations that go from the system into its environment.
                   OR  
  Watever a system returns from its environment inorder to full fill its purpose.

2.Environment
It is everything that is relevant to the system that is outside of the boundary.

3.Boundary and Interface
 *Boundary defines what is inside the system & what is outside.It is the line that marks the inside & outside of a system & set off  the system from its environment.
*Interface represents point of contact where system meets its environment or it can define where subsystem meet each other.

Boundaries & surrounding/environment of system
\
Types of system
    It have been classified in different ways
    1.physical or abstract.
    2.Open or closed
   3.Natural or man made.

1.Physical System
  These are those tangible entities that may be static (changable) or dynamic in operation.
Example:
 The physical part of the computer center are desk,char tha facilitate operation of the computer .
 They can be seen & counted,they are static incontrast a programmed computer is a dynamic system.
 Data,programmes,output & application change as the users demand or the priority of the information  requested changes.

2.Abstract system
  These are conceptual or non-physical entities.They may be as straight forward as formulas of        relationship among sets of variables or models the abstract conceptualization.
  A model is an easier way for the analysis under study.The objective is to point out the significant    element & the key interelationship of a computer system.

3.Open & Closed system
This system of classification is base on the degree of independence.
 *An Open System is that interacts freely with its environment,taking input & returning output
Example:
  Education or Bussiness process changes quickly.
      An Open system will interact with element that exixt & influence from outside boundary of the    system.

An open System

*A Closed System is which cut off from its environment & does not interact with it.
   It is completely isolated from the environment for its operation.
   Such closed system will finaly run down or become disprganised.This movement to disorder is     termed as inc. in Entrophy.
Difference in Open & Closed System
3.Informal & Formal system
These are those system in which everything is organised in a particular manner.The work perform by the sub-system is decided before hand.
*In a formal system,changes are not performed during runtime.
*Informal system,there is no particular path to achieve the goal or objective required in the sub system can be altered or change during the course.