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.....

Showing posts with label MCA. Show all posts
Showing posts with label MCA. Show all posts

Wednesday, 17 August 2011

GTU MCA MATERIAL | C LANGUAGE | Preprocessor


Preprocessor:
vIt is a program that processes source program before it is passed to the complier.
vPreprocessor commands often known as directives.
vPreprocessor directives begin with a # symbol.
vThe directives can be placed anywhere in a program but generally it is beginning of a
     Program before main () or particular function.
vThese directives can be divided into 3 categories.
    1) Mecro substitution directive
    2) File inclusion directive
    3) Complier control directive
1) Macro substitution directive
   vMacro substitution is a process where an identifier in a program is replaced by a    
         predefined string composed of one or more token.
  vExample:
         #define a 25
Main ()
           {
                        Int i;
                        For (i=1;i<=a;i++)
                        {
                                    Printf(“%d”,i);
                        }
                        getch();
            }
   vThis # define a 25 statement is called “macro definition” or just a
       “macro”.
   va is often called “macro templates” and 5 is their “macro 
       expansion”.                             
  vWhen we compile the program it is check by the preprocessor for
       any macro definition before the source code passes to the    
        complier.
   vWe can use capital letter fot macro template this makes it easy for programmer to pick
       out all the macro template when reading through the program.
   vMacro template and its macro expansion are sepatated by blanks or tabs.
   vRemember that a macro definition is never to be terminated by a semicolon.
   vIt is not necessary that you can declare macro before the main function you can declare  
        anywhere in the program.
For Example:
main()
{
            #define pf printf
            pf(“Jay Swaminarayan”);
            getch();             
}

v #define directive is many a times used to define operators.
    #define AND &&
    #define    OR    ||

  2) File inclusion directive

v An external file containing functions or macro definitions can be included as a part of a program so that we need not rewrite those functions or macro definitions. This is achieved by the preprocessor directive.
For example:  #include “filename”

Where filename is the name of the file containing the required definitions or functions. At this point, the preprocessor inserts the entire contents of filename into the source code of the program. When the filename is included within the double quotation marks, the search for the file is made first in the current directory and then in the standard directories.
For example:-
                                                #include<filename>
Without double quotation marks. In this case, the file is searched only in the standard directories.
        
            Nesting of included files is allowed. That is, an include file can included file can include other files. However, a file cannot include itself.
             If an included file is not found, an error is reported and compilation is terminated.
             We can make use of a definition of function contained in any of these files by including them in the program as shown below:
                                                #include<stdio.h>
                                                #include<conio.h>

3) COMPILER CONTORL DIRECTIVES: -


1)      You have included a file containing some macro definitions. It is not known whether a particular macro (say, test) has been defined in that header file. However, you want to be certain that test is define (or not defined).
2)      Suppose a customer has two different type of computer and you are required to write a program that will run on both the system.
                                    One solution to these problems is to develop different programs to suit the needs of different situations. Another method is develop a single. Comprehensive program that includes all optional codes and then directs the compiler to skip over certain parts of source code when they are not required. Fortunately, the c preprocessor offers a feature known as conditional compilation. Which can be used to ‘switch’ on or off a particular line or group of lines in a program.

Situation 1

                     This situation refers to the conditional definition of a macro. We want ensure that the macro TEST is always defined. irrespective of whether it has been defined in the header file or not. This can be achieved as follows:
                                    #include           “DEFINE.H”
                                    #ifndef                       TEST
                                    #define                        TEST   1
                                    #endif
                                    ….
                                    ….
                     DEFINE.H is the header file that is supposed to contain the definition of TEST macro. The directive.
                                    #ifndef            TEST
                     Searches for the definition of TEST in the header file and if not defined, then all the lines between the #ifndef and the corresponding #endif directive are left ‘active’ in the program.
That is, the preprocessor directive
                                    #define     TEST
is processed.

GTU MCA MATERIAL | FOP IMPORTANT QUESTIONS | FOP ASSIGNMENT.


