Saturday, February 27, 2010

DBMS-ASSIGNMENT QUESTIONS

1  Construct an ER diagram for bank transactions...
2  Construct an ER diagram for a hospital with a set of patients and a set of medical doctors.  Associate each patient with a log of the various test and examinations conducted....
3  With relevant example discuss the roll in SQL
         DDL,  DCL,   DML,   VIEWS.

4  Draw the three schma architecture of database system to explain in detail.
5  Discuss main categories of data models.

.

Wednesday, February 24, 2010

DAA questions test on monday

1> define OBST
2> write the algorithm to find minimum cost BST and its complexity
3>let n=4( a1,a2,a3,a4)=(do,if,int,while) let p[1:4]=(3,3,1,1,) and a(0;4)=(2,3,1,1,1,) intially we have w(i,i) =9(i),c(i,i)=0 r(i,i)=0;0<=i<=4 construct the BST and find its cost

Friday, February 19, 2010

My Presentation for Living Library


Hi gals n fellas, I have attached d presentation i ve created for Living Library....

Click here to download

(requires Office 2007 or higher)



Wednesday, February 17, 2010

ITS ALL ABOUT HACKING...

Interviewing computer security consultant Ankit Fadia, who at the age of 15 wrote his book on 'Ethical Hacking'

When did you realise that you could hack?

I got interested in hacking at 12, but it took a while before I figured out how to do it. My first hack was quite interesting. I defaced a magazine site and put my own profile, pictures and e-mail id on it. But then I thought I might get into trouble, so I sent a mail to the editor with the solution on how to prevent hacking the website. He got back to me with a job offer but when he learnt that I was 13, he asked me to wait till I turned 18. I learnt my lesson. I never did an illegal hack after that.

Is hacking cool because it allows entry into forbidden territory?
It is. It gives you the power to do something that most people can't do, that too in the confines of your room. It gives a false sense of security.

What exactly is 'ethical hacking'?

You need to have the same knowledge as cyber criminals, but you put that knowledge to positive use. You go to sites, find out their flaws and correct them. I coined the term when I wrote my first book, Ethical Hacking, at 15.

You have worked with the FBI too. Isn't that a heady feeling?

I started working with them at 16, when a Pakistani group was planning to attack an Indian site. I traced the chat transcript and the site was saved. Then, this was like a game for me. But now I realise that there's a lot of responsibility involved in what I do.

Why did you take up the show, What The Hack?

Last year, I won the MTV Youth Icon award and was introduced to the programming head of the channel. I asked him if they wanted to do a show on hacking. They agreed. There are lots of channels which air tech shows that review technology and gadgets. But this show stands out because we teach people cool things that they can do in the virtual world.

Give us some tips on how to become good hackers?

You have to know the programming well and also think like a criminal. You have to get into the criminal's mind to become a security system expert.

Monday, February 15, 2010

operating system ans

a)      Need matrix
 Need= maximum – allocation
                            0   0   0   0
0         7  5  0
1         0  0  1
1          1  2  1 
5   6   4   0
Currently the system is in safe state since available is ( 1   5   2   2)
Safe sequence
Need of each process is compared with the available resource, if need< available the resources are allocated.
If  need> available next process is compared
In the given problem
P1 is ( 0 0 0 0) and available is ( 1   5   2   2)
Since need  resourse
After allocation process is completed .
Now the available resource is available=available+allocation(which was released by process p0)
= (1,5,2,2)+(0,0,1,1)
=(1,5,3,3)currently available
Now for process p2  the need( 0,7,5,0)<(1,5,3,3)
=è process is allocated
After completion the resources are released
Available = available +allocation
=(1,5,3,3)+(1,0,0,1)==è (2,5,3,4)currently available

Now for process p3 the need( 1    0    0    1)<(2,5,3,4)
=è process is allocated
After completion the resources are released
Available = available +allocation
====(2,5,3,4)+(1,3,5,1)=(3,8,8,5)
Now for process p4 the need(1   1   2   1)<(3,8,8,5)
è process is allocated
After completion the resources are released
Available = available +allocation
=(3,8,8,5)+(0   5   3   1)
=(3,13,11,6)

