Expression Tree notes

This topic is not covered in Unit 3.

expression tree.pdf

Advertisements

ECE 202 Unit IV Notes

In this Unit, The following points are Discussed:

  • Classification of memories
  • RAM organization – Write operation –Read operation
  • Memory cycle – Timing wave forms
  • Memory decoding – Memory expansion
  • Static RAM Cell – Bipolar RAM cell – MOSFET RAM cell – Dynamic RAM cell
  • ROM organization – PROM –EPROM – EEPROM – EAPROM

Download ECE 202 Unit 4 Notes

Download ECE 202 Programmable Logic Devices

CSE 255 Unit V Graph Notes

Dear Students,

In this Unit 5, we have discussed the following Sorting Techniques:

  • Topological Sort
  • Shortest-path Algorithms
  • Dijkstra’s Algorithm
  • Minimum Spanning Tree
  • Kruskal’s Algorithm
  • Prim’s Algorithm
  • Depth-First Search
  • Breadth-First Search
  • Applications of Depth-First Search
  • Undirected Graphs – Bi Connectivity
  • NP-Completeness Problem

Download Graph PPT

Download Graph Notes

Hope this may helpful to u..

Thank you.

Array Implementation of List ADT

Array Implementation of List ADT

Program:

#include
#include
int a[20],i,n;
void create(int);
void display();
void insert(int,int);
void delet(int);
int search(int);
void makeempty();
void main()
{ int op=1,ch,x,p,k;
do
{
printf(“enter your choice\n\n”);
printf(“1.Creation\n”);
printf(“2.Display\n”);
printf(“3.Insertion\n”);
printf(“4.Deletion by position\n”);
printf(“5. Deletion by element\n”);
printf(“6.Search\n”);
printf(“7. Find Kth\n”);
printf(“8. FindNext\n”);
printf(“9. Find Previous\n”);
printf(“10. MakeEmpty\n”);
scanf(“%d”,&ch);
switch(ch)
{
case 1:
printf(“enter the number of elements\n”);
scanf(“%d”,&n);
create(n);
break;
case 2:
display();
break;
case 3:
printf(“enter the element to be inserted\n”);
scanf(“%d”,&x);
printf(“Enter the position”);
scanf(“%d”,&p);
insert(p,x);
break;
case 4:
printf(“Enter the position to be deleted “);
scanf(“%d”,&p);
delet(p);
break;
case 5:
printf(“Enter the element to be deleted\n”);
scanf(“%d”,&x);
p=search(x);
if(p==0)
printf(“The element is not found \n”);
else
delet(p);
break;
case 6:
printf(“enter element to search”);
scanf(“%d”,&x);
p=search(x);
if(p==0)
printf(“The element is not found \n”);
else
printf(“the variable is found in position: %d\n”,p);
break;
case 7:
printf(“Enter the value of k “);
scanf(“%d”,&k);
if(k>n)
printf(“no such position\n”);
else
printf(“%d “,a[k-1]);break;
case 8:
printf(“Enter the element “);
scanf(“%d”,&x);
p=search(x);
if(p==0)
printf(“The element is not found\n”);
else
{
if(p==n)
printf(“It is the last element. There is no next value \n”);
else
printf(“%d “,a[p]);
}break;
case 9:
printf(“Enter the element “);
scanf(“%d”,&x);
p=search(x);
if(p==0)
printf(“The element is not found\n”);
else
{
if(p==1)
printf(“Its the first element.Thereis no previousvalue\n”);
else
printf(“%d “,a[p-2]);
}break;
case 10:
makeempty();
break;
}
printf(“Enter 0 to quit and 1 to continue “);
scanf(“%d”,&op);
}while(op);
}

void create(int n)
{ for(i=0;i<n;i++)
{
printf(“enter the element”);
scanf(“%d”,&a[i]);
}
}

void display()
{ if(n==0)
printf(“array is empty\n”);
for(i=0;in+1)
printf(“Cannot insert element “);
else
{
n++;
for(i=n-1;i>=p;i–-)
{
a[i]=a[i-1];
}
a[p-1]=x;
}
}

void delet(int p)
{
if(p>n)
printf(“no element in that position\n”);
else
{
for(i=p-1;i<n;i++)
a[i]=a[i+1];
n–-;
printf(“The element is deleted\n”);
}
}

int search(int x)
{
int pos=0;
for(i=0;i<n;i++)
{
if(a[i]==x)

pos=i+1;

}
return pos;
}

void makeempty()
{
printf(“Are you sure u want to make empty?; \n press 1 for yes & 0 for no\n");
scanf(“%d”,&n);
if(n==1)
{
for(i=0;i<n;i++)
a[i]=0;
}
printf(“Now the array is empty \n”);
}