About

This is Vivek Vikram Singh. Currently pursuing Master Of Engineering in Computer Science stream from BITS, Pilani. I strongly believe in contribution-based education and helping out fellow/upcoming graduates with the experience I have. I have shared my written and interview experience in various known institutes/ PSUs for my M.Tech. admission in 2014 Find me on my blog at: https://vivekvsingh14.wordpress.com/

Role

Alma Mater:

Master of Engineering
Birla Institute of Technology and Science, Pilani
2014 to 2016
Bachelor of Engineering
Bansal Institute of Science and Technology, Bhopal
2009 to 2013

Experience:

Intern
EMC Corporation
2016
ASE
EMC Corporation
2016
TudLead
Example text
1 year 10 months ago

A = O(nlogn), B= O(n)

It is very trivial if you know the complexity concepts.

n=O(nlogn)

moreless
TudLead
Answer
1 year 10 months ago

#include #include int main() { int i; for (i=0; i<3; i++) { pid_t pid = fork(); if (pid == 0) printf("parent:[%d] current:[%d] i=%d\n", getppid(), getpid(), i); else printf("FORK Failed for current: %d\n", getpid()); printf("*\n"); } printf("HI \n"); return 0; }

moreless
TudLead
Answer
1 year 10 months ago

Tricky problem.

Please search for Fork() bomb.

moreless
narayanapot's picture
Lakshminarayana Potukuchi
virtualgate's picture
Virtual GATE
priyesh's picture
Priyesh Priyatam
ranita's picture
Ranita Biswas
pritam's picture
Pritam Prasun
pritam's picture
Pritam Prasun
905
Rajeev
914
priyesh's picture
Priyesh Priyatam
923
Himanshi
976
mnlcht's picture
jhilik
979
pshall's picture
shailendra joshi
998
maheshkumars's picture
Mahesh Kumar
1017
chandanchawda's picture
Chandan Chawda
1019
kaushalmaurya's picture
kaushal
1022
shabinmuhammed's picture
Shabin Muhammed
1065
tar_gate's picture
TarGate
1165
vineetkumar's picture
vineet
1238
rahulkumar's picture
Rahul Kumar
1246
kalpishsinghal's picture
Kalpish Singhal
1474
targetgate's picture
Target Gate
1518

Pages

29 Nov 2015 - 3:05am

People who solved it should see this question further test your concept  : http://www.techtud.com/example/very-good-example-fork

more less
19 Nov 2015 - 12:28am

This question is unlikely to come in exam, but solution explained in first answer by Nishant.

more less
18 Nov 2015 - 1:49pm

Manually doing so with recursive calls will be very lengthy. Understand the concept.

more less
18 Nov 2015 - 1:43pm

Yes.

more less

1) Add a node after first node, call it NewNode. 

2) Swap the firstNode's and NewNode's data.

3) Now change head pointer to point to head->next.

more less
3 Nov 2015 - 9:31pm

1) It contains the Formal Parameters. "Return value of the function" is quite ambiguous , as it can be function call, address of variable or anything. It does not contain global variables. 

more less
1 Nov 2015 - 3:37pm

This concept is very important as per GATE perspective and very easy one as well. It is best explained in a book called "First Course in Probability by Sheldon Ross" in 1st chapter. So to study it in detail, refer to this book.

As far solving such questions is concerned, you can refer to these links: https://www.cs.rochester.edu/~stefanko/Teaching/07CS282/hw1.pdf

http://codeforces.com/blog/entry/13771

http://www.careerbless.com/aptitude/qa/permutations_combinations_imp8.php

I highly recommend that first study the concept, as it is applicable to many other problems , from given above book and then these links and then solve problems from Rosen.

more less

As mentioned by a friend in here, Heap is the best data structure to be used for priority queue. Depending on priority , Min or Max heap can be used.

more less

Yes it is in GATE syllabus and very important topic as well. It comes under Data Structures and Algorithms.

more less

Pages