Now for process p5 the need(5   6   4    0)<(3,13,11,6)
è process is allocated
After completion the resources are released
Available = available +allocation
== (3,  13,11,6)+( 0  0  1   1)
=(3,13,12,7)

Therefore the safe sequence is [p1,p2,p3,p4,p5]
REQUEST FROM P1 CAN BE GRANTED IMMEDIATELY SINCE THE REQUEST IS( 0  3   2   0)
AND THE AVAILABLE IS (1   5  2   2)








Sunday, February 14, 2010

The Power of Silence

Hi friends, check out this power point slideshow....Its really cool, powerful and mind blowing,


Click here to visit the link

I dedicate this slideshow to all my friends on this spl day for 'love'....

Love you all friends.....

Travelling on the road to success

Vivek Venkatesh

Friday, February 12, 2010

SJF - NON PREEMPTIVE SCHEDULING ALGORITHM

#include<stdio.h>

main()

{

    int b[10],p[10],t[10],w[10],n,i,j,tot=0,tot_turn=0;

    float avg;

    printf("\n Enter the number of Process:");

    scanf("%d",&n);

    for(i=0;i<n;i++)

    {

        printf("\n Enter the process no:");

        scanf("%d",&p[i]);

        printf("\n Enter the burst time:");

        scanf("%d",&b[i]);

    }

    for(i=0;i<n;i++)

    {

        for(j=i+1;j<n;j++)

        {

            if(b[i]>b[j])

            {

                int temp;

                temp=p[i];

                p[i]=p[j];

                p[j] = temp;

                temp = b[i];

                b[i] = b[j];

                b[j] = temp;

            }

        }

    }

    w[0] = 0;

    t[0] = b[0];

    for(i=1;i<n;i++)

    {

        w[i]=t[i-1];

        t[i] = w[i] + b[i];

    }

    printf("\n\n Gantt Chart:");

    printf("\n\n..........................................");

    printf("\n|p%d\t|",p[0]);

    for(i=1;i<n;i++)

        printf("p%d\t|",p[i]);

    printf("\n\n..........................................");

    printf("%d",w[0]);

    printf("\t%d",t[0]);

    for(i=1;i<n;i++)

        printf("\t%d",t[i]);

    printf("\n\n|");

    printf("\n Process \t Burst time \t Waiting time \t Turnaround time");

    printf("\n...........\t.............\t...........\t.........\n");

    for(i=0;i<n;i++)

    {

        printf("\n p%d    \t %d      \t%d    \t%d",p[i],b[i],w[i],t[i]);

        tot = tot + w[i];

        tot_turn = tot_turn + t[i];

    }

    avg=(float)tot/n;

    printf("\n\n The average waiting time is: %f",avg);

    avg = (float)tot_turn/n;

    printf("\n\n The average turn around time is %f",avg);

}

Thursday, February 4, 2010

Best Companies to Work for In India

  1. Infosys: At the top, by a mile
  2. Google: New Age Rocket Scientists
  3. TCS: Nurturing an Army
  4. Microsoft:Innovation factory
  5. Wipro: Stable, yet supple
  6. SBI: Elephants can dance
  7. Bharti Airtel: The insiders club
  8. Hewlett-Packard India: Challenge yourself
  9. HDFC Bank: Mergers and integration
  10. RIL: Seduction of scale
  11. ICICI Bank: Matrix reloaded
  12. Bajaj Capital: The crorepati carrot
  13. Larsen and Toubro Ltd: Empowered professionals
  14. Grasim Industries: From MP to MT Gordon
  15. BHEL: Promise of a way of life
  16. Oil and Natural Gas Commission: Time for an overhaul
  17. NTPC: People before PLF
  18. Indian Oil Corporation: Stability and low stress
  19. Bharat Sanchar Nigam Ltd: A safe call that is BSNL
  20. Reliance Communications: Relying on HR automation
(source - Business Today)

Tuesday, February 2, 2010

DAA II UNIT IMP QUESTIONS

