WELCOME TO GTU MATERIAL

GTU MATERIAL PROVIDE YOU ALL TYPE OF EDUCATION MATERIAL | DOWNLOAD FREE MATERIAL | ALL TYPE OF EDUCATION SOFTWARES | EXAM ALERTS | EBOOKS | EXAM PAPERS | TIME TABLE | ALL TYPE OF SYLLABUS | MBA | MCA | ENGINEERING | BE | FREE MATERIAL PROVEDE

SHARE YOUR MATERIAL ALSO.. PLEASE SEND ME YOUR MATERIAL WHO SHARE WITH PEOPLE WE PUBLISH IN GTU MATERIAL WITH YOU NAME.. PLEASE SEND US YOUR NAME, COLLEGE NAME, AND STREAM SO THAT WE CAN PUBLISH WITH YOUR NAME..

THANKS YOU SO MUCH.....

Monday 28 February 2011

GCET EXAM | GCET MATERIAL | COMMON ENTERENCE TEST | GCET Preparation

  • Unique Philosophy - foresight school is the only training institute in Gujarat which is dedicated exclusively to GCET preparation. We are a specialized institute that caters only to those students who are preparing for GCET (MBA & MCA). We understand that students from Gujarat have different learning needs and our content and delivery are designed to fulfil these needs.
  • Expert Faculty - Every student at foresight school is taught by a team of dedicated professionals who have topped GCET exam in recent years. We do not have any visiting faculties and all the sessions are conducted by Mr. Mikin Shah (GCET Rank 1 - 2004, 2009 & 2010) and Mr. Manan Shah (GCET Rank 24 - 2004). The students are continuously moulded to develop key skills that are required to excel at GCET.
  • Content & Technology - We are proud to have TestFunda as our content and technology partner. Our material is continuously updated as per the evolving patterns and it is available to students in print as well as online formats. With GCET having gone online since 2009, technology is increasingly playing an important role in GCET preparation as well as the testing.
  • Online Testing - Our students have access to a large number of full length mock GCETs. Such mock tests are based on the latest patterns and are very similar to the actual GCET. For each online test, the student will be provided a national percentile, rank and detailed performance analysis. Each online test will be backed up by class-room teaching by expert faculty members.
  • Continuous Support - Our students have the benefit of round the clock support through various channels such as class-rooms, internet and mobile. Students are free to raise and resolve doubts at any time during the sessions. They can also contact us through e-mail or a dedicated helpline.
  • Career Counselling - foresight school is founded by individuals who have considerable exposure in corporate as well as academic spheres. We arrange regular interactive sessions with Industry experts and faculty members of GTU affiliated B-schools to guide our students.   

Sunday 27 February 2011

IMPORTANT SQL QUESTIONS


1)      List various data types available in oracle. Explain it.
2)      What is constraint? List various constraints. Explain Primary Key.
3)      Explain referential integrity constraint. (F.K.)
4)      Explain business constraint.( check constraint )
5)      Explain various types of joins in oracle.
6)      Explain index and its types in detail.
7)      What is view? Explain views in detail.
8)      Explain sequence with example.
9)      Explain synonym.
10)  Explain group by and having with example.
11)  Explain union, intersect and minus.
12)  List various types of functions available in oracle. Explain aggregate function(group functions : avg,min,max,count,sum,greatest,least).
13)  Explain string functions. (lower, upper, initcap, substr, length, ltrim, rtrim, lpad, rpad, instr, soundex)
14)  Explain numeric functions. (abs,ceil,floor,mod,power,round,sign,sqrt,trunc,cos,sin,tan,log,ln)
15)  Explain date functions. (add_months, last_day, months_between, next_day)
16)  Explain conversion functions. (to_number, to_date, to_char)
17)  List various collection types. Explain any one. (Varray, Nested table, PL/SQL table).
18)  Explain grant and revoke. Explain role.

IMPORTANT PL/SQL QUESTIONS


1)      Explain the PL/SQL block structure.
2)      Explain advantages of PL/SQL.
3)      List the special data types of PL/SQL and explain it. (%TYPE & %ROWTYPE)
4)      What is cursor? Explain in detail.
5)      Explain parameterized cursor.
6)      Explicit cursor handling using for loop.
7)      Advantages of using procedure and function.
8)      Explain procedure with example.
9)      Explain function with example.
10)  Explain trigger in detail.
11)  Explain types of triggers.
12)  Explain package.
13)  Explain error handling in PL/SQL.
14)  Explain named exception handlers.
15)  Explain user defined exception handlers.
16)  Explain types of Locks and level of Locks.
17)  Explain concurrency control in oracle with its implementation method. (OR explain Locks.).
18)  Explain if condition, For loop, While loop and goto statement.

