<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>structure | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/structure/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 09 Jun 2012 17:07:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C Program for Simple DSC order Priority QUEUE Implementation using Structure</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure-2/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure-2/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 17:07:15 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[Priority QUEUE]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3335</guid>

					<description><![CDATA[<p>C Program for Simple DSC order Priority QUEUE Implementation using Structure. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #define SIZE 5 /* Size of Queue */ int f=0,r=-1; /* Global declarations */ typedef struct PRQ { int ele; int pr; }PriorityQ; PriorityQ PQ[SIZE]; PQinsert(int elem, int pre) { int i;</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure-2/">C Program for Simple DSC order Priority QUEUE Implementation using Structure</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for Simple DSC order Priority QUEUE Implementation using Structure.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#define SIZE 5            /* Size of Queue */
int f=0,r=-1;       /* Global declarations */
typedef struct PRQ
{
    int ele;
    int pr;
}PriorityQ;

PriorityQ PQ[SIZE];

PQinsert(int elem, int pre)
{
    int i;       /* Function for Insert operation */
    if( Qfull()) printf("\n\n Overflow!!!!\n\n");
    else
    {
        i=r;
        ++r;
        while(PQ[i].pr <= pre &#038;&#038; i >= 0) /* Find location for new elem */
        {
            PQ[i+1]=PQ[i];
            i--;
        }
        PQ[i+1].ele=elem;
        PQ[i+1].pr=pre;
    }
}

PriorityQ PQdelete()
{                      /* Function for Delete operation */
    PriorityQ p;
    if(Qempty()){ printf("\n\nUnderflow!!!!\n\n");
    p.ele=-1;p.pr=-1;
    return(p); }
    else
    {
        p=PQ[f];
        f=f+1;
        return(p);
    }
}
int Qfull()
{                     /* Function to Check Queue Full */
    if(r==SIZE-1) return 1;
    return 0;
}

int Qempty()
{                    /* Function to Check Queue Empty */
    if(f > r) return 1;
    return 0;
}

display()
{                  /* Function to display status of Queue */
    int i;
    if(Qempty()) printf(" \n Empty Queue\n");
    else
    {
        printf("Front->");
        for(i=f;i<=r;i++)
            printf("[%d,%d] ",PQ[i].ele,PQ[i].pr);
        printf("<-Rear");
    }
}

main()
{                         /* Main Program */
    int opn;
    PriorityQ p;
    do
    {
        clrscr();
        printf("\n ### Priority Queue Operations(DSC order) ### \n\n");
        printf("\n Press 1-Insert, 2-Delete,3-Display,4-Exit\n");
        printf("\n Your option ? ");
        scanf("%d",&#038;opn);
        switch(opn)
        {
        case 1: printf("\n\nRead the element and its Priority?");
            scanf("%d%d",&#038;p.ele,&#038;p.pr);
            PQinsert(p.ele,p.pr); break;
        case 2: p=PQdelete();
            if( p.ele != -1)
                printf("\n\nDeleted Element is %d \n",p.ele);
            break;
        case 3: printf("\n\nStatus of Queue\n\n");
            display(); break;
        case 4: printf("\n\n Terminating \n\n"); break;
        default: printf("\n\nInvalid Option !!! Try Again !! \n\n");
            break;
        }
        printf("\n\n\n\n  Press a Key to Continue . . . ");
        getch();
    }while(opn != 4);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure-2/">C Program for Simple DSC order Priority QUEUE Implementation using Structure</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the differnce between Structure and Union?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/#comments</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 10:29:59 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[union]]></category>
		<category><![CDATA[sizeof strucure]]></category>
		<category><![CDATA[sizeof union]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1806</guid>

					<description><![CDATA[<p>The difference between structure and union is, 1. The amount of memory required to store a structure variable is the sum of the size of all the members. On the other hand, in case of unions, the amount of memory required is always equal to that required by its largest member. 2. In case of</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/">What is the differnce between Structure and Union?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The difference between structure and union is,<br />
1. The amount of memory required to store a structure variable is the sum of the size of all the members.<br />
On the other hand, in case of unions, the amount of memory required is always equal to that required by its largest member.</p>
<p>2. In case of structure, each member have their own memory space but In union, one block is used by all the member of the union.</p>
<p><strong>Detailed Example:</strong></p>
<pre lang="c" line="1">
struct stu
{
	char c;
	int l;
	float p;
};
</pre>
<pre lang="c" line="1">
union emp
{
	char c;
	int l;
	float p;
};
</pre>
<p><strong>In the above example size of the structure stu is 7 and size of union emp is 4. </strong></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/">What is the differnce between Structure and Union?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
	</channel>
</rss>