1.What is the purpose of a header file? Is the use of a header file absolutely necessary?
2. Why and when do we use #include directive?
3. Why and when do we use #define directive?
4. Why do we need to use comment in program?
5. Describe the basic data types in C.
6. What is ASCII? How common is its use?
7. Describe the different types of operators.
8. What is the difference between prefix and postfix of – and ++ operators?
9. Describe the use of the conditional operator to form a conditional expression.
10. What are formatted input and output statements in C? Give suitable example.  
11. Find the errors, if any
/* A simple program
int main()
{
/* Does nothing*/
}
12. Find the errors, if any
#include(stdio.h)
void main(void)
{
printf(“Hello C”);
}
13.Find the errors, if any
Include <math.h>
main{}
(
FLOAT  X;
X = 2.5 ;
Y = exp(x) ;
Print(x,y);
)
14. Find the output of the program :
#include<stdio.h>
void main()
{
int x=3,y=5,z=7,w;
w=x%y + y%x - z%x - x %z;
printf(“%d\n”,w);
w=x/z + y/z + (x+y)/z;
printf(“%d”,w);
}
15.Find the output of the program :
#include<stdio.h>
void main()
{
int x=3,y=5,z=7,w=9;
w += x + y -( z -= w );
printf(“w=% d, z=%d\n”,w,z);
w += x -= y %= z;
printf(“w=%d, y=%d, z=%d”,w,y,z);
}
16. Find the output of the program :
#include<stdio.h>
void main()
{
int x=3,y=5;
x = y++ + x++;
y = ++y + ++x;
printf(“x=% d, y=%d”,x,y);
}

Tuesday, 9 August 2011

SYLLABUS | GTU MBA - 1 - 2 SEMESTER SYLLABUS | DOWNLOAD GTU MBA REVISED SYLLABUS SEM - I - II

GTU new MBA Program effective from academic year 2011-12

Sem -I Sem -III

SYLLABUS | GTU MCA - 1 - 2 SEMESTER SYLLABUS | DOWNLOAD GTU MCA REVISED SYLLABUS SEM - I - II

GTU new MCA Program effective from academic year 2011-12

Sem -I,II (Revised -  29/07/2011)

Saturday, 9 July 2011

FREE DOWNLOAD EBOOKS | Mathematics- I

Free Books on Mathematics I

Algebra and Calculus
  1. Elementary Linear Algebra, Keith Matthews
  2. New Calculus without Limits - Karl Heinz Dovermann
  3. A Summary of Calculus-Karl Heinz Dovermann
  4. A First Course in Linear Algebra, Robert A. Beezer
  5. Abstract Algebra: The Basic Graduate Year-Robert B. Ash
  6. A Course In Algebraic Number Theory-Robert B. Ash
  7. The Calculus of Functions of Several Variables - Dan Sloughter
  8. Difference Equations to Differential Equations: An Introduction to Calculus- Dan Sloughter
  9. Graphics for the Calculus-Douglas N. Arnold
  10. Multivariable Calculus - George Cain & James Herod
  11. Steven Shreve: Stochastic Calculus and Finance - Prasad Chalasani and Somesh Jha
  12. Algebra and Analysis for Computer Science -Jean Gallier
  13. Visual Calculus - Lawrence S. Husch
  14. Complex Variables- Robert B. Ash and W.P. Novinger
  15. Advanced Calculus, Lynn Loomis and Shlomo Sternberg
  16. Discrete Oscillation Theory, Ravi P. Agarwal, Martin Bohner, Said R. Grace, and Donal O'Regan
  17. Abstract Algebra with GAP- J. G. Rainbolt and J. A. Gallian
  18. A Course In Algebraic Number Theory - Robert B. Ash
  19. Mathematical Methods of Engineering Analysis - Erhan Çinlar and Robert J. Vanderbei.
  20. Impulsive Differential Equations and Inclusions, M. Benchohra, J. Henderson, and S. Ntouyas
  21. Introduction to the Theory of Functional Differential Equations: Methods and Applications, N. V. Azbelev, V. P. Maksimov, and L. F. Rakhmatullina
  22. Qualitative Analysis of Delay Partial Difference Equations, Binggen Zhang, and Yong Zhou
  23. Solvability of Nonlinear Singular Problems for Ordinary Differential Equations, Irena Rachunkova, Svatoslav Stanek, and Milan Tvrdy
  24. Qualitative Analysis of Nonlinear Elliptic Partial Differential Equations, Vicenţiu D. Rădulescu
  25. Calculus, Benjamin Crowell
  26. A Course In Commutative Algebra-Robert B. Ash
  27. A Pari/GP Tutorial- Robert B. Ash
  28. Real Variables with Basic Metric Space Topology - Robert B. Ash
  29. A Survey of Venn Diagrams-Frank Ruskey and Mark Weston
  30. A Course in Universal Algebra- Stanley Burris and H.P. Sankappanavar
  31. Algebra: Abstract And Concrete-Frederick M. Goodman
  32. Applied Abstract Algebra - D. Joyner, R. Kreminski, J. Turisco
  33. Galois Connections and Fixed Point Calculus-Roland Backhouse
  34. The Structure of Finite Algebras - David Hobby and Ralph McKenzie
  35. Introduction to Matrix Algebra - Autar K Kaw
  36. Elements of Abstract and Linear Algebra - Edwin H. Connell
  37. Elementary Linear Algebra - Keith Matthews
  38. Solutions to Elementary Linear Algebra prepared - Keith Matthews
  39. Linear Algebra and Applications Textbook - Thomas S. Shores
  40. Visual Linear Algebra for Maple and Mathematica -
  41. Differential Equations With Boundary Value Problems - Selwyn Hollis
  42. Elementary PDEs and Applications - Björn Birnir,

