linked List

A linked list is a linear data structure where each element is a separate object. Linked list elements are not stored at contiguous location; the elements are linked using pointers. Each node of a list is made up of two items - the data and a reference to the next node. The last node has a reference to null. It can be illustrated from following figure.

                                                        fig: linked list





Program : Creation of Linear Linked List


#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<malloc.h>
//creating node
struct node
{
int data;
struct node *next;
};
 void print_list(struct node *ptr)
{
while(ptr!=NULL)
{
printf("|%d| |->",ptr->data);
ptr=ptr->next;
}

}
int main()
{
int a,b,c;
//creating pointer for three node
struct node *first=NULL;
struct node *second=NULL;
struct node *third=NULL;
//allocating memory for each pointer dynamically
first=(struct node *)malloc(sizeof(struct node));
second=(struct node *)malloc(sizeof(struct node));
third=(struct node *)malloc(sizeof(struct node));
//getting data values for different node from user
printf("Enter first node info:");
scanf("%d",&a);
printf("Enter Second node info:");
scanf("%d",&b);
printf("Enter Third node info:");
scanf("%d",&c);
//assining information and address to node
//for first node
first->data=a;
first->next=second;
//second node
second->data=b;
second->next=third;
//third node
third->data=c;
third->next=NULL;
//calling function to print list
print_list(first);
printf("NULL");

return 0;
}

It's output is:




FSU Technical Festival in Pashchimanchal Pokhara

 The Free Students’ Union ( FSU), Paschimanchal  Campus is going to organize ‘FSU Technical Festival’ on the 3rd,4th and 5th of Shrawan (19th,20th and 21st of July).
The program is aimed for the promotion of the technical knowledge and skills of the students from different Engineering and +2 colleges from Pokhara.

VECTOR -direct your vision is a national level technical festival of Paschimanchal Campus organized by Free Students Union, Paschimanchal Campus in association with different active Technical Clubs from Paschimanchal Campus. In this festival, different Project exhibition, Project Competition, Code Camp and Mapathon are held along with real time competitions such as Coding Contest and Circuit designing. This festival provides practical knowledge and competitive spirits to the students of technical field. 
This festival aims to develop potential of students and also improve the technical sectors all over Nepal. This festival inspires and helps to direct the solutions and ideas developed to be implemented in real life.According to the organizers, the festival will see thousands of students from the  Engineering Campus and various +2 colleges in Pokhara compete for thematic competitions on topics such as Smart City, Clean Energy, Tourism, Education and Agriculture. In the festival, the students will demonstrate their projects on the above mentioned themes. Similarly, the Robotics Club is also organizing Robot Exhibition and Robocup- which is a Robot Football Competition for the tech Fest. Visitors can play robotic football at 3,4 &5 without any cost.

The students studying in the final year will also demonstrate their final year Projects.

Beside the competitions, Civil Engineering Students’ Society (CESS)  is also organizing National Civil Engineering Expo for the festival, where the Civil Engineering students will present their projects on the above mentioned themes. On top of this, there will also be Art Competition, Quiz, Presentation Competitions and various games. The CESS also organized an Autocad design competition and a 3D elevation drawing competition as a part of the tech festival.
The organisers have also conducted many pre-events that include workshops and boot-camps for the event.One of the pre-events, the Artificial Intelligence(AI) workshop saw as many as 50 participants and there was similar number of participation in the  AUTOCAD workshop too. A training on academic writing was also conducted for the students in various +2 schools in Pokhara, where they learnt about Report writing for science projects.Similarly, there will be a Code Camp on 26th Ashad(10th July) where the participants will code and develop applications for human aid.
 
The entrance to the festival is free and where there  will also host stalls for Book exhibition. Other fun activities like Musical Nights, Cultural shows, Panel Discussions, Open Mic Sessions, Kavita Concert, etc. will also be held as a part of the festival, they informed.

Robocup 2018

ROBOCUP-2018, is a robot football competition. This season, we will provide a different taste in football while entire world is shouting out loud supporting their favorite teams in World Cup 2018. Robot football is a new flavor for football fans while a significant milestone for Robot enthusiasts and innovators in Pokhara.
Robotics Club, IOE Paschimanchal Campus was established in 2062 BS. We are a team that is excited to build physical things and explore curiosities with an ultimate goal to transform them into knowledge and experience. As our motto stands “Share Knowledge Explore Technique”, we are pushing forward what’s possible as a student club, both in terms of technical accomplishments and educational value. This is why we welcome all interested students, provide them with hands on experience on building robots.
ROBOCUP-2018 will be held on 26th and 27th of Ashadh 2075(July 11-12, 2018) at Auditorium Hall, Paschimanchal Campus, Lamachour. The competition is first of its kind to be held at Pokhara, and ultimately in newly formed Province-4. We have envisioned to shape the technological environment by bonding the skill and dedication of students with support and motivation of enthusiasts and well wishers.
Let spend time for robocup.It's an oppertunity to human being to experience robotic football rather than wordcup.Don't get suck with loss on wordcup you can support team that you like on robocup.Please keep support us by visiting robocup competiion.

Enqueue and Dequeue Operation

Enqueue Operation

Queues maintain two data pointers, front and rear. Therefore, its operations are comparatively difficult to implement than that of stacks.
The following steps should be taken to enqueue (insert) data into a queue −
  • Step 1 − Check if the queue is full.
  • Step 2 − If the queue is full, produce overflow error and exit.
  • Step 3 − If the queue is not full, increment rear pointer to point the next empty space.
  • Step 4 − Add data element to the queue location, where the rear is pointing.
  • Step 5 − return success
   Algorithm
   if queue is full
      return overflow
   endif
   
   rear ← rear + 1
   queue[rear] ← data
   return true
   stop
 
 
