Saturday, 8 June 2013

Tokens, Expressions and Control Structures


Tokens

We know that the smallest individual unit in a program is known as token. C++ has the following tokens :-

  • Keywords
  • Identifiers
  • Constants
  • Strings
  • Operators

Keywords

The keywords implement specific C++ language features. They are explicitly reserved identifiers which cannot be used as names for the program varibales or other user-defined program elements.

Given below is the list of the keywords used in C++ , many of which are common to the keywords of C.

  • asm                                                      
  • auto
  • break
  • case
  • catch
  • char
  • class
  • const
  • continue
  • default
  • delete
  • do
  • double
  • else
  • enum
  • extern
  • float
  • for
  • friend
  • goto
  • if
  • inline
  • int
  • long
  • new
  • operator
  • private
  • protected
  • public
  • register
  • return
  • short
  • signed
  • sizeof
  • static
  • struct
  • switch
  • template
  • this
  • threw
  • try
  • typedef
  • union
  • unsigned
  • virtual
  • void
  • volatile
  • while
  • bool
  • const_cast
  • dynamic_cast
  • explicit
  • export
  • false
  • mutable
  • namespace
  • reinterpret_Cast
  • static_Cast
  • true
  • typeid
  • typename
  • using
A major difference between C and C++ is the limit on the length of a variable length. While ANSI C recognises only the first 32 characters of a name, ANSI C++ places no limit on the length of the name.

Constants refer to fixed values that do not change during the course of execution of the program.

Data Types

Data types in C++ can be broadly categorised into three types :-
  •  User Defined
  • Built In
  • Derived Data type
 Thats all the concept for today and now we put the answers to yesterday's problems.

Answers to problems in post 7.

The Questions we had were :-
Q1. Write a program to display the following output using a single cout statement.

•Maths = 90
...•Physics = 77
•Chemistry = 80.
Q2. Write a program to read two numbers from keyboard and display the larger value on the screen.

Q3. Write a program to read the values of a,b and c and display the value of x, where

x = a/b-c
Test your program for the following set of values :-

i) a=250, b=85, c=25;
ii) a=300, b=70, c=70.

Q4. Write a C++ Program that will ask for a temperature in Fahrenheit and diplay its corresponding temperature in Celsius.

And we have the solutions

Question 1 ( Input Cascading concept)

#include<iostream>

using namespace std;

int main()
{
cout<<"Maths= 90"<<"\n"<<"Physics= 77"<<"\n"<<"Chemistry= 80"<<"\n";

return 0;
}.


Question 2 (If else statement)

#include<iostream>

using namespace std;

int main()
{
int number1, number2;

cout<<"\nEnter the first number : ";
cin>>number1;

cout<<"\nEnter the second number : ";
cin>>number2;

if(number1>number2)
cout<<"\nThe greater number = "<<number1<<"\n";

else if (number2>number1)
cout<<"\nThe greater number = "<<number2<<"\n";

else
cout<<"\nBoth the numbers are equal."<<"\n";

return 0;
}


Question 3 (Simple Input/Output with variable)

#include<iostream>
using namespace std;

int main()
{

int a,b,c,x;

cout<<"\nEnter the values of a, b, c : ";
cin>>a>>b>>c;

x=a/b-c;

cout<<"\nThe value of x is = "<<x<<"\n";

return 0;

}


Question 4 ( Implementing the formula)

#include<iostream>

using namespace std;


int main()
{
float tempf, tempc=0 ;

cout<<"Enter the temperate in Fahrenheit: ";
cin>>tempf;

tempc = (tempf-32)*5/9;

cout<<"The Celsius equivalent temperature is : "<<tempc;

return 0;

}.


Assignment for today :-
Try to find out the number of keywords which you find are common between C and C++.

Thursday, 6 June 2013

Some more C++ Sample programs



Sample program which takes in variables and input statements

We will read two numbers from the keyboard and display the average on the screen. A sample C++ program for this purpose is given below


C++ Program to calculate the average of two numbers

#include<iostream>

using namespace std;