Wednesday, 6 July 2011

Friday, 1 July 2011

SYLLABUS MCA 5th SEMESTER | GTU MCA MATERIAL | Image Processing (IP) (Elective-III)

GUJARAT TECHNOLOGICAL UNIVERSITY
MASTER OF COMPUTER APPLICATIONS (MCA)
SEMESTER: V

Subject Name: Image Processing (IP) (Elective-III)
Subject Code: 650011

Objectives:
The objective of this course is to
• Provide an introduction to basic concepts and methodologies for digital image processing,
and to develop a foundation that can be used as the basis for further study and research in this
field.
• Provide understanding of the different types of image representations, enhancing image
characteristics, image filtering, and reducing the effects of noise and blurring in an image.
Prerequisites:
Knowledge of Computer Graphics is desirable.
Contents:
1. Introduction [5 hrs]
Image Processing, The origins of Digital Image Processing, Examples of Fields that use
Digital Image Processing, Fundamentals Steps in Digital Image Processing, Components
of an Image Processing System.
2. Digital Image Fundamentals [7hrs]
Elements of Visual Perception, Light and the Electromagnetic Spectrum, Image Sensing
and Acquisition, Image Sampling and Quantization, Some Basic Relationship between
Pixels, An Introduction to the Mathematical Tools Used in Digital Image Processing
3. Intensity Transformation and Spatial Filtering [7hrs]
Background, Some Basic Intensity Transformation Functions, Histogram Processing,
Fundamentals of Spatial Filtering, Smoothing Spatial Filters, Sharpening Spatial Filters
4. Filtering in the Frequency Domain [12 hrs]
Background, Preliminary Concepts, Sampling and the Fourier Transform of Sampled
Functions, The Discrete Fourier Transform (DFT) of One Variable, Extension to
Functions of Two Variables,, Some Properties of the 2-D Discrete Fourier Transform,
The Basics of Filtering in the Frequency Domain, Image Smoothing Using Frequency
Domain Filters, Image Sharpening Using Frequency Domain Filters.
5. Color Image Processing [5 hrs]
Color Fundamentals, Color Models, Pseudocolor Image Processing, Basics of Full-Color
Image Processing, Color Transformations, Smoothing and Sharpening.
6. Image Compression [7hrs]
Fundamentals, Some Basic Compression Methods (Huffman Coding, Arithmetic Coding,
LZW Coding, Run-Length Coding, Block Transform Coding).
7. Image Segmentation [5hrs]
Fundamentals, Thresholding, Point, Line and Edge Detection.

Text Books:
1) Rafael C. Gonzalez and Richard E. Woods, “Digital Image Processing”, 3rd Edition,
Pearson Education.
2) Rafael C. Gonzalez, Richard E. Woods and Steven L. Eddins, “Digital Image Processing
Using MATLAB”, 2nd Edition, Tata McGraw Hill Education