Dequeue Operation
Accessing data from the queue is a process of two tasks − access the data where front is pointing and remove the data after access. The following steps are taken to perform dequeue operation −
  • Step 1 − Check if the queue is empty.
  • Step 2 − If the queue is empty, produce underflow error and exit.
  • Step 3 − If the queue is not empty, access the data where front is pointing.
  • Step 4 − Increment front pointer to point to the next available data element.
  • Step 5 − Return success.
Algorithm 
 if queue is empty
      return underflow
   end if

   data = queue[front]
   front  front + 1
   return true 
   stop. 
 
Source Code: 

Infix to Prefix Conversion

While we use infix expressions in our day to day lives. Computers have trouble understanding this format because they need to keep in mind rules of operator precedence and also brackets. Prefix and Postfix expressions are easier for a computer to understand and evaluate.
Given two operands a and b and an operator \odot, the infix notation implies that O will be placed in between a and b i.e  a \odot b . When the operator is placed after both operands i.e ab\odot, it is called postfix notation. And when the operator is placed before the operands i.e  \odot a b, the expression in prefix notation.


Algorithm:
Step 1.  Push “)” onto STACK, and add “(“ to end of the A
 Step 2. mScan A from right to left and repeat
step 3  to 6 for each element of A until the STACK is empty Step 3. If an operand is encountered add  it to B
Step 4.  If a right parenthesis is encountered push it onto STACK
 Step 5.   If an operator is encountered then:
 a. Repeatedly pop from STACK and add to B each operator (on the top of STACK) which has same or higher precedence than the operator.
 b. Add operator to STACK
 Step 6.   If left parenthesis is encontered then
a. Repeatedly pop from the STACK and add to B (each operator on top of stack until a left parenthesis is encounterd)
 b. Remove the left parenthesis
Step 7. Exit

Source Code:

Infix to Postfix Conversion

Infix expression:The expression of the form a op b. When an operator is in-between every pair of operands.
Postfix expression:The expression of the form a b op. When an operator is followed for every pair of operands.

Algorithm
1. Scan the infix expression from left to right.
2. If the scanned character is an operand, output it.
3. Else,
…..3.1 If the precedence of the scanned operator is greater than the precedence of the operator in the stack(or the stack is empty), push it.
…..3.2 Else, Pop the operator from the stack until the precedence of the scanned operator is less-equal to the precedence of the operator residing on the top of the stack. Push the scanned operator to the stack.
4. If the scanned character is an ‘(‘, push it to the stack.
5. If the scanned character is an ‘)’, pop and output from the stack until an ‘(‘ is encountered.
6. Repeat steps 2-6 until infix expression is scanned.
7. Pop and output from the stack until it is not empty.

Source Code

Gauss Elimination Method(Algorithm and Source code)

Gauss Elimination method can be adopted to find the solution of linear simultaneous equations arising in engineering problems. In the method, equations are solved by elimination procedure of the unknowns successively.
The method overall reduces the system of linear simultaneous equations to an upper triangular matrix. Then backward substitution is used to derive the unknowns. This is the key concept in writing an algorithm or program, or drawing a flowchart for Gauss Elimination.
In the Gauss Elimination method algorithm and flowchart given below, the elimination process is carried out until only one unknown remains in the last equation. It is straightforward to program, and partial pivoting can be used to control rounding errors.

Gauss Elimination Algorithm:

  1. Start
  2. Declare the variables and read the order of the matrix n.
  3. Take the coefficients of the linear equation as:
    Do for k=1 to n
    Do for j=1 to n+1
    Read a[k][j]
    End for j
    End for k
  4. Do for k=1 to n-1
    Do for i=k+1 to n
    Do for j=k+1 to n+1
    a[i][j] = a[i][j] – a[i][k] /a[k][k] * a[k][j]
    End for j
    End for i
    End for k
  5. Compute x[n] = a[n][n+1]/a[n][n]
  6. Do for k=n-1 to 1
    sum = 0
    Do for j=k+1 to n
    sum = sum + a[k][j] * x[j]
    End for j
    x[k] = 1/a[k][k] * (a[k][n+1] – sum)
    End for k
  7. Display the result x[k]
  8. Stop
Source code in C:


#include<stdio.h>
int main()
{
    int i,j,k,n;
    float A[20][20],c,x[10],sum=0.0;
    printf("\nEnter the order of matrix: ");
    scanf("%d",&n);
    printf("\nEnter the elements of augmented matrix row-wise:\n\n");
    for(i=1; i<=n; i++)
    {
        for(j=1; j<=(n+1); j++)
        {
            printf("A[%d][%d] : ", i,j);
            scanf("%f",&A[i][j]);
        }
    }
    //upper triangular matrix
    for(j=1; j<=n; j++) 
    {
        for(i=1; i<=n; i++)
        {
            if(i>j)
            {
                c=A[i][j]/A[j][j];
                for(k=1; k<=n+1; k++)
                {
                    A[i][k]=A[i][k]-c*A[j][k];
                }
            }
        }
    }
    x[n]=A[n][n+1]/A[n][n];
    
    // Backward substitution
    for(i=n-1; i>=1; i--)
    {
        sum=0;
        for(j=i+1; j<=n; j++)
        {
            sum=sum+A[i][j]*x[j];
        }
        x[i]=(A[i][n+1]-sum)/A[i][i];
    }
    // Displaying result
    printf("\nThe solution is: \n");
    for(i=1; i<=n; i++)
    {
        printf("\nx%d=%f\t",i,x[i]); 
    }
    return(0);
}