Wednesday, July 17, 2013

Programming and Data Structure

In this post, I am going to cover all the topics related to GATE and other technical interviews which comes under programming in C and Data Structure.
C is the most basic fundamental language that every CS/IT engineer should know. Also I would say everyone should know at least one computer programming language to understand this fastest growing digital world. Currently we are using many highly technical gadgets those are very user friendly, but one should know after how much effort that product is available to use by a totally non-technical person.
In this post I am going to cover most fundamental concepts of computer science those every Software Engineer should know.

Followings are the important topics related to Programming and Data Structure:

  1. What is C Programming Language
  2. Scope
  3. Binding
  4. Abstract Data Types
  5. Array
  6. Pointer
  7. Stack
  8. Queues
  9. Functions
  10. Recursion
  11. Parameter Passing
  12. Link List
  13. Trees
  14. Binary Search Tree
  15. Binary Heap

What is C Programming Language

C is a programming language developed in 1972 by Dennis Ritchie in Bell Lab. C is reliable, simple, and easy to use. If you know C then you can quickly learn any programming language. No one can directly learn C++ or JAVA, so C is the first step for programming learner. Like a child can not start talking directly without learning words. So in simple language C is the letters and words and Grammar of programming languages.

We can compare C language with any spoken language for example:English

In English language we have:

Alphabets                                   --> Words                                    --> Sentences   -->   Paragraph

Similarly in C language we have

Alphabets, Digits, Special Symbol --> Constants, Variables, Keywords --> Instructions --> Programs

Alphabets similar to English language, digits (0-9), special symbols like (~,!,@,#,$,%,^,&, etc.)

Constants are of two types: Primary constants and Secondary constants

Primary constants are followings:

  • Integer Constants
  • Real Constants (Fractional, exponential)
  • Characters Constants

Secondary constants are followings:

  • Array
  • Pointer
  • Structure
  • Union
  • Enum

Scope

The scope is the context within the program in which an identifier/ variable is valid and can be resolved to find the entity associated to the identifier. A scope in any programming is a region of the program where a defined variable can have its existence and beyond that variable can not be accessed. There are three places where variables can be declared in C programming language.

  1. Inside a function or a block which is called local variables
  2. Outside of all functions which is called global variables
  3. In the definition of function parameters which is called parameters

Local Variables

Local variables are the variables declared inside a function or any block. They can be used only by statements that are inside that function or block of code. They can not be used outside that function or block in which they have been declared. For example in below code var1, var2, var3 are local variables

#include <stdio.h>  
#include <conio.h>
/* declaration of global variable*/
int global_var;

int main(){
    
     /* declaration of local variables  */
    int var1;
    int var2;
    int var3;
    
    /* initialization of local variables */
    var1 = 10;
    var2 = 20;
    var3 = var1 + var2;
    global_var = var3 + 1;
    printf ("Value of var1 = %d, var2 = %d and var3 = %d\n", var1, var2, var3);
    printf ("Global variable global_var = %d\n", global_var);
    system("pause");
    return 0;
}

Global Variables

Global variables are defined outside of a function, usually on top of the program. The global variables will hold their value throughout the lifetime of your program and they can be accessed inside any of the functions defined for the program.

A global variable can be accessed by any function. That is, a global variable is available for use throughout your entire program after its declaration. In above example global_var is a global variable declared on top that can be used in any function.

Function

Function ........

Study for GATE Exam and also Useful for Technical Interviews in IT Industry

Hello friends, I welcome you and appreciate you to prepare for GATE Exam. You have taken right decision of preparing for GATE exam, It will help you in two way, first you are preparing for GATE so you will get good score to take admission in better college like IITs, IIITs and NITs for better study, second if any you does not get good score in GATE, then you will surely get a good job if you were preparing seriously, so don't loose hope keep learning daily.

Just think about, How many engineering graduates does India produce each year? The answer is around 200,000. and now think how many jobs India produce per year in IT industry, the answer is maximum 15,000. So this analysis shows that if you want job you have to make yourself seen. You have to stand apart using your ability and knowledge.

I will try my best to help you scoring best in GATE exam or compete any Interview for a job, I am going to cover most of the CS/IT syllabus of GATE which is asked in most of technical interviews also. As per my experience best strategy to prepare for GATE is go topic wise

  • Choose a topic
  • Study topic completely
  • Solve topic related questions from books
  • Solve topic related previous years GATE questions
  • Solve topic related questions from other material, if you have any

You can download GATE CS/IT syllabus from here


I am going to cover following topics here:

  1. Programming and Data Structures
  2. Algorithms: Analysis and Asymptotic notation
  3. Worst and average case analysis
  4. Design: Greedy approach, Dynamic programming
  5. Divide-and-conquer
  6. ER- model, Relational model, Database design
  7. Query languages (SQL)
  8. File structures (sequential files, indexing, B and B+ trees)
  9. Transactions and concurrency control
  10. Information Systems and Software Engineering
  11. HTML
  12. XML
  13. Basic concepts of client-server computing
  14. Digital Logic: Logic functions, Minimization
  15. Design and synthesis of combinational and sequential circuits
  16. Number representation and computer arithmetic (fixed and floating point)
  17. Computer Networks: ISO/OSI stack
  18. LAN technologies (Ethernet, Token ring)
  19. Flow and error control techniques, Routing algorithms, Congestion control
  20. TCP/UDP and sockets
  21. IP(v4), Application layer protocols (icmp, dns, smtp, pop, ftp, http)
  22. Basic concepts of hubs, switches, gateways, and routers
  23. Network security basic concepts of public key and private key cryptography
  24. Digital signature, firewalls
  25. Operating System: Processes, Threads
  26. Operating System:Inter-process communication
  27. Operating System:Concurrency, Synchronization
  28. Deadlock, CPU scheduling
  29. Memory management and virtual memory
  30. File systems
  31. I/O systems
  32. Protection and security

You can post a comment if you have any doubt or any question, I will try my best to response you back with solution