Reference Books:
1) Sonka, Hlavac,Boyle , “ Digital Image Processing and Computer Vision”,CENGAGE
Learning
2) B. Chanda and D. Dutta Majumder, “Digital Image Processing and Analysis”, PHI
Publication.
3) Madhuri A. Joshi, “Digital Image Processing – An Algorithmic Approach, PHI
Publication.
Chapter wise coverage from the Text Books:
Book Chapters
1
1(1.1 – 1.5), 2(2.1 – 2.6), 3(3.1 – 3.6), 4(4.1 – 4.9), 6(6.1 – 6.6), 8(8.1,8.2(8.2.1,8.2.3 –
8.2.5, 8.2.8)), 10(10.1 – 10.3)
Accomplishment of the student after completing the course:
At the end of the work student will be able to
• Use histogram processing techniques; introduce fuzzy set theory and its application to
Image Processing.
• Deal with frequency domain and data compressing.

GTU MATERIAL | SYLLABUS MCA 5 th SEMESTER | Geographical Information Systems (GIS) (Elective-III)

GUJARAT TECHNOLOGICAL UNIVERSITY
MASTER OF COMPUTER APPLICATIONS (MCA)
SEMESTER: V

Subject Name: Geographical Information Systems (GIS) (Elective-III)
Subject Code: 650013

Course Objectives:
A Geographic Information System (GIS) is composed of data collection, management and visualisation
tools that allow users to manipulate all forms of spatial data. The main objective of the course is to give a
basic theoretical and practical understanding of GIS concepts and technical issues.
By completing the course the student will
• have a basic, theoretical and practical understanding of GIS, and
• be able to work independently with various types of geographical data in GIS.
Pre-requisites:
Knowledge of Database Management, Data Computation, Basic Knowledge of Statistical Methods.
Contents:
Unit – 1 – Introduction to GIS and Digital Geographic Data & Maps [12 Lectures] [25%]
Introduction to Digital Geographic Data:
Introduction to Geographic Information Systems, Spatial Measurement, Spatial Location and Reference, Spatial
Patterns, Geographic Data Collection
Map Basics:
Abstract Nature of Maps, Map Scale, More Map Characteristics, Map Projection, Grid Systems for Process, Map
Symbolism
GIS Data Models:
Computer File Structure, Database Structure, Graphic Representation of Entities and Attributes, GIS data Models
for Multiple MAPS,
Unit – 2 – Input, Storage and Editing [08 Lectures] [15%]
The Input Subsystem:
Primary Data, Input Devices, Vector Input, Raster Input, Remote Sensing Data Input, GPS Data Input, Metadata
and Metadata Standards.
Data Storage and Editing:
Storage of GIS Databases, Detecting and Editing Errors of Different Types, Dealing with Projection Changes,
Edge Matching, Rubber Shitting.
Unit – 3 – Analysis [25 Lectures] [50%]
Elementary Spatial Analysis:
GIS Data Query, Defining Spatial Characteristics, Working with Higher – Level Objectives
Measurement:
Measuring Length of Linear Objectives, Polygons, Shape and Distance
Classification:
Classification Principal, Elements of Reclassification, Neighborhood Functions, Roving Windows, Buffers
Statistical Surfaces:
Surface Mapping, Sampling the Statistical Surface, The DEM, Raster Surface, Interpolation, Terrain
Reclassification, Slicing the Statistical Surface, Cut and Fill
Spatial Arrangement
Point, Line and Area Arrangement, Point Patterns, Thiessen Polygons, Area Patterns, Distance and Adjacency,
Polygon Arrangement Measures, Linear Patterns, Directionality of Linear and Areal Objective, Connectivity of
Linear Objects, Gravity Model, Routing and Allocation, The Missing Variables
Comparing Variables Among Maps:
The Cartographic Overlay, Point-in-Polygon, Line-in-Polygon, Polygon Overlay, Automating the Overlay, Types
of Vector Overlay, CAD-Type Overlay, Dasymetric Mapping
Cartographic Modeling:
Model Components, The Cartographic Models, Types of Cartographic Models, Inductive and Deductive
Modeling, Factor Selection, model Flowcharting, Model implementation, Model Verification
Unit – 4 – GIS Output [05 Lectures] [10%]
The Output from Analysis:
Output: The Display of Analysis, Cartographic Output, The Design Process, Map Design Controls,
Noncartographic Output