int main()
{

          float number1, number2, sum , average;        //Declaring the variables as float datatype
          cout<<"Enter the two numbers : ";                // String displayed on screen asking for two inputs
          cin>>number1;                                              //Reading Input 1 from the keyboard
          cin>>number2;                                              //Reading Input 2 from the keyboard

         sum=number1 + number2;                            //Calculating the sum of two numbers
         average = sum/2;                                           //Calculating the average of two numbers

         cout<<"Sum = " <<sum<<"\n";                    //Displaying the sum
         cout<<"Average of two numbers = "<<average<<"\n";      //Displaying the result of the average

         return 0;
}
        

The output of this program would be something like this :-

Output of the above program

 

Variables

This program uses four variables number1, number2, sum and average. They are declared as float type by the statement
 
  float number1, number2, sum, average;
 
All variables must be declared before they are used in a program.
 

Input Operator

The statement - cin>>number1;

is an input statement and causes the program to wait for the user to type in a number. The number keyed in is placed in the variable number1. The identifier cin is a predefined object in C++ that correspons to the standard input stream.

The operator >> is known as extraction or get from operator. It extracts or takes the value from the keyboard and assigns it to the variable on its right.

Cascading of Input/Output Operators

We have used the insertion operator <<repeatedly in the last two statements for printing results.

The statement
cout<<"Sum ="<<sum<<<<"\n";

first sends the string "Sum=" to cout and then sends the value of sum. Finally it sends the newline character so that the next output wil be in the new line. The multiple use of << in one statement is called cascading. When cascading an output operator , we should ensure necessary blank spaces between different items. Using the cascading technique the last two statements can be combined as follows :-

cout<<"Sum="<<sum<<"\n"<<"Average= "<<average<<"\n";

We can cascade the input operator as well

cin>>number1>>number2;

Note :-  The values are assigned from left to right. That is if we key in two values, say 10 and 20, then 10 will be assigned to number1 and 20 will be assigned to number2.


An example with class

One of the major functions of C++ is classes. They bind the functions which operate on them. Like structure in C , classes are user defined data types.

The following program shows the use of a class in a C++ program.

#include<iostream>

using namespace std;

class person
{
               char name[30];
               int age;
              public :
                         void getdata(void);
                         void display(void);
};

void person::getdata(void)
{
            cout<<"Enter the name of the person: ";
            cin>>name;
            cout<<"\nEnter age of the person: ";
            cin>>age;
}

void person::display(void)
{
            cout<<"\nName = "<<name<<"\n";
            cout<<"\nAge= "<<age<<"\n";
}

int main()
{
             person p;
             p.getdata();
             p.display();
             return 0;
}


Analysis of the program

This program defines person as a new data of type class. The class person includes two basic data type items and two functions to operate on that data. These functions are called member functions. The main program uses person to declare variables of its type. As said earlier class variables are known as objects. Here , p is an object of type person. Class objects are used to invoke the functions defined in that class.

Note :- cin can read only one word and therefore we cannot uses blank spaces to write a full name.

Assignments on the concepts learnt today :-

Q1. Write a program to display the following output using a single cout statement.

  • Maths = 90
  • Physics = 77
  • Chemistry = 80.
Q2. Write a program to read two numbers from keyboard and display the larger value on the screen.

Q3. Write a program to read the values of a,b and c and display the value of x, where

            x = a/b-c
Test your program for the following set of values :-

i) a=250, b=85, c=25;
ii) a=300, b=70, c=70.

Q4. Write a C++ Program that will ask for a temperature in Fahrenheit and diplay its corresponding temperature in Celsius.

Please try doing all the programs yourself if u face any problem do use the comment section.

Answers for all these problems will be posted tommorow.

 

Wednesday, 5 June 2013

Beginning with C++

 

A Bit about C++

C++ is an object oriented programming language. It was developed by Bjarne Stroustrup at AT&T Bell Laboratories in Murray Hill, New Jersey, USA in the early years of 1980's.

Since the language is an extension of the language C with the major addition being the class construct feature Stroustrup called the new language "C with classes" however in 1983 the name was changed to C++, the idea of C++ coming from the increment operator ++, thus bringing the logic that C++ is an incremented version of language C.

A Simple C Program

Let us begin with a simple example of a C++ prorgam that prints a string on screen.

#include<iostream>                 //Including the header file

using namespace std;

int main ()                                   //Main function
{

      cout<< "Hello World.\n";    //C++ statement to print the string "Hello World"
     
      return 0;                               // we have taken int main() hence we have to return an integer value
}                                                // End of Program.

