Tuesday, 27 September 2016

DE presentations

https://drive.google.com/file/d/0BwOGUimc8FQyQVhkdVVMSUs4ZTA/view?usp=sharing



https://drive.google.com/file/d/0BwOGUimc8FQySmxmWjhVRGI0dDQ/view?usp=sharing

Monday, 26 September 2016

de assignment1 solutions

https://drive.google.com/file/d/0BwOGUimc8FQydUp2aUZzbHc1Y3c/view?usp=sharing

Sunday, 25 September 2016

DS experiment 11

algorithm to add an element
1. Start
2. Set J=N
3. Set N = N+1
4. Repeat steps 5 and 6 while J >= K
5. Set LA[J+1] = LA[J]
6. Set J = J-1
7. Set LA[K] = ITEM
8. Stop
 
program 
 

#include<iostream.h>
#include<conio.h>

 void main()
  {
  int i,a[5],no,pos;
  clrscr();
  cout<<"Enter data in Array: ";
  for(i=0;i<5;i++)
  {
  cin>>a[i];
  }
  cout<<"\n\nStored Data in Array: ";
  for(i=0;i<5;i++)
  {
  cout<<a[i];
  }
  cout<<"\n\nEnter position to insert number: ";
  cin>>pos;
  if(pos>5)
  {
  cout<<"\n\nThis is out of range";
  }
  else
  {
  cout<<"\n\nEnter new number: ";
  cin>>no;
  --pos;
  for(i=5;i>=pos;i--)
  {
  a[i+1]=a[i];
  }
  a[pos]=no;
  cout<<"\n\nNew data in Array: ";
  for(i=0;i<6;i++)
  {
  cout<<a[i];
  }
  }
  getch();
  } 

 
algorithm to delete an element 
1. Start
2. Set J=K
3. Repeat steps 4 and 5 while J < N
4. Set LA[J-1] = LA[J]
5. Set J = J+1
6. Set N = N-1
7. Stop 
 
program

#include<iostream.h>
#include<conio.h>

void main()
  {
   int i,a[5],no,pos;
   clrscr();
   cout<<"Enter data in array: ";
   for(i=0;i<5;i++)
   {
    cin>>a[i];
   }
   cout<<"\n\nStored Data in array:  ";
   for(i=0;i<5;i++)
   {
    cout<<a[i];
   }
   cout<<"\n\nEnter poss. of element to delete: ";
   cin>>pos;
   if(pos>5)
   {
   cout<<"\n\nThis value is out of range: ";
   }
   else
   {
   --pos;
   for(i=pos;i<=4;i++)
   {
    a[i]=a[i+1];
   }
   cout<<"\n\nNew data in array: ";
   for(i=0;i<4;i++)
   {
    cout<<a[i];
  }
  }
   getch();
 }
 
 

algorithm to search an element
1. Start
2. Set J=0
3. Repeat steps 4 and 5 while J < N
4. IF LA[J] is equal ITEM THEN GOTO STEP 6
5. Set J = J +1
6. PRINT J, ITEM
7. Stop
 
flowchart
FlowChart_Search_List 

program
 #include<iostream.h>
 #include<conio.h>

 int linear_search(int [],int,int);

 main()
    {
       clrscr();

       constint array_size=10;
       int array[array_size]={0};

       cout<<"\n Enter the contents of the array are : "<<endl;

       cout<<"\n     Elements :"<<"\t\t     Value:"<<endl;

       for(int count=0;count<array_size;count++)
      {
         cout<<"\t"<<" array ["<<count<<"]"<<"\t\t";
         cin>>array[count];
      }

       int searching_element=0;
       int flag=0;

       cout<<"\n\n Enter the element you want to find  =  ";
       cin>>searching_element;

       flag=linear_search(array,array_size,searching_element);

       if(flag!=-1)
      cout<<"\n The given element is found at the position  array["<<
                            flag<<"]"<<endl;

       else
      cout<<"\n The given element is not found. "<<endl;

       getch();
       return 0;
    }

 /*************************************************************************///--------------------  linear_search(int [],int,int)  ------------------///*************************************************************************/int linear_search(int array[],int size,int element)
    {
       for(int count=0;count<size;count++)
      {
         if(element==array[count])
        {
           return count;
        }
      }

       return -1;
    }

de lab manual (complete)

http://gyan.fragnel.ac.in/lm/sem3/dlda.pdf

Tuesday, 20 September 2016

DE assignment-1

https://drive.google.com/file/d/0BwOGUimc8FQyVHFjT1RhdUpSUVE/view?usp=sharing

Monday, 19 September 2016

DE PRACTICAL-3 GRP 2

PDF FILE

https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwitzbe7v5vPAhXB4D4KHd13CWsQFggeMAA&url=http%3A%2F%2Fwww.iium.edu.my%2Fece%2Flaboratory%2Fdld_microp%2FExperiment_2.pdf&usg=AFQjCNFDIaBXsf6sHN2Bcej21AozIj-rsQ&sig2=Dx4SVAO4FT9TnCjn4ZCD4w

DS-LAB(SWAPPING TWO NO.S)EXPERIMENT-10

ALGORITHM

START

   Var1, Var2, Temp
   
   Step 1 → Copy value of Var1 to Temp
   
   Step 2 → Copy value of Var2 to Var1
          
   Step 3 → Copy value of Temp to Var2

STOP
FLOWCHART:
Image result for FLOWCHART of swapping two numbers
PROGRAM:
#include <iostream>
using namespace std;

int main() {
    
    int a = 5, b = 10, temp;
    cout << "Before swapping." << endl;
    cout << "a = " << a << ", b = " << b << endl;

    temp = a;
    a = b;
    b = temp;

    cout << "\nAfter swapping." << endl;
    cout << "a = " << a << ", b = " << b << endl;


    return 0;
}