Text Book:
1. Michael N DeMers, “Fundamentals of Geographic Information Systems”, Wiley India Education

Reference Books:
1. Kang-tsung Chang, “Introduction to Geographic Information Systems”, McGraw-Hill Publication
2. YEUNG, ALBERT K. W., LO, C. P., “Concepts and Techniques of Geographic Information
Systems”, PHI Learning

SYLLABUS MCA-5th SEMESTER - GTU MATERIAL | Bioinformatics (Bio-I) (Elective-III)

GUJARAT TECHNOLOGICAL UNIVERSITY
MASTER OF COMPUTER APPLICATIONS (MCA)
SEMESTER: V

Subject Name: Bioinformatics (Bio-I) (Elective-III)
Subject Code: 650015

Objective:
• Use of information technology to accomplish the challenges in the field of Biology
Prerequisites:
Knowledge of DBMS, Data Structure, Unix/Linux, Scripting Languages
Contents:
Unit 1: Introduction of Bioinformatics:
Biology in the Computer Age, Computational Approaches to Biological Questions
Unit 2: Tools for Bioinformatics:
Biological Research on the Web, Sequence Analysis, Pairwise Alignment and Database Searching,
Multiple Sequence Alignments, Trees, and Profiles
Unit 3: Protein Structure and Prediction:
Visualizing Protein Structures and Computing Structural Properties, Predicting Protein Structure and
Function from Sequence, Tools for Genomics and Proteomics
Unit 4: Databases and Visualization:
Building Biological Databases, Visualization and Data Mining (20%)
Text Book:
(An introduction to Software Tools for Biological Applications)
Cynthia Gibas & Perl Jambeck, “Developing Bioinformatics Computer Skills”, O’Reilly Publications
Chapter wise Coverage:
Unit 1: Chapters 1, 2
Unit 2: Chapters 6, 7, 8
Unit 3: Chapters 9, 10, 11
Unit 4: Chapter 13, 14
Reference Books:
1. Orpita Bosu & Simminder Kaur Thukral, “BIOINFORMATICS Databases, Tools and Algorithms”,
Oxford Publications
2. Jean-Michel Claverie & Cedric Notredame, “Bioinformatics – A Beginner’s Guide”, Wiley
Publications
3. Zhumar Ghosh & Bibekanand Mallick, “BIOINFORMATICS Principles and Applications”, Oxford
Publications
4. Kenneth Baclawski and Tianhua Niu, “Bioinformatics”, JAICO BOOKS Publications
Accomplishments of Students:
• Learn to create Biological database of available sequences
• Learn how to search for similar sequences
• Learn the concept of available computerized biological databases & Software tools
• Learn how to visualize the architecture of a biological input data
• Learn the need for sequence analysis
• Understanding of tools for Identification, Prediction, Visualization and Pattern Matching from
biological sequences and structure pf proteins
• Can classify the structure of protein with the help of available software tools
• Learn how to develop the tools for pattern matching from available sequences
• Able to develop software for data transfer into biological database and execution of tools
Suggested Continuous Evaluation Components (CEC):
A. Tools and Applications:
1. Learning of Specialized languages, available to support bioinformatics like Biojava, Bioperl, Biocorba,
BioXML, Bioruby, Biopython and open source like BSML (Bioinformatics Sequence Markup
Language)
2. Constructing biological databases : Design and build a Database of biological sequences for any
organization or research group
3. Preprocess and visualize Biological data
4. Explanation of Protein Modeling Project
5. Improving diagnosis, screening and drug discovery through bioinformatics
6. Discovering evolutionary relationship between sequences
7. Accessing Genome Information the Web
8. Building phylogenetic trees
9. Networks and pathway visualization
10. Annotating and Analyzing Whole Genome Sequences
11. Bioinformatics applications in the field of
• DNA fingerprinting
• DNA chip (Microarray) technology
• Single Nucleotide Polymorphism
• Drug discovery
• Simulation of Biological problems
• Development of diagnostic techniques based on genetic background
• Personalized Medicine
B. Case study on:
• The Whole human genome project
• Genome sequencing of living organisms
• Efficient utilization of PubMad for Bioinformatics
• Hybrid technologies for helping the farmers with Bioinformatics
• Identification of disease pattern from sequences
• Animal tissue engineering using Bioinformatics
• Grid based resources for Bioinformatics
C. Laboratory Exercise
• Development of Data Warehouse for biological databases
• Developing Web-Based Software that interacts with databases
• Development of tools based on data mining techniques for pattern recognition from sequences
• Development of software for sequence conversion from one database form to another
• Development of sequence submission tool to the database
• Microarray Database creation and its management
• Identification of Single Nucleotide Polymorphism
• Identification of structure from sequences
• Identification and recognition of mutation from database
• Development of sequence comparison tools
• Development of Grid for bioinformatics
• Development of Structure Prediction tools
• Write a programs for DNA:
o DNA Replication
o DNA Transcription
o DNA Translation
o For given DNA sequence, find start codon and stop codon