Analysing the program

Like C, the C++ program is also a collection of functions. In the above example we have only one function i.e the main() . As usual execution of any program begins at main(). Every C++ program will have a main() . Like C , the statements in C++ end with a semicolon (;) .

Comments

Comment symbol is  // (double slash) for single line comments and for multi line comments we use
/*

*/

Similar to C programming.

Output operator

The only statement in the above program is an output statement.

The statement

cout<<"Hello World\n";
causes the string contained within the quotation marks to be displayed on the screen.

We find two new C++ features here 'cout' and '<<' . The identifier "cout" is a predefined object that represents the standard output stream in C++.

The operator "<<" is called the insertion or put to operator. It inserts or sends the contents of the variables on its right to the objects on the left.

Note :-   C++ also supports printf() for displaying an output but we will use the standard C++ notation i.e cout.

Header File

We have used the #include directive in the program :

#include<iostream>

This directive causes the preprocessor to add the contents of the iostream file to the program. It contains the declarations for the identifier cout, cin and the operators << .

The header files iostream should be included in the beginning of all programs that use input/output statements and as practically all programs use I/O statements so using iostream.h is compulsory.

Common Header Files

1. ctype.h - Contains function prototypes for functions to test characters for certain properties and prototypes for function that can be used to convert lowercase letters to uppercase letters and vice versa.

2. float - Contains the floating point size limits of the system.

3. limits - Contains the integral size limits of the system.

4. math - Contains function prototypes for math library functions.

5. string - Contains function prototypes for C style string processing functions.

6. stdlib - Contains function prototypes for conversion of numbers to texts, text to numbers, memory allocation, random numbers and various other utility functions.

7. time - Contains function prototype and types for manipulating the current system time and date.

8. iomanip - Contains function prototypes for stream manipulators that enable formatting of streams of data.

9. fstream - Contains function prototype for functions that perform input from files on disk and output to files on disk.

10. iostream - Contains standard prototype functions for standard input and output functions.

Return type of main ()

In C++, main() returns an integer type value to the operating system. Therefore every main() should ed with a return 0 statement; otherwise a warning or error might occur. Since main() returns an integer type value, return type is specified as int. The default type for all functions in C++ is int.

Try making some more programs to practise things learnt today and print some more strings. We will be back tommorow with some more programs to understand the input operator, variables and some more concepts of C++.

Thats all for today friends do post your comments below for sending us your feedback.

 

Tuesday, 4 June 2013

Basic Concepts of Object Oriented Programming in Details

 

         1. OBJECTS

Objects are the basic run time entities of an object oriented programming system.  They may represent a person, a place, a bank account, a table of data of any item that the program has to handle. A programming problem is analysed in terms of objects and the nature of communication between them. Objects take up space in the memory and have an associated address similar to what structures are in C.
When a program is executed the objects interact by sending messages to one another .
For example :- If  "Customer" and "Bank Account" are two Objects in a program, then the customer object sends a message to the account object requesting for the bank balance.
Each object contains data, and code to manipulate the data. Objects can interact without having to know the details of each other's data or code. It is sufficient to know the type of message accepted and the type of response recieved by the object.

    2.  CLASSES

We know that objects contain data, and the required code to manipulate the data. The entire set of data and code of an object can be made a user-defined data type with the help of a class. In fact, objects are variables of the type class. Once a class has been defined, we can create a number of objects belonging to that class. Each object is associated with the data of type class with which they are created. 
A class is thus a collection of objects of similar type.
For example :- mango, apple and orange are members of the class fruit. Classes are user defined data types and behave like the built in type of a programming language. 
If fruit has been defined as a class then the syntax for creating an object is
fruit mango;
//This will create an object mango belonging to the class fruit

    3. DATA ABSTRACTION AND ENCAPSULATION 

Wrapping up of data and functions into a single unit (known as class) is known as       encapsulation. Data encapsulation is the most striking feature of a class. The data is not accessible to the outside classes, only those functions which are wrapped in the class can access the data. This insulation of the data from direct access by the program is called data hiding or information hiding.
Abstraction refers to the act of representing essential features without including the background details or explanations. Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, weight, and functions to operate these attributes. They encapsulate all the essential properties of the object that are to be created. The attributes are sometimes called data members because they hold information. The function that operate on these data are called methods or member functions.
Since classes use the concept of data abstraction they are known as Abstract Data Types (ADT).
 

       4. INHERITANCE