ORACLE ARCHITECTURE


1)      State E.F.Codds’s 12 rules of RDBMS.
2)      What is database? Explain processes.
3)      Explain database support processes (or server processes).
4)      List and explain oracle background processes.
5)      Define blocks, segments and extents.
6)      Explain control files and redo log files.
7)      Explain types of tablespace in oracle.
8)      Explain initialization parameter (or init.ora) file.
9)      The logical and physical structure of oracle database.
10)  List and explain responsibilities of DBA.
11)  Explain oracle instance.
12)  Explain oracle memory structure.
13)  Explain SGA with its components.
14)  Explain PGA.
15)  Explain difference between DDL and DML.
16)  Explain E-R diagram and types of relationship.
17)  What is Entity? Explain type of relationship between entities with diagram.
18)  What is transaction? Explain with a facility to undo the changes.
19)  Explain SQL*Loader.
20)  Explain IMPORT & EXPORT facility in oracle.

Friday 25 February 2011

gtu syllabus for 1st semester Books Online pdf | Download Free gtu ...

gtu syllabus for 1st semester Books Online : Download gtu syllabus for 1st semester Online Pdf ... MCA 1st Semester MCA 3rd Semester Network Management. MCA-505. 19060. Note: 2- 3- MCA ...

gtu mca syllabus

Posted by http://www.resultsof.com/gtu-mca-syllabus| 2011-01-25 00:01:23
gtu mca syllabus ... Gujarat Technological University Assessment Module for MCA : Assessment Module for MBA : Syllabus for MBA Programme effective ...

Mca Syllabus Timeline

Posted by http://www.dipity.com/timeline/Mca-Syllabus/| 2011-01-25 00:01:23
Mca Syllabus has no followers yet. Be the first one to follow. ... Welcome to GTU-MCA family This site is developed only for sharing knowledge.

Thursday 24 February 2011

MCA Sem-II Object oriented Concepts & Programming January 2011 GTU Question paper for Object oriented Concepts & Programming ; GTU question paper for MCA 2011 ; GTU questionbank 2011

Seat No.: _____ Enrolment No.______
GUJARAT TECHNOLOGICAL UNIVERSITY
MCA. Sem-II Remedial Examination December 2010
Subject code: 620003
Subject Name:
Object oriented Concepts & Programming
Date:18 /12 /2010 Time: 10.30 am – 01.00 pm
Total Marks: 70

Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
Q.1 (a) 1. Write the different ways of writing function prototypes. Find errors, if any in the
declaration - int mul(int a,b);
03
2. What is the use of parameterized constructor? Define dynamic constructor. What
is the difference between following two statements if integer is a class and
integer(int x, int y) is the constructor method. integer int1 = integer(0,100);
integer int1(0,100);
04
(b) 1. What is operator overloading? What is the difference if friend function is used in
the place of member functions for overloading binary operator?
03
2. How type conversion from a class to basic type is performed? Which conditions
casting operator function should satisfy? Can the constructor student (int rollno,
double percentage) for class student be used to convert types?
04
Q.2 (a)
1. Explain keyword “this” in C++ language. What are the applications of this
pointer?
03
2. Explain the manipulators provided in the header file iomanip that can be used to
manipulate the output formats. Explain how a user can create his own manipulator.
04
(b) 1. What is the difference between opening a file with a constructor function and
opening a file with open() function? When is one method preferred over the other?
03
2. What is an abstract class? What is virtual base class? 04
OR
(b)
1. What is the difference between overloaded functions and function templates?
Justify - Is this a legal statement –
Template
Class Test
{
};
03
2. What is an exception? When does a program throw an exception? What should be
placed inside a try block? What should be placed inside a catch block?
04
Q.3 (a)
1. What is Standard Template Library(STL). Which three types of containers are
there in STL?
03
2. What is the use of keyword “namespace”? Explain with example how to define a
namespace.
04
(b) 1. Describe the set of classes that define the file handling methods the I/O system of
C++ contains.
03
2. Explain under what circumstances the following statements would be used?
(i) throw;
catch(…)
04
2
OR
Q-3 (a) 1. Explain with example the types of get() functions. 03
2. What are the different types of inheritance? 04
(b)
1. When a function will be made inline? Why? How does it differ from preprocessor
macro?
03
2. What is a copy constructor? What is the difference between the following
statements?
Integer I2(I1);
I2=I1;
04
Q-4 (a) 1. Explain static member variable and member function. 03
2. Explain with example how to overload unary operators. 04
(b)
1. What is a virtual function? When do we make a virtual function “pure”? What is
a function template?
03
2. Which containers are supported by Standard Template Library (STL)? 04
OR
Q-4 (a) 1. What is a file mode? Describe the various file mode options available. 03
2. What is the role of following functions? seekg() , seekp() tellg(), tellp() 04
(b)
1. How can a necessary width of a field be defined for the output of an item with ios
member function?
03
2. Which functions can be used for reading a string? 04
Q-5 (a) 1. How can the address of a member of a class be assigned to a pointer 03
2. When a member function can be called const member function? 02
3. What is the purpose of local class? 02
(b) 1. A function can also return a reference – explain. 03
2. How can you pass object as a function argument? 04
OR
Q-5 (a) 1. Explain constant pointer and pointer to constant. What is the use of const qualifier? 03
2. What is the difference between a structure and a class in C++? 02
3. How does a class accomplish data hiding? 02
(b) 1. What is the role of destructor? How it is defined and when it is invoked? 03
2. How is polymorphism achieved at (i) compile time and (ii) run time? 04