Wireless Sensor Network (WSN) (Elective-II)

GUJARAT TECHNOLOGICAL UNIVERSITY
MASTER OF COMPUTER APPLICATIONS (MCA)
SEMESTER: V

Subject Name: Wireless Sensor Network (WSN) (Elective-II)

Subject Code: 650007

Learning Objectives:
• Learn the basics of Wireless Sensor Network
• Understand the applications of WSN
• Understand the enabling technology of WSN
• Get overview of various WSN protocol
• Look at performance issues of WSN
Prerequisites: Basic fundamentals of networking
Contents:
1. Overview of Wireless Sensor Network [5%]
Background of Sensor Network Technology, Sensor Network Architectural Elements,
Historical Survey of Sensor Networks
2. Applications of Wireless Sensor Network [5%]
Range of Applications, Examples of Category 1 and 2 WSN Applications
3. Technologies for Wireless Sensor Network [10%]
Sensor Node Technology, Hardware and Software, Sensor Taxonomy, Wireless Network
Operating Environment, Wireless Network Trends, Transmission Technology
4. Wireless Sensors Networks Protocols [40%]
Medium Access Control Protocols, Routing Protocols, Transport Control Protocols
5. Middleware for Sensor Networks & Network Management [20%]
Middleware Principles, Middleware Architecture, Existing Middleware, Network Management
Requirements, Network Management Models, Design Issues
6. Operating Systems & Performance and Traffic Management Issues [20%]
Operating System Design Issues, Examples of Operating Systems, WSN Design Issues,
Performance Modeling

Text Book:
1. Kazem Sohraby, Daniel Minoli, Taieb Znati., “Wireless Sensor Networks: Technology,
Protocols, and Applications”, Wiley Student Edition

Reference Books:
1. Feng Zhao & Leonidas Guibas, “Wireless Sensor Networks, An Information Processing
Approach”, Morgan Kaufmann
2. Jun Zheng, Abbas Jamalipour, “Wireless Sensor Networks: A Networking Perspective”,
Wiley
3. Ian F. Akyildiz, Mehmet Can Vuran, “Wireless Sensor Networks”, Wiley
4. Waltenegus Dargie, Christian Poellabauer, “Fundamentals of Wireless Sensor Networks:
Theory and Practice”, Wiley
Chapter wise Coverage from the Text Book:
Unit-1 (Chapter-1 – Topics 1.1 except (1.1.3), 1.2)
Unit-2 (Chapter-2 – Topics 2.1 to 2.5)
Unit-3 (Chapter-3 – Topics 3.1 to 3.5), (Chapter-4 – Topics 4.1 to 4.3)
Unit-4 (Chapter-5 - Topics 5.1 to 5.6), (Chapter-6 - Topics 6.1 to 6.5),
(Chapter-7 - Topics 7.1 to 7.4)
Unit-5 (Chapter-8 - Topics 8.1 to 8.4), (Chapter-9 - Topics 9.1 to 9.6)
Unit-6 (Chapter-10 - Topics 10.1 to 10.3), (Chapter-11 - Topics 11.1 to 11.5)
The CEC for this subject will include downloading of different open source simulators like:
1. Omnet++
2. NS2
The goal is to familiarize yourself with the OMNET++/NS2 network simulation environment,
especially when it is used to simulate wireless sensor network.
1. Developing a simple Tic-Toc application using OMNET++/NS2
2. Compare the features of NS2 & Omnet++
3. Try to develop a small project that gives idea about a WSN node properties such as CPU usage,
battery life, sleep time, power consumption.