Inheritance is the process by which objects of one class acquire the properties of objects of another class. It supports the concept of hierarchical classification. For example, the bird "robin" is a part of the class 'flying bird' which is again part of the class 'bird'. The principle behind this sort of division is that each derived class shares common characteristics with the class from which it is derived.
In OOP, the concept of Inheritance provides the idea of reusability. This means that we can add additional features to an existing class without modifying it. The real appeal and power of inheritance mechanism is that it allows the programmer to reuse a class that is almost, but not exactly what he wants, and to tailor the class in usch a way that it does not introduce any undesirable side effects into the rest of the classes.

      5. POLYMORPHISM

Polymorphism is another important concept of OOP. Polymorphism is a Greek term which means the ability to take more than one form. An operation may exhibit different behaviours in different instances. The behaviour depends upon the type of data used in the the operation. The process of making an operator to exhibit different behaviours in different instances is known as operator overloading.
Polymorphism plays an important role in allowing objects having different internal structures to share same external interface. This means that a general class of operation may be accessed in the same manner even though specific action associated with each operation may differ. Polymorphism is extensively used to implement inheritance.

      6. DYNAMIC BINDING

Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding also known as late binding means that the code associated with a given procedure call is not known until the time of the call at run time. It is associated with polymorphism and inheritance. A function call assocaited with a polymorphic reference depends on the dynamic type of that reference.
For example the procedure "Answering" . By inheritance every object "Student" will have this procedure however individual algorithms for each class will have different answers for the same procedure.

     7. MESSAGE PASSING

An object oriented program consists of a set of objects that communicate with each other. The process of programming in an OOP Language therefore involves the following basic steps :-
  1. Creating classes that define objects and their behaviour
  2. Creating objects from class definitions and
  3. Establishing communication between objects.
Objects communicate with one naother by sending and recieving information much the same way people pass messages to one another. The concept of message passing makes it easier to talk about building systems that directly model or simulate their real world counterparts.
The message for an object is a request for execution of a procedure, and therefore will invoke a function in the recieving object that generates the desired result. Message passing involves specifying the name of the object, the name of the funtion and the information to be sent.
 

APPLICATION OF OOP

  • Real time systems
  • Simulation and modelling
  • Object Oriented databases
  • Hypertext, hypermedia and expertext
  • AI and expert systems
  • Neural networks and parallel programming
  • Decision support and office automation systems
  • CIM/CAM/CAD systems.
 
Tommorow we will learn about the various Header files of C++ and the basic input/output commands and also write our first C++ Program so do visit again tommorow.
Thank for visiting the page.
     

     

Monday, 3 June 2013

Need for Object Oriented Programming

Object Oriented Programming

 
Why do we need Object Oriented Programming. To answer this question we first need to find out the drawbacks that was faced in Procedure Oriented Programming Languages ( C, FORTRAN, COBOL) . 
 
Procedure Oriented Programming Languages consist of a list of instructions organised into groups called functions. Functions are executed sequentially as per the instructions but little attention is paid to the globally declared data which is accessed by mutliple functions at a time in a multi-functional program. If we need to change a particular value of a variable we have to make changes to all the functions hence the data becomes vulnerable to change in case of multi-functional programs.
 
 
Some of the features of Procedure Oriented Programming are:-
  1. Large programs are divided into smaller programs known as functions.
  2. Most of the functions share common global data.
  3. Data moves freely around the system from function to function.
  4. Functions transform data from one form to another.
  5. Employs top-down approach in program design.
Object Oriented Programming(OOP)
 
One of the most salient feature of OOP is that it treats data as a critical element in the program development and does not allow it to move freely around the system. It ties the data more closely to the functions that operate on it, and protects it from accidental modifications from outside functions. OOP allows the decomposition  of a problem into a number of entities called objects which comprise of data and functions exclusively.The data of one object can be accessed only by the functions associated with that object. However functions of one object can access the functions of other objects.
 
Example of Object Oriented Programming Languages are :- C++ , Java , etc.
 