MCA Sem-II Computer Oriented Numerical Methods January 2011 GTU Question paper for Computer Oriented Numerical Methods ; GTU question paper for MCA 2011 ; GTU questionbank 2011

Seat No.: _____ Enrolment No.______
GUJARAT TECHNOLOGICAL UNIVERSITY
MCA. Sem-II Remedial Examination December 2010
Subject code: 620005
Subject Name: Computer Oriented Numerical Methods
Date: 20 /12 /2010 Time: 10.30 am – 01.00 pm
Total Marks: 70



Follow the link to download free MCA Sem-II Computer Oriented Numerical Methods January 2011 GTU Question paper for Computer Oriented Numerical Methods  question paper:
- Download

Saturday 19 February 2011

GTU MCA ASSIGNMENT AND MATERIAL


  1. GTU MCA ASSIGNMENT AND MATERIAL

     - 2 visits - 11 Feb
    24 Sep 2010 ... Copyright 2010GTU ASSIGNMENT All rights reserved. GTU MCA ASSIGNMENT AND MATERIAL Powered by GTU MCA ASSIGNMENT AND MATERIAL.
    gtuassignment.blogspot.com/ - Cached
  2. GTU MATERIAL: MCA FOP Assignment - 3

    9 Dec 2010 ... Get GTU all year question papers online on the blog, Search GTU question paper online, GTU,GTU question paper, GTU question paper 2010, ...
    gtu-mca1.blogspot.com/2010/12/mca-fop-assignment-3.html - Cached
  3. GTU MATERIAL: Assignment – I

    29 Nov 2010 ... Assignment - 5 Relational Algebra · Assignment – 7 (Introduction to other Databases) · Most Important Questions of GTU MCA DBMS-II ...
    gtu-mca1.blogspot.com/2010/11/assignment-i.html - Cached
  4. GTU MCA ASSIGNMENT AND MATERIAL: System Software (SS) 630005- HiData

    4 Sep 2010 ... Basic scholarship of computer architecture and C programming. Contents: Unit-1: Introduction to ...,Information and data to find.
    www.hidata.net/P/view/id-24798 - Cached
  5. Structured & Object Oriented Analysis & Design Methodology ...

    23 Jul 2010 ... SOOADM GTU MCA Material Assignments. Skip to content ... Assignment – III. 1. List advantages of using data flow approaches. ...
    sooadm.wordpress.com/ - Cached
  6. Deadline for DPEM Assignment: Saturday 14 November 09 | gtu.mu

    GTU president intervened in favour of teachers following the DPEM and who are involved in CPE Marking exercise and who will not be able to turn up to the ...
    gtu.mu/.../deadline-for-dpem-assignment-saturday-14-november-09/ - Cached
  7. Assignment - 2 Concurrency Control | GTU MCA MATERIAL FOR DBMS II

     - 20/12/10
    Dear Sir u have Problem in you search engine Friendly title, See on title bar of browser you have seen " GTU MCA MATERIAL FOR DBMS II" a Common word Comes ...
    dbms-ii.blogspot.com/2010/.../assignment-2-concurrency-control.html - Cached
  8. smu mca assignment 2010 - GTU

    smu mca assignment 2010 jntu kakinada mca results jntu kakinada mca results 2011 jntu kakinada mca results 2009 jntu kakinada mca results 1st jntu kakinada ...
    www.gtu.co.in/smu-mca-assignment-2010 - Cached
  9. [PDF] 

    SYLLABUS: GTU/INSTITUTE OF BUDDHIST STUDIES -Spring, 2011 ...

    File Format: PDF/Adobe Acrobat - Quick View
    [Note: This week please read before the reading Assignment the first section of the ... [NOTE: March 21-27 is GTU Spring week]. 8. Week of March 28 ...
    www.shin-ibs.edu/documents/syllabi/2011spring/HR8305.pdf
  10. [PDF] 

    Program Details - Program Title : Designing Question Papers for ...

    File Format: PDF/Adobe Acrobat - Quick View
    instructional Objectives in different Domain. (assignment). • Content Analysis. • Development of specification table in a subject / paper ( assignment...
    www.gtu.ac.in/.../PROGRAMME_DETAILS_QpaperSettingMaths.pdf

Friday 18 February 2011

GTU C PROGRAMS | HEAP SORT PROGRAM

C:
-------------------------------------------------------------------------
/* HEAP SORT */
/* HEAP.C */
# include<stdio.h>
void  heap_sort(int *, int );
void create_heap(int *, int);
void display(int *, int);
/*  Definition of the function */
void create_heap(int list[], int n )
{
 int k, j, i, temp;
 for(k = 2 ; k <= n;  ++k)
 {
  i = k ;
  temp = list[k];
  j = i / 2 ;
  while((i > 1) && (temp > list[j]))
  {
   list[i] = list[j];
   i = j ;
   j = i / 2 ;
   if ( j < 1 )
    j = 1 ;
  }
  list[i] = temp ;
 }
}
/* End of heap creation function */
/* Definition of the function */
void heap_sort(int list[], int n)
{
 int k, temp, value, j, i, p;
 int step = 1;
 for(k = n ; k >= 2; --k)
 {
  temp = list[1] ;
  list[1] = list[k];
  list[k] = temp ;
  i = 1 ;
  value = list[1];
  j = 2 ;
  if((j+1) < k)
   if(list[j+1] > list[j])
    j ++;
  while((j <= ( k-1)) && (list[j] > value))
  {
   list[i] = list[j];
   i = j ;
   j = 2*i ;
   if((j+1) < k)
    if(list[j+1] > list[j])
     j++;
    else
     if( j > n)
      j = n ;
   list[i] = value;
  } /* end of while statement */
  printf("\n Step = %d ", step);
  step++;
  for(p = 1; p <= n; p++)
   printf(" %d", list[p]);
 } /* end for loop */
}
/* Display function */
void display(int list[], int n)
{
 int i;
 for(i = 1 ; i <= n; ++ i)
 {
  printf("  %d", list[i]);
 }
}
/* Function main */
void main()
{
 int list[]={ 0,10,23,64,21,74,95,2,59,44,87,55};
 int i, size = 11 ;
 clrscr();
/* printf("\n Size of the list: %d", size);
 for(i = 1 ; i <= size ; ++i)
 {
  list[i] = rand() % 100;
 }*/
 printf("\n Entered list is as follows:\n");
 display(list, size);
 create_heap(list, size);
 printf("\n Heap\n");
 display(list, size);
 printf("\n\n");
 heap_sort(list,size);
 printf("\n\n Sorted list is as follows :\n\n");
 display(list,size);
 getch();
}

--------------------------------------------------------------------------
C++ :
--------------------------------------------------------------------------
  // HEAP SORT
  // HEAP.CPP
  # include<iostream.h>
  class heap_s
    {
 private:
 public:
    void  heap_sort(int *, int );
    void create_heap(int *, int);
    void display(int *, int);
    };

 //  definition of the function
  void heap_s :: create_heap(int list[], int n )
  {
    for( int k = 2 ; k <= n;  ++k)
       {
  int i = k ;
  int temp = list[k];
  int j = i / 2 ;
  while((i > 1) && (temp > list[j]))
     {
      list[i] = list[j];
      i = j ;
      j = i / 2 ;
      if ( j < 1 )
        j = 1 ;
     }
     list[i] = temp ;
   }
       }
// end of heap creation function
// definition of the function
 void  heap_s :: heap_sort(int list[], int n)
 {
    for( int k = n ; k >= 2; --k)
      {
  int temp = list[1] ;
  list[1] = list[k];
  list[k] = temp ;
  int i = 1 ;
  int value = list[1];
  int j = 2 ;
  if((j+1) < k)
     if(list[j+1] > list[j])
        j ++;
         while((j <= ( k-1)) && (list[j] > value))
   {
    list[i] = list[j];
    i = j ;
    j = 2*i ;
     if((j+1) < k)
       if(list[j+1] > list[j])
         j++;
         else
         if( j > n)
         j = n ;
         list[i] = value;
         } // end of while statement
       cout<<"\n";
       for(int p=1; p<=n; p++)
       cout<<"  "<<list[p];
    } //end for loop
        }
  void heap_s :: display(int list[], int n)
      {
 for( int i = 1 ; i <= n; ++ i)
     {
       cout<<"  "<<list[i];
     }
       }
    void main()
  {
    heap_s sort;
    int list[100];
    int size ;
    cout<<"\n Input the size of the list :";
    cin>>size;

    for(int i = 1 ; i <= size ; ++i)
     {
       cout<<"\n Input values for :" <<i<< " : ";
       cin>>list[i];
     }
     cout<<"\n Entered list is as follows:\n";
     sort.display(list, size);
     sort.create_heap(list, size);
     cout<<"\n Heap\n";
     sort.display(list, size);
     sort.heap_sort(list,size);
     cout<<"\n Sorted list is as follows :\n";
     sort.display(list,size);
  }



GTU C PROGRAMS | SHELL SORT PROGRAM

C :
-------------------------------------------------------------------------
/* shell.c */
/* shell sort */
#include <stdio.h>
#include <stdlib.h>
void shell_sort(int array[], int size)
{
 int temp, gap, i, exchange_occurred;
 gap = size / 2;
 do {
  do {
   exchange_occurred = 0;
   for (i = 0; i < size - gap; i++)
    if (array[i] > array[i + gap])
    {
     temp = array[i];
     array[i] = array[i + gap];
     array[i + gap] = temp;
     exchange_occurred = 1;
    }
  } while (exchange_occurred);
 } while (gap == gap / 2);
}
void main(void)
{
 int values[50], i;
 printf("\n Unsorted list is as follows \n");
 for (i = 0; i < 50; i++)
 {
  values[i] = rand() % 100;
  printf(" %d", rand() %100);
 }
 shell_sort(values, 50);
 printf("\n Sorted list is as follows \n");
 for (i = 0; i < 50; i++)
  printf("%d ", values[i]);
}
-------------------------------------------------------------------------
C++
-------------------------------------------------------------------------
// SHELL SORTING
// SHELL.CPP
# include<iostream.h>
#include <stdio.h>
#include <stdlib.h>
   class shell
       {
 private:
  int temp, gap, i, swap;
 public:
  void shell_sort(int *, int );
  void display(int *, int);
       };
void shell :: shell_sort(int array[], int size)
   {
     gap = size / 2;
     int k =0;
   do {
    do {
      swap = 0;
      k++;
      for (i = 0; i < size - gap; i++)
       if (array[i] > array[i + gap])
        { 
          temp = array[i];
          array[i] = array[i + gap];
          array[i + gap] = temp;
   swap = 1;
 }
 for(int t=0;t<size; t++)
  cout<<" "<<array[t];
 cout<<"  Swap="<<swap;
 cout<<"\n";
    } while (swap);
   } while (gap = gap / 2);
  }
  void shell :: display(int list[], int n)
     {
       cout<<"\n Sorted list is as follows:\n";
       for( int i = 0; i < n; i++)
 cout<<"  " << list[i];
     }
   void main(void)
    {
    shell sort;
    int list[50];
    int number;
   cout<<"\n Input the number of elements in the list:";
   cin>>number;
   for (int i = 0; i < number; i++)
   {
      cout<<"\n Input the value for the "<< i+1<<" : ";
      cin>>list[i];
   }
   sort.shell_sort(list, number);
   sort.display(list,number);
 }

GTU C PROGRAMS | RADIX SORT PROGRAM

C :
--------------------------------------------------------------------------

/* RADIX SORT */
/* RADIX.C*/
# include<stdio.h>
# include<malloc.h>
# include<stdlib.h>
struct node
{
 int data ;
 struct node *next;
};
typedef struct node node1;
node1 *first;
node1 *pocket[100], *pocket1[100];
void create_node(node1 *, int);
void display(node1 *);
node1 *radix_sort(node1 *);
int large(node1 * );
int numdig(int );
int digit(int , int);
void update(int, node1 *);
node1 *Make_link(int, node1 *);
/* This function create nodes and take input data */
void  create_node(node1 *rec, int n)
{
 int i, j, k;
 for(i = 0 ; i< n; i++)
 {
  rec->next = (node1 *) malloc(sizeof(node1));
  printf("\n First node value: %d: ", i);
  scanf("%d", &rec->data);
  rec = rec->next;
 }
 rec->data = NULL;
 rec->next = NULL;
}
/* Output Function */
void  display(node1 *rec)
{
 while(rec != NULL)
 {
  printf(" %d", rec->data);
  rec= rec->next;
 }
}
/* This radix sort function */
node1 *radix_sort(node1 *rec)
{
 node1 *r, *nex;
 int poc = 0 ;
 int i, j, k;
 int larg = large(rec);
 int m = numdig(larg);
 /* These statements create pockets */
 for(k = 0 ; k < 10; k++)
 {
  pocket[k] = (node1 *)malloc(sizeof(node1));
  pocket1[k] = (node1 *)malloc(9*sizeof(node1));
 }
 /* These statements initialize pockets */
 for(j = 1; j <= m ; j++)
 {
  for(i = 0 ; i < 10 ; i++)
  {
   pocket[i] = NULL;
   pocket1[i] = NULL ;
  }
  r = rec ;
  while(r != NULL)
  {
   int dig = digit(r->data, j);
   nex = r->next ;
   update(dig,r);
   r = nex;
  }
  if(r!= NULL)
  {
   int dig = digit(r->data,j);
   update(dig,r);
  }
  while(pocket1[poc] == NULL)
   poc ++;
  rec = Make_link(poc, rec);
 }
 return(rec);
}
/* This function finds largest number in the list */
int large(node1 *rec)
{
 node1 *save ;
 int p = 0;
 save = rec ;
 while(save != NULL)
 {
  if(save ->data > p)
  {
   p = save->data;
  }
  save = save->next ;
 }
 printf("\n Largest element: %d", p);
 return(p);
}
/* This Function finds number digits in a number */
int numdig(int large)
{
 int temp = large ;
 int num = 0 ;
 while(temp != 0)
 {
  ++num ;
  temp = temp/10 ;
 }
 printf("\n  Number of digits of the number %d is %d\n", large, num);
 return(num);
}
/* This function scarve a number into digits */
int digit(int num, int j)
{
 int dig, i, k;
 int temp = num ;
 for(i = 0 ; i < j ; i++)
 {
  dig = temp % 10 ;
  temp = temp / 10 ;
 }
 printf("\n  %d digit of number  %d is %d", j, num, dig);
 return(dig);
}
/* This function updates the pockets value */
void  update(int dig, node1 *r)
{
 if(pocket[dig] == NULL)
 {
  pocket[dig] = r ;
  pocket1[dig] = r ;
 }
 else
 {
  pocket[dig]->next = r ;
  pocket[dig] = r ;
 }
 r->next = NULL;
}
/* This function create links between the nodes */
node1* Make_link(int poc , node1 *rec)
{
 int i, j, k;
 node1 *pointer;
 rec = pocket1[poc];
 for(i = poc +1 ; i< 10 ; i++)
 {
  pointer = pocket[i-1];
  if(pocket[i] != NULL)
   pointer->next= pocket1[i];
  else
   pocket[i] = pointer ;
 }
 return(rec);
}
/* Main function */
void  main()
{
 node1 *start, *pointer;
 int number;
 printf("\n Input the number of elements in the list:");
 scanf("%d", &number);
 start = (node1 *)malloc(sizeof(node1));
 create_node(start, number);
 printf("\n Given list is as follows \n");
 display(start);
 start = radix_sort(start);
 printf("\n Sorted list is as follows:\n");
 display (start);
}
-------------------------------------------------------------------------
C++

-------------------------------------------------------------------------
 // RADIX SORT
 // RADIX.CPP
#include<iostream.h>
#include<conio.h>
#include<malloc.h>
#include<stdlib.h>
struct node
{
 int data;
 struct node *next;
};
typedef struct node node1;
class radix
{
 public:
  node1 *first;
  node1 *pocket[100], *pocket1[100];
 public:
  void create_node(node1 *, int);
  void display(node1 *);
  node1 *radix_sort(node1 *);
  int large(node1 * );
  int numdig(int );
  int digit(int , int);
  void update(int, node1 *);
  node1 *Make_link(int, node1 *);
};
// This function create nodes and take input data
void radix :: create_node(node1 *rec, int n)
{
 for( int i = 1 ; i<= n; i++)
 {
  rec->next = (node1 *) malloc(sizeof(node1));
  cout<<"\n First node value:"<<i<<":";
  cin>>rec->data;
  rec = rec->next;
 }
 rec->next = NULL;
}
// Output Function
void radix ::  display(node1 * rec)
{
 while(rec)
 {
  cout<<"  "<<rec->data;
  rec= rec->next;
 }
 getch();
}
// This radix sort function
node1 * radix ::  radix_sort(node1 *rec)
{
 int larg = large(rec);
 int m = numdig(larg);
// These statements create pockets
 for(int k = 0 ; k < 10; k++)
 {
  pocket[k] = (node1 *)malloc(sizeof(node1));
  pocket1[k] = (node1 *)malloc(9*sizeof(node1));
 }
// These statements initialize pockets
 for(int j = 1; j <= m ; j++)
 {
  for(int i = 0 ; i < 10 ; i++)
  {
   pocket[i] = NULL;
   pocket1[i] = NULL ;
  }
  node1 *r = rec ;
  while(r != NULL)
  {
   int dig = digit(r->data, j);
   node1 *nex = r->next ;
   update(dig,r);
   r = nex;
  }
  if(r!= NULL)
  {
   int dig = digit(r->data,j);
   update(dig,r);
  }
  int poc = 0 ;
  while(pocket1[poc] == NULL)
   poc ++;
  rec = Make_link(poc, rec);
  cout<<"\n Newly ordered list:\n";
  display(rec);
 }
 return(rec);
}
// This function finds largest number in the list
int radix :: large(node1 *rec)
{
 node1 *save ;
 int p = 0;
 save = rec ;
 while(save != NULL)
 {
  if(save ->data > p)
   p = save->data;
  save = save->next ;
 }
 cout <<"\n Largest element:"<<p;
 return(p);
}
// This Function finds number digits in a number
int radix :: numdig(int large)
{
 int temp = large ;
 int num = 0 ;
 while(temp != 0)
 {
  ++num ;
  temp = temp/10 ;
 }
 cout <<"\n Number of digits of the number "<<large<<" is "<<num ;
 return(num);
}
// This function scarve a number into digits
int radix :: digit(int num, int j)
{
 int dig ;
 int temp = num ;
 for( int i = 0 ; i < j ; i++)
 {
  dig = temp % 10 ;
  temp = temp / 10 ;
 }
 cout<<"\n";
 cout <<j <<" digit of number "<<num <<" is "<<dig;
 getch();
 return(dig);
}
// This function updates the pockets value
void radix :: update(int dig, node1 *r)
{
 if(pocket[dig] == NULL)
 {
  pocket[dig] = r ;
  pocket1[dig] = r ;
 }
 else
 {
  pocket[dig]->next = r ;
  pocket[dig] = r ;
 }
 r->next = NULL;
}
// This function create links between the nodes
node1* radix :: Make_link(int poc , node1 *rec)
{
 node1 *pointer;
 rec = pocket1[poc];
 for(int i = poc +1 ; i< 10 ; i++)
 {
  pointer = pocket[i-1];
  if(pocket[i] != NULL)
   pointer->next= pocket1[i];
  else
   pocket[i] = pointer ;
 }
 return(rec);
}
// Main function
void  main()
{
 radix rad;
 node1 *start, *pointer;
 int number;
 cout<<"\n Input the elements of the list :\n";
 cout<<"\n Input the number of elements in the list:";
 cin>>number;
 start = (node1 *)malloc(sizeof(node1));
 rad.create_node(start, number);
 cout<<"\n Given list is as follows \n";
 rad.display(start);
 start = rad.radix_sort(start);
 cout<<"\n Sorted list is as follows:\n";
 rad.display (start);
}

GTU C PROGRAMS | QUICK SORT PROGRAM

C :

/* quick.c */
#include <stdio.h>
#include <stdlib.h>
void quick_sort(int array[], int first, int last)
{
 int temp, low, high, list_separator,i;
 low = first;
 high = last;
 list_separator = array[(first + last) / 2];
 do {
  while (array[low] < list_separator)
   low++;
  while (array[high] > list_separator)
   high--;
  if (low <= high)
  {
   temp = array[low];
   array[low++] = array[high];
   array[high--] = temp;
  }
 } while (low <= high);
 for (i = 0; i < 11; i++)
  printf("%d ", array[i]);
 printf("\n");
 getch();
 if (first < high)
  quick_sort(array, first, high);
 if (low < last)
  quick_sort(array, low, last);
}
void main(void)
{
 int values[]={10,23,64,21,74,95,2,59,44,87,55}, i;
 clrscr();
 for (i = 0; i < 11; i++)
  printf("%d ", values[i]);
 printf("\n");
/* printf("\n Unsorted list is as follows \n");
 for (i = 0; i < 20; i++)
 {
  values[i] = rand() % 100;
  printf(" %d", rand() %100);
 }*/
 quick_sort(values, 0, 10);
 printf("\n Sorted list as follows\n");
 for (i = 0; i < 11; i++)
  printf("%d ", values[i]);
 getch();
}

------------------------------------------------------------------

C++

  // QUICK SORT
  # include<iostream.h>
  # include <stdlib.h>
    class quick
       {
 private: int temp, low, high, pivot;
 public:
 void Q_sort(int *, int , int );
 void display(int *, int );
      };
// sorting function
void quick :: Q_sort(int array[], int first, int last)
 {
   low = first;
   high = last;
   pivot = array[(first + last) / 2];
   do {
     while (array[low] < pivot )
       low++;
     while (array[high] > pivot)
       high--;
     if (low <= high)
      {
 temp = array[low];
 array[low++] = array[high];
 array[high--] = temp;
      }
   } while (low <= high);
  if (first < high)
    Q_sort(array, first, high);
  if (low < last)
    Q_sort(array, low, last);
 }
   void quick :: display(int list[], int n)
     {
       cout<<"\n List after sorting the elements:\n";
       for( int i = 1 ; i <= n ; i++)
       {
  cout<<"  "<<list[i];
       }
     }
 void main(void)
  {
   quick sort;
   int list[100];
   int number ;
   cout<< "\n Input the number of elements in the list:";
   cin>> number;
   for ( int i = 1; i <= number; i++)
    {
     cout<<" Input the value for : "<< i <<" : ";
     cin>>list[i];
    }
  sort.Q_sort(list, 1, number);
  sort.display(list, number);
   }

GTU C PROGRAMS MATERIAL | BUBBLE SORT PROGRAM

C :

/* bubble.c */
#include <stdio.h>
#include <stdlib.h>
void bubble_sort(int array[], int size)
{
 int temp, i, j;
 for (i = 0; i < size; i++)
  for (j = 0; j < size; j++)
   if (array[i] < array[j])
   {
    temp = array[i];
    array[i] = array[j];
    array[j] = temp;
   }
}
void main(void)
{
 int values[30], i;
 printf("\n Unsorted list is as follows\n");
 for (i = 0; i < 10; i++)
 {
  values[i] = rand() % 100;
  printf(" %d", rand()%100);
 }
 bubble_sort(values, 10);
 printf("\n Sorted list is as follows\n");
 for (i = 0; i < 10; i++)
  printf("%d ", values[i]);
}

------------------------------------------------------------
C++

 // BUBBLE SORT
 # include<iostream.h>
 # include<conio.h>
     class bubble
      {
 private:
 public:
       void bubble_sort(int , int *); // prototype
       void display(int *, int);
      };
// definition of function
void bubble ::  bubble_sort(int n, int l[])
  {
      int limit = n - 1 ;
      int flag = 1 ;
   for(int j = 0 ; j< n - 1; j++)
   {
     for(int k = 0 ; k<  limit - j ; k++)
      {
        if(l[k] > l[k+1])
   {
    int  temp = l[k];
         l[k] = l[k+1];
         l[k+1] = temp ;
         flag = 0;
    }
        }
    if(flag)
       break ;
       else
        flag = 1;
     }
 }
      void bubble :: display(int list[], int number)
 {
   for( int i = 0 ; i < number ; i++)
   cout<<"  "<< list[i];
 }

 void main()
        {
  bubble sort;
  int number, key, list[200];
  clrscr();
  cout <<"Input the number of elements in the list:";
  cin >> number;
  cout <<"\n Number  of elements in the list is :"<<number;
  for(int i = 0 ; i < number; i++)
  {
  cout<<"\nInput the elements of the list : "<< i+1<<" : ";
  cin >> list[i];
  }
  cout<<"\n Entered list is as follows:\n";
  sort.display(list,number);
  sort.bubble_sort(number, list);
  cout<<"\n After sorting list is as  follows:\n";
  sort.display(list, number);
 }

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Grants For Single Moms