Tuesday, 8 March 2011

GTU BOOKS

WELCOME TO THE FST BOOKSTORE Purchasing Books for Classes:
WELCOME TO THE FST BOOKSTORE Purchasing Books for Classes: The GTU no longer has an arrangement with Cal Student Store for the purchase of textbooks.
www.fst.edu/pdf_fst/Bookstore.pdf
Download | Quick View

Gujarat Technological University Ahmedabad
Gujarat Technological University, Ahmedabad - MBA Programme GTU/Syllabus_MBA/09-10 ... Basic Text Books: T1 . Ambrish Gupta - Financial Accounting for Management : An ...
mba.spcevng.ac.in/WebsitePDF/Syllabus.pdf
Download | Quick View

GRANTS TO YOU (GTU)
GRANTS To You (GTU) Operating a Chapter Overview: Success in operating a Grants To You ... If such is the case, all restricted funds and related liabilities on the books of the ...
www.grantstoyou.org/PDF/Operating_A_Chapter103105.pdf
Download | Quick View

WISDOM AND DEUTEROCANONICAL BOOKS
WISDOM AND DEUTEROCANONICAL BOOKS OT 2604 Instructor: John Endres, S.J. Spring 2010 JSTB ... REQUIRED TEXTS (available in the GTU Bookstore) Ceresko, Anthony. Introduction to ...
www.scu.edu/jst/students/syllabi/upload/OT2604.pdf
Download | Quick View

Marion Grau
Marion Grau Church Divinity School of the Pacific/Graduate Theological Union 2451 Ridge Road ... Scholarship Books In Progress World Without End: A Constructive Theology of ...
cdsp.edu/docs/Grau_2009.pdf
Download | Quick View

INFORMATION SOURCES
Biblical Resources Tutorial : Graduate Theological Union http://library.gtu.edu/tutorials ... STRONG'S CONCORDANCE AND ALLIED BOOKS: When James Strong finished his ...
www.evangel.edu/Library/Subject/Exegesis.pdf
Download | Quick View

GUJARAT TECHNOLOGICAL UNIVERSITY
Reference Books: 1) Title :Surveying Vol .I & II Author: Dr. B. C. Punamia Publisher : Laxmi Publication Delhi 2) Title :Surveying Vol. I and II Author : S. K. Duggal ...
www.charusat.ac.in/Download/GTU_BE_Civil_First_Year.pdf
Download | Quick View