Features of Object Oriented Programming
  1. Emphasis is on data rather than the procedure.
  2. Programs are divided into objects.
  3. Functions that operate on the data of an object are tied together un the data structure.
  4. Data is hidden and cannot be accessed by external functions.
  5. Objects may communicate with each other through functions.
  6. New data and functions can be added easily whenever necessary.
  7. Follows bottom-up approach.
Definition of OOP
 
Object Oriented Programming is an approach that provides a way for modularized programs by creating partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand.
 
Thus, an object is considered to a partitioned area of computer memory that stores data and set of operations that can access the data. Since the memory partitions are independant, the objects can be used in a variety of different programs without modifications.
 
Basic Concepts of Object-Oriented Programming
 
The concepts which will be used extensively in OOP are :-
  • Objects
  • Classes
  • Data abstraction and excapsulation
  • Inheritance
  • Polymorphism
  • Dynamic binding
  • Message passing
Detailed description of each of this concepts will be covered in the next post.

I hope you liked this and I am sure you can let me know of your requirements through comments.

Thank you :)
     
 
 
 
     

C++ Compilers


Well starting with the necessary requirements for Programming, i.e Compilers for executing the programs.

Programming as I suggest is best done on LINUX Platform (Ubuntu) which has inbuilt text editors and compilers for c, c++.

In linux you can use gedit as ur text editor and save ur files with a (.cpp) extension.

For windows OS you can use Turbo C++ (Simplest but misses out on some key features of C++), Dev C++ or Windows Visual C++ .

 