PART A
1)  Waht is meant by optimal solution?
2)  State knapsack problem
3)  What is meant by divide and conquer strategy?
4)  Write down the recurrence equation for binary search algorithm
5)  Give two examples of real time problems that could be solved using greedy algorithm
6)  Compare feasible and optimal solution
7)  Give the time efficiency and drawback of merge sort algorithm
8)  Write recursive algorithm to perform binary search
9)  List out any two drawbacks of binary search algorithm
10)          Give the recurrence equation for the worst case behaviour of merge sort
11)          What is the time and space   complexity of container loading problem
12)          What is the time and space   complexity of knapsack problem
13)          What is meant by container loading problem
14)          What is the time efficiency class of greedy algorithm for  the knapsack problem? Justify ur answer
15)          Compare the time complexity of straight method with divide and conquer method of finding the maximum and minimum
16)          What are the merits of finding maximum and minimum using DAC?
17)          What are the merits and demerits of binary search algorithm?
18) What are the merits and demerits of merge sort?
19) Write the pseudo code for container loading algorithm
20) Define feasibility
Part B
1)  Write down the binary search algorithm and do the worst case analysis of the algorithm.  Derive any intermediate formula used
2)  Explain merge sort.  How do you analyse it using divide and conquer principle
3)  Explain merge sort with example
4)  Differentiate sequential from binary search technique
5)  Explain the working principle of merge sort with necessary algorithm, and simulate the algorithm with a non-trivial example
6)  Write down the binary search algorithm that searches for an element in a sorted list and analyse it for its worst case behaviour.  Derive all the intermediate results used
7)  Solve the following instance of the knapsack problem by greedy algorithm
               Item                           weight                             values
                    1                                 10                            100
                    2                                   7                              63
                    3                                   8                              56
                    4                                   4                              12

8)  Give an detailed note on divide and conquer techniques
9)  Write an algorithm for searching an element using binary search method.  Give an example
10) Discuss the use of greedy method in solving knapsack problem
11) A) write a pseudo code for divide and conquer algorithm for merging two sorted arrays into a single sorted one.  Explain with an example
b) set up an solve a recurrence relation for the number of key comparisons made by the above pseudo code.

12) How merge sort works for the following data set 100, 300.,150,450,250,350,200,400,500
13) Suppose you have 6 containers whose weights are 50, 10, 30,20,60,5 and ship whose capacity is 100. Find the optimal solution for the problem
14) Find an optimal solution to the knapsack instance n=7,m=15,(p1 ,p2)
    (w1,w2,w3,w4,w5,w6,w7)=(2,3,5,7,1,4,1)
             15) Find the maximum and minimum for the following set of elements using DAC technique.22
13
-5
-8
15
60
17
31
47


 

Monday, February 1, 2010

FCFS Implementation in C


Hi friends, below is a code to implement FCFS in C language...

(code given may not be clear, you can however download the code itself by clicking the link below)

#include
#include
struct proc
{
char id[6];
int burst_time; /*Holds the burst time of the process*/
int wait_time; /*Holds the waiting time of the process*/
int turn_time; /*Holds the turnaround time of the process*/
}process[10];
main()
{
int no,i,tot_wait=0; //total waiting time
float avg_wait; //average waiting time
clrscr();
printf("\n Enter the Number of Processes:");
scanf("%d",&no);
for(i=0;i {
printf("\n Enter the process id:");
scanf("%s",process[i].id);
printf("\n Enter the burst time:");
scanf("%d",&process[i].burst_time);
process[i].wait_time = 0;
}
// Gantt chart display
printf("\n\n Gantt Chart:\n\n");
printf("\n %s - %d to %d",process[0].id,process[0].wait_time,process[0].burst_time);
process[0].turn_time = process[0].wait_time + process[0].burst_time;
for(i=1;i {
process[i].wait_time = process[i-1].wait_time + process[i-1].burst_time;
process[i].turn_time = process[i].wait_time + process[i].burst_time;
printf("\n %s - %d to %d",process[i].id,process[i].wait_time,process[i].turn_time);
}


//Process,waiting time, turnaround time display
printf("\n\n Process \t Waiting Time \t Turnaround time");
for(i=0;i {
printf("\n%s\t\t%d\t\t%d",process[i].id,process[i].wait_time,process[i].turn_time);
tot_wait = tot_wait + process[i].wait_time;
}
avg_wait = tot_wait / no;
printf("\n\n The average waiting time is %f",avg_wait);
getch();
}




Download Source Code

By G.Vivek Venkatesh

the code has been written so that there is no error...in case u find any error pls let me know...

Photo collage