CURRICULUM VITAE
... University, 1990-91 Newhall Faculty Research Grant, GTU, 1989-1990 Graduate Theological Union ... Scholarly Work Books *Go and Do Likewise: Jesus and Ethics (New York: ...
www.scu.edu/cas/religiousstudies/facultystaff/Regular/spohn/upload/Spohn-CV.pdf
Download | Quick View

Orthodox Institute
It hosts the Orthodox Christian Fellowship for University of California, Berkeley and the Graduate Theological Union. It publishes and markets books through its ...
orthodoxinstitute.org/files/annualreport2003_2004.pdf
Download | Quick View

Generation X Spirituality SP 2030 Tuesdays, 2:10-5:00 Fall, 2002
(Weeks IX-XIII) Week Nine: November 5 Oral Book Reviews Week Ten: November 12 Presentations of Prayer Beads and Prayer Books Week Eleven: November 19 Meet in Computer GTU ...
courseweb.fst.edu/pryds/courses/genx.pdf
Download | Quick View

GTU BOOKS

HTML ___ praqtikuli saxelmZRvanelo damwyebTaTvis
Iron and gold, oil and diamands will be exhausted one day. Knowledge never will. Though books are burned, what is written in them is never lost.
24
www.gtu.ge/books/HTML_Tea_Todua.pdf
Download | Quick View

Gujarat Technological University
Gujarat Technological University GTU Instructions for assessment of answer books No: Gtu/Inst/Examiner Nov-Dec 10-Jan-Feb 11/6931 Date: 27-11-2010 1.
gtu.ac.in/circulars/10Nov/GTU_instructions.pdf
Download | Quick View

P H P 4
2 uak 681.3.06 ganxilulia serveris mxareze daprogramebisaTvis gankuTvnili specializebuli ena PHP-is bazisuri saSualebani. gankuTvnilia informatikis da marTvis sistemebis ...
www.gtu.ge/books/g_RvinefaZe_PHP.pdf
Download | Quick View

GUJARAT TECHNOLOGICAL UNIVERSTITY
... exam day Zonal officer Rs. 200/- per exam session Rs. 250/- per exam session Gtu coordinator Rs. 125/- per exam session Rs. 150/- per exam session Handling os Answer Books By ...
www.gtu.ac.in/Honorarium/Honorarium_100614.pdf
Download | Quick View

Explaining Economics from a Values Perspective
... Economics of Provision 4 Joel Schalit: Arab-Israeli Conflict 5 Mistie Shaw: China Lifeline 6 Janet Ruffing: Spirituality 8 Jewish Students Back from Poland 10 GTU News 11 New Books " " I n ...
www.gtu.edu/news-events/currents/fall-2010/Currents%20Fall%202010.pdf
Download | Quick View

VNSGU Revised Syllabus (as per GTU) B.E Semester: 3 ...
Reference Books: 1. Integrated Electronics By Jacob Millman and Christos C. Halkias, Tata McGraw Hill Publication 2. Electronics Devices by Floyd , Pearson ...
scet.ac.in/uploads/Documents/Buffer/II-GTU-IC.pdf
Download | Quick View

THE BIBLE IN THE ARTS SEMINAR
The GTU Library will be frequently used, not only for the reference books found there, but also for its computer lab and media facilities. Students will be expected to ...
www.dspt.edu/dspt/lib/dspt/_shared/pdfs/Faculty/Morris_RABS5510.pdf
Download | Quick View

PAOI's First "Summer Institute" a Success
Dr. Anton Vrame delivered a paper in Volos, Greece to an international symposium It took less than one week to move nearly 6,000 PAOI books to the GTU Library Published by the ...
orthodoxinstitute.org/files/june04.pdf
Download | Quick View

gia surgulaZe, marina kaSibaZe
2 uak 681.3.06 gadmocemulia korporaciuli marTvis sistemebSi biznes-procesebis unificirebuli modelirebis da analizis, monacemTa bazebis obieqt-orientirebuli daproeqtebis ...
www.gtu.edu.ge/books/GiaSurg%20OrgSysManag.pdf
Download | Quick View

Syllabus of BE - Sem _ I : Gujarat Technological University ...
Microsoft Word - GTU Syllabus ... Reference Books: I Electrical Technology Vol.1 By B. L.Theraja II ...
ldrp.ac.in/GTU%20Syllabus.pdf
Download | Quick View

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);
 }

GTU C PROGRAM | SELECTION SORT PROGRAME

C.........

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

----------------------------------------------------------------------------
C++.........

// SELECTION SORT
# include<iostream.h>
#include <stdio.h>
#include <stdlib.h>
 class selection
      {
       private:
  int temp, current, j;
       public:
  void selection_sort(int *, int);
  void display(int *, int );
 };
   void selection :: selection_sort(int array[], int size)
   {
   for (current = 0; current < size; current++)
    for (j = current + 1; j < size; j++)
      if (array[current] > array[j])
 {
   temp = array[current];
   array[current] = array[j];
   array[j] = temp;
 }
  }
     void selection :: 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)
 {
   selection sort;
   int list[30];
   int number;
   cout<<"\n Input the number of the elements:";
   cin>>number;
   for (int i = 0; i < number; i++)
      {
 cout<<"\n Input the values for | "<<i+1<<" | ";
 cin>>list[i];
      }
       sort.selection_sort(list, number);
       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