Cracking GATE :- The Right Approach (CSE Topper 2010)

  • ANALYSIS OF PAPER

    First of all, go through all previous papers. Especially, the papers of the year when organizing institute is same as that of GATE’09.
    GATE’08 was organized by IISc. The previous years when IISc was organizing institute were year 2002, 1996, and 1990. When I solved these papers, I found out that there are some concepts on which IISc was focusing more. E.g. In each of these papers there was question on:B/B+ tree,Newton-Raphson Method,More stress on CO and Digital,Mathematics is more inclined towards Calculus than Discrete MathsOn the contrary problems on Probability, Networks and Compilers were not much difficult…..
    If u solve GATE’08 paper u ll find the same thing here also….
    So we can say that GATE paper is much predictive. so first task to do is go through all the papers (I think the organizing institute this time may be Madras and prev years when madras was organizing institute were 1991, 1997, 2003…) and find out the similarities….stress on them.I m not saying to skip all other topics…but practically its really difficult (not impossible) to focus on all the subjects….so, I just want to say, if u want to skip some topics don’t skip the topics stressed by the organizing institute. Also don’t underestimate the remaining topics …. here comes my first mistake…I under-estimate]Probability and solved very simple problem wrongly ….result was -2.5 marks .
    But warning is if u skip some topics u must be perfect in all the remaining topics. And the definition of perfect, here, is there must be only one person to solve particular problem on that topic before u….the paper setter!!!…..no one else

    Now next point is,Every GATE paper contains three kinds of questions:1. problems on tricky conceptsif u know the concept, ur done…2. Difficult problemsU ve to put ur brains to solve these problems…3. Practically unsolvable problemsU may find totally unknown and new concepts which couldn’t be solved in 3hrs time this typically includes problems on CO and probability.
    To crack the GATE u ve to solve correctly ALL the problems of first kind….for 2nd kind, the more the problem u solve, lesser the rank u ll get!!!
    Now while solving the paper, I solved it in 3 passes….
    1. Solve all the problems that u can solve undoubtfully…means answer only when ur200% sure about the ans ….for this pass I ve given 2hrs during the paper which is quite sufficient 2. Check all the problems…Remember while checking have thorough checking….check whether u ve marked correct option…check question-to-ans correspondence is correct…many times it happens that we solve Q.30…leave Q31 blank and after solving Q32 we mark option in front of Q31….here comes my another mistake…I haven’t checked three of questions for which I thought no checking is necessary…but I lost 7.5 marks….this pass may take 15-20 min…3. after careful checking only turn towards problems for which u are doubt full…try to rethink on these problems…u may solve 3-4 of them…
    I ld like to explain u how much imp ur hit ratio….in GATE’08 I attempted 54 questions…out of which 14 are of 1 marks and 40 are of marks…out of 14, 11 are correct and 3 came to be wrong…and out of 40…28 came to be correct and 12 came to be wrong…so my score, I think is round about 60/150….
    Now if I ld ve attempted only 11 one marked questions and 28 2 marked questions….for which I was 200% sure…then my score ld ve been 67/150….means surely I ld ve got rank <50

    Continuing the discussion about marks…I think, for easy paper(like GATE’07) 75/150 = IITFor difficult paper(like GATE’08) …u can see even 60/150 is done!!!
    So in general attempt 50-60 questions with hit ratio >90% and ur through!!!
    Well,Now I ll come to preparation part of the GATE .

    BOOKS and SUBJECT ANALYSIS

    Discrete Mathematics MOST IMP subject as far as CS is concerned
    First order logic:
    prepare it from Trembley-Manohar and solve exercise from Discrete Mathematics and Application by Kenneth Rosen. Easy topic. Once concept is clear marks are urs….Important rules of thumb are given in Kenneth Rosen
    Probability and Combinatorics:I skipped this part. But Kenneth Rosen again has variety of problems on this topic.
    Set Theory:
    Trembley-ManoharBoolean algebra,Groups, Lattice, Relations:Kenneth Rosen has good discussion on Relations and Lattice.Book by K.D.Joshi on Discrete Maths has good derivations regarding enumerating the relations…go through it, it ll surely help to build up the ideas…For Boolean Algebra and Group Theory again book by Trembley-Manoher is good, but for exercises I used book by Ross(I don’t remember the full name of author…sorry for that)Trembley-Manoher includes good theorems in Group Theory…

    Linear Algebra, Calculus and Numerical Methods:
    For these subjects I used the course books by local authors which we used for semester exams…There are some quickie methods to find out inverse of matrix, eigen values and eigen vectors, determinant…understand those from Profs in ur college
    Recurrence Relations:Kenneth Rosen includes some rules of thumb for Particular Solutions of Recurrence Relations…once u got them solving problems on RR is work of few secods…Particularly for Recurrence Relations, try to find ans by eliminating wrong options…i.e. if u know f(1)=a and f(0)=b…try to put 1 and 0 in options and see where u get correct ans….believe me in most of cases u ll get quick and correct ans by this way….
    Graph Theory:
    MOST IMP topic for CSTry to go through all possible books and material for Graph Theory.Note down the general formulae/theorems given in books…read them frequently…Kenneth Rosen includes good discussion in most of the concepts of GT.Graph Theory by Douglas West is also gr8 book.

    Theory of Computation
    Book byJohn C. MartinThis is gr8 for Regular Languages, Finite Automata…theory and problemsCohenThis includes variety of problems on every other concept of TOC…theory is also very perfect (as good as spoon feeding) …especially for pumping lemma
    Peter LinzAgain good theory …easy to understand….problems on Turing Machine are tricky…
    Michel SipserThis book is good especially for Un-decidability, Recursive and RE languages, NP-completenessFor NP-completeness book on Algorithms by Sahani is also good
    I suggest u to read these books in following order1. Read concepts from Cohen….u also can refer Peter Linz…solve exercises2. Solve exercise from John Martin3. Read Michel Sipser for advanced concepts
    statutory warning: TOC book by Ullman is injurious to brain …but do read this book once…this contains, exclusively, concepts of Homomorphism, HALF of LANGUAGE etc…


    Digital Logic:Morris Mano…morris mano…morris mano!!!!!!!!There are ppts on the department website of IIT-D regardin this course…which contains good discussion on some concepts like Fault Detection and Hazards in Circuits…Walkerly is also good book…There is also a book Fundamentals of Digital Circuits by A. Anand Kumar which includes thorough discussion on Number System(don’t under-estimate this point…there are many tricky concepts in it!!!)

    Computer Organization and Architecture:
    Book by Morris Mano(not the same as Digital…there is separate book for CO)…it contains good theory and problems for Addressing Modes, DMA and IO…refer latest edition coz previous editions doesn’t include concepts of Register Window….so I could not attempt problem on it Book by J. P. Hays contains good discussion on Micro-programming and Hard-Wired Design, also it contains good formulae for PipeliningJ. P. Hays also contain thorough discussion on Floating Point number formats….Good and exclusive formulae for Secondary Storage…
    Book by ZakyIt has good theory for PipeliningAlso thorough discussion in Cache memories…. Don’t skip any word and any problem written about
    cache in this book

    Algorithms
    Read each and every word written in book by Cormen…solve every other excersies….this is enough…solution manual is available over the internet…search on esnips.com
    Also there is one book, I found on flazx.com, named “Problems on Algorithms”…this book contains only problems …no theory…..but good bookBook by Sahani is also good
    IMP subject for CSGet perfection in:Master Theorem and Asymptotic notations
    Data Structure and ProgrammingFor programming u must be great in concepts of Pointers and Recursion. For tricky problems related with programming visit department websites of various foreign universities and solve the assignments given there…
    For data structureBook by Alan Weiss is great and sufficient for theory….For problems on Data Structure…nothing is sufficient….solve as many as u can…To understand various operations on various Trees and Heaps there are many Java Applets available over the internet…they will demonstrate it…
    Compiler DesignUllman…nothing else!!!For lexical analysis some problems are asked on C program like: a C program is given and we are asked to find out number of tokens generated…so to understand tokens in C…book by Denis Ritchie is good Read each and every word given on Parsers in Ullman…there are many tricks given to find out whether grammar is LL or LR or CLR or LALRstatutory warning: this book requires too much patience to understandMany students skip this subject but Ullman is best forParsers, S-attributed and L-attributed SDT, Scopes of variables, Passing of Parameters, Code Optimization (defn only)Prepare at least these points
    Operating Systems
    Book by Galvin is very good for conceptsModern Operating System by Andrew Tanenbaum is the best book for OS. It contains great number of problems. Also includes some of theory that is not included in Galvin’s book.Operating Systems by Stallings also contains tricky problems…soln manual is also available on esnips.comI also suggest Schaum’s Series (author: J. Archer Harris) book on operating systems for problems. It is a very good compilation of problems from Galvin, Tanenbaum and Stallings. Also soln are given.
    While preparing prepare operating system along with CO. it will be helpful for Memory Management.
    statutory warning: while solving problems on OS keep ur head cooool and….recheck them thrice…better not to attempt problems on OS in doubtful situation
    Database
    For physical database organization (theory) and SQL, RA, TRCBook by Raghuramkrishnan…soln manual is available
    For transaction management and Normalization
    Book by Korth … soln manual is available
    For ER diagrams and problems on physical database organizationBook by Navathe….available on ebookee.com
    Once u finish reading topics in Korth and Raghuramkrishnan and ur concepts are clear, then onwards I suggest u to read and stick up with Navathe coz it contains lot of techniques and algorithms not given any where else
    Computer Networks
    For application layer protocols“Computer Networking – A top down approach” by Kurose and Ross available on flazx.com“TCP/IP” by Forouzan
    For Frame Formats, TCP and IP Header formats“TCP/IP” by Forouzan
    Data Link Layer, Network Layer, Transport Layer“Computer Networks” by TanenbaumGo through all the exercises given in the book…soln manual is available on esnips.com .

    Some Suggestions for Preparation/Study
    1. Strictly use Reference books, don’t rely on any class notes.
    2. In first phase of ur study (in month of May-June) go through all GATE papers. Solve them by ur own. Once problem is solved try to find out similar problems from refernce books and solve them. This will fix up the concepts well.
    3. Use department websites of various universities to get latest assignments.
    4. plan ur schedule in such a way that u ll be able to finish up whole syllabus in month of Dec. from jan onwards try to solve papers.
    5. keep ur feb first week for revision only…don’t read any new concepts
    ( I tried to do calculus in month of Feb…i couldn’t even solve simple problem on limits…total time-waste)
    hope this was not too boring …and will be helpful to all of u…..

Sunday, 2 June 2013

Welcome to Programming World

Hello Friends,


My name is Ashish Mishra, I am a student of OmDayal Group of Institutions pursuing BTech in Computer Science and Engineering currently in my 2nd Year.

With this page I intend to share the most basic and simple problems in C, C++, Java initially then as I learn other languages I will try to publish notes on learning new languages.

Be here for the C++ programming concepts starting tommorow.