Re: [algogeeks] Re: Aps

2011-09-08 Thread bharatkumar bagana
@ gmago:
how did u arrive at 16 ... is there any idea in choosing that number ..

On Wed, Sep 7, 2011 at 8:44 PM, Don dondod...@gmail.com wrote:

 Clearly you are sitting still looking at a Route 66 sign.
 Don

 On Sep 7, 10:09 am, Mani Bharathi manibharat...@gmail.com wrote:
  While traveling at uniform speed. U read a two digit no. after one hr
  the number is reversed order. After another hour the number read is same
  two digit number. What is the average speed?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
*
Mobile +91 8056127652*
bagana.bharatku...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Adobe written test

2011-09-08 Thread Amit Gupta
Written test of adobe had 3 sections -
Quant and Analytical section - 45 questions(30 + 15) 45 mins
2 coding papers - 1 hr each , 10 ques each
1st coding paper had general MCQ  (test ur c skills type )
2nd coding paper had ques for writing algos, codes and few OS
questions.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Objective Question

2011-09-08 Thread bharatkumar bagana
@piyush:
can u pls elaborate the explanation for  option d) ...

On Wed, Sep 7, 2011 at 9:07 PM, Piyush Grover piyush4u.iit...@gmail.comwrote:

 Option a) i didn't understand properly, please elaborate!!

 Option b) certainly yes.

 Option c) No (remember, the size of the table is subjective)

 Option d) yes (use index on the column used in the where clause)




 On Wed, Sep 7, 2011 at 8:58 PM, Mani Bharathi manibharat...@gmail.comwrote:

 when is index of a table used?

 a)when table is less range of values
 b)when table is used frequently
 c) when the table is small
 d)when we use join statement with select and where clause.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/vtHvd8sE1AUJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
*
Mobile +91 8056127652*
bagana.bharatku...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread PRATEEK VERMA
@harshit
it is also possible with scanf(%[^\n]s) for multi word input

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] answer these interesting questions

2011-09-08 Thread surender sanke
explanation would be appreciated

surender

On Thu, Sep 8, 2011 at 12:12 AM, Piyush Grover piyush4u.iit...@gmail.comwrote:

 4) a and b


 On Thu, Sep 8, 2011 at 12:08 AM, Piyush Grover 
 piyush4u.iit...@gmail.comwrote:

 1.)a
 2.)b
 3.)b
 4)b


 On Wed, Sep 7, 2011 at 11:08 PM, Mani Bharathi 
 manibharat...@gmail.comwrote:

 “Kya-Kya” is an island inhabitants of which always answer any question
 with two
 answers , one of which is true and the other is false .

 1.You are walking on a road and came to a park . You ask the inhabitants
 Ram , Laxman and Lila , “which road will
 take me to the village ?”Ram says “I never speak to strangers . I am new
 to these parts .”Laxman says,”I am married
 to Lila . Take the left road .”Lila says “I am married to Ram . He is not
 new in these place .”Which of the following is
 true ?(a)Left road takes you to the village(b)Right road takes you to the
 village(c)Lila is married to Laxman.(d)none.

 2.You find that your boat is stolen . You question three inhabitants of
 the island and reply as follows . John saya “I
 didn’t do it . Mathew did not do it .”Mathew says “I did not do it .
 Krishna did not do it .”Krishna says “I did not do
 it . I do not know who did it .” Who stole your boat ?
 (a)John(b)Mathew(c)Krishna(d)All three (e)none.

 3.You want to speak to the chief of the village . You question three
 inhabitants Amar , Bobby and Charles . Only
 Bobby is wearing a red shirt . Amar says “I am not Bobby’s son .The chief
 wears a red shirt.”Bobby says “I am
 Amar’s father . Charles is the chief.”Charles says “The chief is one
 among us . I am the chief .”Who is the chief?
 (a)Amar(b)Bobby(c)Charles(d)None.

 4.There is only one pilot in the island.You interview three men:Koik,lony
 and Mirna.You also notice that Koik is
 wearing a cap.Mirna says “Lony’s father is the pilot.Lony is not the
 priest’s son.”Koik says “I am the pilot.On this
 island only priests can wear cap.”Lony says “I am the priest’s son.Koik
 is not the priest .”Which of the following is
 true?(a)Lony is not Koik’s son(b)Koik is the pilot(c)Mirna is the
 pilot(d)Lony is the priest.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/QsepdSoM9esJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Aps

2011-09-08 Thread sharmila saru
ANSWER:
45

On Wed, Sep 7, 2011 at 8:39 PM, Mani Bharathi manibharat...@gmail.comwrote:

 While traveling at uniform speed. U read a two digit no. after one hr
 the number is reversed order. After another hour the number read is same
 two digit number. What is the average speed?

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/IgIgl9HkbYUJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] os

2011-09-08 Thread sharmila saru
4

On Wed, Sep 7, 2011 at 9:09 PM, Mohit Goel mohitgoel291...@gmail.comwrote:

 How many processes are created in this snippet?
 Main()
 {
 Fork();
 Fork()  fork () || fork ();
 Fork ();
 }

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: answer these interesting questions

2011-09-08 Thread Anas Hadi
Solution to 3rd question:
Charles: 1st True. 2nd False
Bobby :  1st True, 2nd False
Amar:1st False, 2nd True

Hence Bobby is the chief

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Objective Question

2011-09-08 Thread rahul vatsa
index we create for a column on a table, nd when we create that, internally
the indexes, which r key,field values with that column value  probably the
corresponding record addr, r created  and stored in some tree structure.
and wen we do a select based on this column value, db 1st searches this
tree, and then picks the corresponding record from the table. It makes
select much faster.

  so, if you have a  table, and it is having huge no of records, and mostly
u fetch records based on a particular column(field) value, i.e, that column
is in where clause of the select st, then if u create an index for that
column, select queries will be multiple times faster.




On Thu, Sep 8, 2011 at 2:16 AM, bharatkumar bagana 
bagana.bharatku...@gmail.com wrote:

 @piyush:
 can u pls elaborate the explanation for  option d) ...


 On Wed, Sep 7, 2011 at 9:07 PM, Piyush Grover 
 piyush4u.iit...@gmail.comwrote:

 Option a) i didn't understand properly, please elaborate!!

 Option b) certainly yes.

 Option c) No (remember, the size of the table is subjective)

 Option d) yes (use index on the column used in the where clause)




 On Wed, Sep 7, 2011 at 8:58 PM, Mani Bharathi manibharat...@gmail.comwrote:

 when is index of a table used?

 a)when table is less range of values
 b)when table is used frequently
 c) when the table is small
 d)when we use join statement with select and where clause.

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/vtHvd8sE1AUJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] which is better Subquery or Join

2011-09-08 Thread nunna jaikish
AFAIK..no such hard rule ..depends on lot of factors

http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001361223.htm

On Thu, Sep 1, 2011 at 5:49 PM, ravi maggon maggonr...@gmail.com wrote:

 for what reason?


 On Thu, Sep 1, 2011 at 5:44 PM, sukran dhawan sukrandha...@gmail.comwrote:

 subquery

 On Thu, Sep 1, 2011 at 5:25 PM, ravi maggon maggonr...@gmail.com wrote:

 which is better Subquery or Join in sql and why?

 --

 Regards
 Ravi Maggon
 Final Year, B.E. CSE
 Thapar University

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 Regards
 Ravi Maggon
 Final Year, B.E. CSE
 Thapar University

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
http://about.me/njk/bio

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Adobe written test

2011-09-08 Thread pavan kumar
Thnx Amit...Can any one post some sample ques so that it vl be very useful
??

On Thu, Sep 8, 2011 at 11:41 AM, Amit Gupta amit070...@gmail.com wrote:

 Written test of adobe had 3 sections -
 Quant and Analytical section - 45 questions(30 + 15) 45 mins
 2 coding papers - 1 hr each , 10 ques each
 1st coding paper had general MCQ  (test ur c skills type )
 2nd coding paper had ques for writing algos, codes and few OS
 questions.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 



Regards:
---
K Pavan Kumar
Computer Science  Engg.
2nd Mtech, IIT Madras.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] computer organization

2011-09-08 Thread bharatkumar bagana
can any one tell me how a processor supports an external hard disk with huge
memory like 1000 TB ?
what are the requirements needed to access a data element in that drive?

-- 

**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
*
Mobile +91 8056127652*
bagana.bharatku...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks]

2011-09-08 Thread annarao kataru
@thank u

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread kartik sachan
using gets we can get buffer over as gets doesn't check about the size input
so it mai go to that area where our stack base pointer(think in memory
layout section) is stored so our programmed doenn't return to orignal state
as address is stored there...so it is dangeroues to use

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: EOF

2011-09-08 Thread hashd
@Anurag: The input is said to be of unknown and large length ... read it one 
character at a time using a loop like
while((c=getchar())!=EOF){
//body
}

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/mxkqJD_TCgEJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: urgent :guys what type of ques does flipkart ask anyidea for written and interview

2011-09-08 Thread htross
please post the questions after the first round is over...

On Sep 8, 9:35 am, rahulmaximus rahul29ma...@gmail.com wrote:
 what the pattern like?
 Any papers or type of topics to stress on would be welcomed ...

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] answer these interesting questions

2011-09-08 Thread sukran dhawan
1 a
2 c
3 b

On Wed, Sep 7, 2011 at 11:08 PM, Mani Bharathi manibharat...@gmail.comwrote:

 “Kya-Kya” is an island inhabitants of which always answer any question with
 two
 answers , one of which is true and the other is false .

 1.You are walking on a road and came to a park . You ask the inhabitants
 Ram , Laxman and Lila , “which road will
 take me to the village ?”Ram says “I never speak to strangers . I am new to
 these parts .”Laxman says,”I am married
 to Lila . Take the left road .”Lila says “I am married to Ram . He is not
 new in these place .”Which of the following is
 true ?(a)Left road takes you to the village(b)Right road takes you to the
 village(c)Lila is married to Laxman.(d)none.

 2.You find that your boat is stolen . You question three inhabitants of the
 island and reply as follows . John saya “I
 didn’t do it . Mathew did not do it .”Mathew says “I did not do it .
 Krishna did not do it .”Krishna says “I did not do
 it . I do not know who did it .” Who stole your boat ?
 (a)John(b)Mathew(c)Krishna(d)All three (e)none.

 3.You want to speak to the chief of the village . You question three
 inhabitants Amar , Bobby and Charles . Only
 Bobby is wearing a red shirt . Amar says “I am not Bobby’s son .The chief
 wears a red shirt.”Bobby says “I am
 Amar’s father . Charles is the chief.”Charles says “The chief is one among
 us . I am the chief .”Who is the chief?
 (a)Amar(b)Bobby(c)Charles(d)None.

 4.There is only one pilot in the island.You interview three men:Koik,lony
 and Mirna.You also notice that Koik is
 wearing a cap.Mirna says “Lony’s father is the pilot.Lony is not the
 priest’s son.”Koik says “I am the pilot.On this
 island only priests can wear cap.”Lony says “I am the priest’s son.Koik is
 not the priest .”Which of the following is
 true?(a)Lony is not Koik’s son(b)Koik is the pilot(c)Mirna is the
 pilot(d)Lony is the priest.
 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/QsepdSoM9esJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Please share amazon online test questions for freshers

2011-09-08 Thread algo geek


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] backtracking

2011-09-08 Thread sukran dhawan
guys which is the best site or book to practise backtracking and branch and
bound programs ?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] MICROSOFT in VJTI mumbai

2011-09-08 Thread dilip makwana
Hey guys MS coming to our college (VJTI Mumbai) ...preferably 14-15 Sept

So *whoevere attended recently in past 2-3 months please share format and
questions asked ...*

Give details about -  in C/C++ what type of ques asked... etc and* if
possible post questions ..*

And *what areas one need to hone one's skills before appearing for MS ...*

It'll be Great help to all of us ..[?]

Thanks;
-- 
*Dilip Makwana*
VJTI
BTech Computers Engineering
2009-2013

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

330.gif

[algogeeks] Kth largest element

2011-09-08 Thread Rohit jalan
How to find out Kth largest element in an array ?

-- 
Thanks  Regards :
ROHIT JALAN

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Kth largest element

2011-09-08 Thread Piyush Kapoor
use max heap ,it will take n + k*logn

On Thu, Sep 8, 2011 at 10:25 PM, Rohit jalan jalanha...@gmail.com wrote:

 How to find out Kth largest element in an array ?

 --
 Thanks  Regards :
 ROHIT JALAN

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
*Regards,*
*Piyush Kapoor,*
*2nd year,CSE
IT-BHU*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Kth largest element

2011-09-08 Thread praveen raj
Use the Randomized partition approach of quicksort to find the kth largest
element in the array.
With regards,

Praveen Raj

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Kth largest element

2011-09-08 Thread Brijesh
make a max heap of size K , and keep inserting all the elements in it.. and 
at last the root will be the k-th largest element ! O(nlogk)

On Thursday, 8 September 2011 22:32:52 UTC+5:30, Sandeep Chugh wrote:

 wat abt creating a max heap?  and then deleting root element k-1 times..
 after then root contains kth largest element

 On Thu, Sep 8, 2011 at 10:28 PM, Piyush Kapoor pkje...@gmail.com wrote:

 use max heap ,it will take n + k*logn


 On Thu, Sep 8, 2011 at 10:25 PM, Rohit jalan jalan...@gmail.com wrote:

 How to find out Kth largest element in an array ?

 -- 
 Thanks  Regards :
 ROHIT JALAN

  -- 
 You received this message because you are subscribed to the Google Groups 
 Algorithm Geeks group.
 To post to this group, send email to algo...@googlegroups.com.
 To unsubscribe from this group, send email to 
 algogeeks+...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/algogeeks?hl=en.




 -- 
 *Regards,*
 *Piyush Kapoor,*
 *2nd year,CSE
 IT-BHU*

  -- 
 You received this message because you are subscribed to the Google Groups 
 Algorithm Geeks group.
 To post to this group, send email to algo...@googlegroups.com.
 To unsubscribe from this group, send email to 
 algogeeks+...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/algogeeks?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/0aRiVof2NjYJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread praveen raj
char str[MAXLINE];
fp=fopen(ABC.txt,r);

syntax:

fgets(str,MAXLINE,fp);
With regards,

Praveen Raj

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread SANDEEP CHUGH
another problem with gets is that although we can read multiword string
but we cannot read multiple strings  like with scanf,,


On Thu, Sep 8, 2011 at 10:50 PM, praveen raj praveen0...@gmail.com wrote:


 char str[MAXLINE];
 fp=fopen(ABC.txt,r);

 syntax:

 fgets(str,MAXLINE,fp);
 With regards,

 Praveen Raj


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: whats d problem wid using gets?

2011-09-08 Thread praveen raj
@sandeep...dont understand... plz give an example...

With regards,

Praveen Raj

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] sorting..

2011-09-08 Thread aayush jain
very easy qus...which is the best sorting tech. n why?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] sorting

2011-09-08 Thread aayush jain
which is best sorting tec. n why???

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Kth largest element

2011-09-08 Thread Rohit jalan
@Brijesh: Can you help me with a code ? or atleast pseudo code ?  How are
you going to keep on inserting the elements ?

Thanks  Regards,
-Rohit

On Thu, Sep 8, 2011 at 10:38 PM, Brijesh brijeshupadhyay...@gmail.comwrote:

 make a max heap of size K , and keep inserting all the elements in it.. and
 at last the root will be the k-th largest element ! O(nlonk)


 On Thursday, 8 September 2011 22:32:52 UTC+5:30, Sandeep Chugh wrote:

 wat abt creating a max heap?  and then deleting root element k-1 times..
 after then root contains kth largest element

 On Thu, Sep 8, 2011 at 10:28 PM, Piyush Kapoor pkje...@gmail.com wrote:

 use max heap ,it will take n + k*logn


 On Thu, Sep 8, 2011 at 10:25 PM, Rohit jalan jalan...@gmail.com wrote:

 How to find out Kth largest element in an array ?

 --
 Thanks  Regards :
 ROHIT JALAN

  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algo...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+...@googlegroups.com**.

 For more options, visit this group at http://groups.google.com/**
 group/algogeeks?hl=en http://groups.google.com/group/algogeeks?hl=en.




 --
 *Regards,*
 *Piyush Kapoor,*
 *2nd year,CSE
 IT-BHU*

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algo...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+...@googlegroups.com**.

 For more options, visit this group at http://groups.google.com/**
 group/algogeeks?hl=en http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/XYeQcjZW-isJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Regards :
ROHIT JALAN
B.E. Graduate,
Computer Science Department,
RVCE, Bangalore

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Kth largest element

2011-09-08 Thread praveen raj
@brijesh...Tht would...be... O(klogn)

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] sorting

2011-09-08 Thread praveen raj
Merge sort
Quicksort--number of comparisons and exchanges lesser than heapsort...if
worst case not occurs...

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Kth largest element

2011-09-08 Thread Rohit jalan
Okay. We can do it with min Heap.

1) Build a Min Heap MH of the first k elements (arr[0] to arr[k-1]) of the
given array. O(k)
2) For each element, after the kth element (arr[k] to arr[n-1]), compare it
with root of MH.
a) If the element is greater than the root then make it root and call heapify
http://www.personal.kent.edu/%7Ermuhamma/Algorithms/MyAlgorithms/Sorting/heapSort.htmfor
MH
b) Else ignore it.
O((n-k)*logk)
3) Finally, MH has k largest elements and root of the MH is the kth largest
element.

Thanks  Regards,
-Rohit

On Thu, Sep 8, 2011 at 11:20 PM, praveen raj praveen0...@gmail.com wrote:

 @brijesh...Tht would...be... O(klogn)

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Regards :
ROHIT JALAN
B.E. Graduate,
Computer Science Department,
RVCE, Bangalore

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Kth largest element

2011-09-08 Thread Dave
@Praveen: No. Brijesh was correct. Inserting an element into a heap
with k elements is O(log k). This must be done n times, so O(n log k).

Dave

On Sep 8, 12:50 pm, praveen raj praveen0...@gmail.com wrote:
 @brijesh...Tht would...be... O(klogn)

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] sorting

2011-09-08 Thread aayush jain
if list is sorted nd when list is unsorted.
and which one quick sort or merge sort.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: sorting

2011-09-08 Thread Don
Best for what?
Don

On Sep 8, 12:41 pm, aayush jain ajain...@gmail.com wrote:
 which is best sorting tec. n why???

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] sorting

2011-09-08 Thread Piyush Grover
It depends on the use cases.

If you have less elements of order of( say 100) then even insertion sort can
be a better choice. It's in-place sorting algo and can
perform sorting as it receives the elements like a stream.

If you have large number of elements and all the elements can't be
accommodated in the system memory together than merge sort is the only
best choice.

If you  have large number of elements and can be accommodated  in the memory
together then on an average quicksort is what you should look at.



On Thu, Sep 8, 2011 at 11:22 PM, praveen raj praveen0...@gmail.com wrote:

 Merge sort
 Quicksort--number of comparisons and exchanges lesser than heapsort...if
 worst case not occurs...


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT

2011-09-08 Thread Himanshu Neema
@Dave: Thanks for pointing that out .

In that case , if tree is really big and we want to *save memory* :
*Algorithm #1 :*
1) Convert tree to a linked list ( Right rotation or left rotation )  : O(n)
2) Quick Select Kth largest element : Worst case O(n^2) ( when tree was
already a bst + if we chose pivot to be fist node of linked list everytime)
3) apply second phase of DSW algorithm to recreate the tree.  O(n)
Time :  O(n^2)
Space: O(1)
Bonus : After fist call tree is perfectly balanced

If tree is small , we want  to *save run time* :
*Algorithm #2 :*
1) Traverse tree , store elements in array : O(n)
2) Quick Select Kth largest element : O(n)
Time : O(n)
Space : O(n)




On Thu, Sep 8, 2011 at 8:58 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: You apparently are assuming that the data is presented in a
 binary search tree, but the original problem stated that the data is
 presented in an unordered array. You need to account for the
 complexity of forming the bst and how much space it will take.

 Dave

 On Sep 7, 7:20 pm, Himanshu Neema potential.himansh...@gmail.com
 wrote:
  Do reverse inorder and count number of nodes visited, Kth visited node
 will
  be Kth largest.
  Time : O(n)
  Space : O(1)
 
  On Mon, Sep 5, 2011 at 5:16 PM, bharatkumar bagana 
 
 
 
  bagana.bharatku...@gmail.com wrote:
   @monish:
   u'rs is correct , time =O(nlogn) Ok but, the constant behind this prog
 is
   very huge ..
   for every number coming in , u maintain minheap and maxheap,and also if
 the
   sizes are of mismatch , u delete from minheap and add that to max
 heap---
   here deletion--O(logn),addition--O(logn),this occurs on an average for
   every 3 elements ...
 
   On Mon, Sep 5, 2011 at 2:08 AM, sachin goyal monugoya...@gmail.com
 wrote:
 
   @anup,@sukran ithink u both are right in case of binary search tree...
   we can traverse and then easily find the value...
   but in case of heap first we have to create the heap and accordingly
 apply
   the algo the create min heap.
   it will be the complex program
   so simple is bst just traverse by inorder and compare
   if anyone has simple solution or any other case then plz tell.
 
   On Sun, Sep 4, 2011 at 9:56 PM, monish001 monish.gup...@gmail.com
 wrote:
 
   ALGO:
   1. For each element 1 to k:
 insert in into min-heap
   2. for each element k+1 to n
 delete the root of min-heap and insert this item into the min-
   heap
   3. Finally you have a min-heap of k largest numbers and the root is
   your answer
 
   COMPLEXITY: O(n logn)
 
   -Monish
 
   On Sep 3, 3:03 pm, teja bala pawanjalsa.t...@gmail.com wrote:
//Asked in MS please help me with the coding or Give an algorithm
 
Write code to return the kth largest element in a tree ...
 function
prototype is int fucnkth(node *root,int k)
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
 
   **Please do not print this e-mail until urgent requirement. Go Green!!
   Save Papers = Save Trees
   *BharatKumar Bagana*
   **http://www.google.com/profiles/bagana.bharatkumar
 http://www.google.com/profiles/bagana.bharatkumar
   *
   Mobile +91 8056127652*
   bagana.bharatku...@gmail.com
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] File trying to read when reached EOF , WHY ????

2011-09-08 Thread SAMMM
#includeiostream
#includecstdio
#includecstring
#includealloc.h
#includecstdlib
using namespace std;


class GraphClass
{
 int arr[1000][1000];
 int r,c;
 public:
 GraphClass()
 {
   for(int i=0;i1000;i++)
memset(*(arr+i),0,sizeof(*(arr+1)));
r=c=0;
 }

 void ReadFromFile(char *str)
 {
   FILE *f;
   char buff[1000]={'\0'};
   f=fopen(str,r);
   char *p;
   while(!feof(f))
   {
fgets(buff,sizeof(buff),f);
buff[strlen(buff)-1]='\0';
printf(%s\n,buff);
int d;c=0;
while((p=strchr(buff,32))!=NULL)
{
  sscanf(buff,%d,d);
 // printf(%d ,d);
  arr[r][c++]=d;
  strcpy(buff,p+1);
}
sscanf(buff,%d,d);
 //   printf(%d ,d);
arr[r][c++]=d;
   // puts();
r++;
   }
   fclose(f);
  return;
 }

void displayGraph()
{
printf(%d %d \n,r,c);
/*
 for(int i=0;ir;i++){
   for(int j=0;jc;j++)
  printf(%d ,arr[i][j]); printf(\n); }
*/
 return ;
}

};

int main(int argc, char *argv[])
{
GraphClass graph;
char str[1];
if(argc  2)
{ puts(ERROR cann't continue); exit (1);}
strcpy(str,argv[1]);
graph.ReadFromFile(str);
graph.displayGraph();
return 0;
}

Suppose for a file  graph.txt
bash-3.00$ cat graph.txt
0 2  3 5
2 0 1 4 
 1 0  2
3 4  0 1
5   1 0


bash-3.00$ g++ -o s Graph.cpp
ld: warning: symbol `clog' has differing types:
(file /opt/sfw/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/libstdc+
+.so type=OBJT; file /usr/lib/libm.so type=FUNC);
/opt/sfw/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/libstdc++.so
definition taken
bash-3.00$ ./s graph.txt
0 2  3
2 0 1 4
 1 0 
3 4  0
5   1

6 1


Now when I execute the file after compilation it give an extra column
count ... It is trying to read when the file has reached the EOF ..
Any specific reason why it is so ???


I have to check for the termination of the file content by :

while(!feof(f))
   {
fgets(buff,sizeof(buff),f);
buff[strlen(buff)-1]='\0';
if(!strcmp(buff,)) return;  --
Have to Add it to prevent the above problm
int d;c=0;
while((p=strchr(buff,32))!=NULL)
{..

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Amazon Interview question

2011-09-08 Thread Brijesh
Please reply with your alog...!

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/OGVCUV_hutUJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] what is meaning of STAT field in ps command

2011-09-08 Thread Rajesh Kumar
output of ps aux command looklike--
USER  PID   %CPU   %MEMVSZ  RSS   TTY  STAT  START   TIME
COMMAND
x 1433   0.0 0.123940 2548?  Sl
  05:55   0:00/usr/bin/gnome-
y 1512   0.0 0.294388 4772?
 Ssl05:55   0:00/usr/bin/pulsea

what is meaning of Sl and Ssl in the STAT field?
-- 
Regards
Rajesh Kumar

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] what is meaning of STAT field in ps command

2011-09-08 Thread Ankur Goel
Hi,

 PROCESS STATE CODES
Here are the different values that the s, stat and state output specifiers
(header STAT or S) will display to describe the state of a process.
DUninterruptible sleep (usually IO)
RRunning or runnable (on run queue)
SInterruptible sleep (waiting for an event to complete)
TStopped, either by a job control signal or because it is being traced.
Wpaging (not valid since the 2.6.xx kernel)
Xdead (should never be seen)
ZDefunct (zombie) process, terminated but not reaped by its parent.

For BSD formats and when the stat keyword is used, additional characters may
be displayed:
high-priority (not nice to other users)
Nlow-priority (nice to other users)
Lhas pages locked into memory (for real-time and custom IO)
sis a session leader
lis multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+is in the foreground process group

Taken from man ps

Thanks
Ankur Goel

On Fri, Sep 9, 2011 at 7:52 AM, Rajesh Kumar testalgori...@gmail.comwrote:

 output of ps aux command looklike--
 USER  PID   %CPU   %MEMVSZ  RSS   TTY  STAT  START   TIME
 COMMAND
 x 1433   0.0 0.123940 2548?  Sl
   05:55   0:00/usr/bin/gnome-
 y 1512   0.0 0.294388 4772?
  Ssl05:55   0:00/usr/bin/pulsea

 what is meaning of Sl and Ssl in the STAT field?
 --
 Regards
 Rajesh Kumar


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] computer organization

2011-09-08 Thread bharatkumar bagana
To access a data element , processor has to have the address of that data
element .. for that, processor should have some register or address bus or
some thing like that to fetch the data ...what is the limitation from
processor side in extending the memory?
and also what is the limitation from processor side in extending RAM size ?
like while buying a laptop or a system he gives the limitation like up to 8
GB extendable for RAM...based on what will he give that constraint ?

On Thu, Sep 8, 2011 at 9:23 PM, Aditya Virmani virmanisadi...@gmail.comwrote:

 wht do u mean by tht qn? i didn get it...OS isnt processing any data...it
 just simply maintains the imaging  indexing operations...wht do u mean by
 managing...? accessing involves use of indexing  seeking to the particular
 data point...

 On Thu, Sep 8, 2011 at 3:41 PM, bharatkumar bagana 
 bagana.bharatku...@gmail.com wrote:

 can any one tell me how a processor supports an external hard disk with
 huge memory like 1000 TB ?
 what are the requirements needed to access a data element in that drive?

 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
*
Mobile +91 8056127652*
bagana.bharatku...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] sorting..

2011-09-08 Thread bharatkumar bagana
Randomized quick sort .. even the worst case in this algo is O(n^2) also,
this is best sorting algo ..
It is showed that nearly 20-25% of time O.S spends its time in sorting.In
unix based systems , they are using this algo only ..
A random choice will only choose from middle parts half the time. However,
this is good enough. Imagine that you are flipping a coin over and over
until you get *k* heads. Although this could take a long time, on average
only 2*k* flips are required, and the chance that you won't get *k* heads
after 100*k* flips is highly improbable. By the same argument, quicksort's
recursion will terminate on average at a call depth of only 2(2log2*n*).
http://en.wikipedia.org/wiki/Quicksort#Randomized_quicksort_expected_complexity

On Thu, Sep 8, 2011 at 11:08 PM, aayush jain ajain...@gmail.com wrote:

 very easy qus...which is the best sorting tech. n why?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
*
Mobile +91 8056127652*
bagana.bharatku...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Facebook Interview questions. -- Urgent

2011-09-08 Thread Harshal
The questions asked to us was simliar to this (it was titled *The Game of
Life* :D),

Consider a MxN matrix, with each cell painted either black or white. A flip
is defined over a cell as inverting the colors of all cells in the 3x3 grid
centered at that cell. The outermost boundary never changes color. The flip
over any cell is independent of the flips over any other cell in the matrix.

Input: A NxM matrix like
BWBW



t  (t lines (x,y,i) follow)
x y i, where (x,y) is the cell index and i is the number of flips to be
performed over that cell.

Output: Resultant matrix.


On Thu, Sep 8, 2011 at 9:48 AM, Ishan Aggarwal 
ishan.aggarwal.1...@gmail.com wrote:

 Hey,

 I cant find the puzzles www.facebook.com/PuzzleMaster at this page
 were u mentioning something different??


 On Thu, Sep 8, 2011 at 9:41 AM, Ishan Aggarwal 
 ishan.aggarwal.1...@gmail.com wrote:

 Hi,

 Thanks for this information. How many rounds of interview do they have and
 what package do they offer??

 On Thu, Sep 8, 2011 at 9:25 AM, arvinthdd arvint...@gmail.com wrote:

 Try the  facebook puzzle master  page and few given puzzles there.
 FB loves linux, mac a lot. Your exposure to these OS is a big plus.
 Its all about puzzle solving and your approach to new problems.

 On Sep 8, 1:04 am, Ankit Minglani ankit.mingl...@gmail.com wrote:
  they will give a puzzle kind of problem .. and you will have to code to
  output the solution .. i think it was a 75 min coding round.
 
  On Thu, Sep 8, 2011 at 12:17 AM, Ishan Aggarwal 
 
  ishan.aggarwal.1...@gmail.com wrote:
   Do anyone know what kind of questions facebook ask in their coding
   interview??
   Wht should I prepare...
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  The more you sweat in the field, the less you bleed in war.
 
  Ankit Minglani
  NITK Surathkal

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Kind Regards
 Ishan Aggarwal
 [image: Aricent Group]
 Presidency Tower-A, M.G.Road,Sector-14
 Gurgaon,Haryana.122015 INDIA
 Phone : +91-9654602663
 ishan2.aggar...@aricent.com puneet.ar...@aricent.com




 --
 Kind Regards
 Ishan Aggarwal
 [image: Aricent Group]
 Presidency Tower-A, M.G.Road,Sector-14
 Gurgaon,Haryana.122015 INDIA
 Phone : +91-9654602663
 ishan2.aggar...@aricent.com puneet.ar...@aricent.com

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Best Regards,
Harshal Choudhary.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] computer organization

2011-09-08 Thread vishwa
It depends on Address Bus... whether its 32bit or 64 bit... its like can
address bus hold that address.

On Fri, Sep 9, 2011 at 9:40 AM, bharatkumar bagana 
bagana.bharatku...@gmail.com wrote:

 To access a data element , processor has to have the address of that data
 element .. for that, processor should have some register or address bus or
 some thing like that to fetch the data ...what is the limitation from
 processor side in extending the memory?
 and also what is the limitation from processor side in extending RAM size ?
 like while buying a laptop or a system he gives the limitation like up to 8
 GB extendable for RAM...based on what will he give that constraint ?


 On Thu, Sep 8, 2011 at 9:23 PM, Aditya Virmani 
 virmanisadi...@gmail.comwrote:

 wht do u mean by tht qn? i didn get it...OS isnt processing any data...it
 just simply maintains the imaging  indexing operations...wht do u mean by
 managing...? accessing involves use of indexing  seeking to the particular
 data point...

 On Thu, Sep 8, 2011 at 3:41 PM, bharatkumar bagana 
 bagana.bharatku...@gmail.com wrote:

 can any one tell me how a processor supports an external hard disk with
 huge memory like 1000 TB ?
 what are the requirements needed to access a data element in that drive?

 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT

2011-09-08 Thread bharatkumar bagana
@himansu: how can quicksort selecting kth largest element be done in O(n)
time ...I think in worst case it takes O(n^2) time 
will u pls explain this.

On Fri, Sep 9, 2011 at 2:10 AM, Himanshu Neema 
potential.himansh...@gmail.com wrote:

 @Dave: Thanks for pointing that out .

 In that case , if tree is really big and we want to *save memory* :
 *Algorithm #1 :*
 1) Convert tree to a linked list ( Right rotation or left rotation )  :
 O(n)
 2) Quick Select Kth largest element : Worst case O(n^2) ( when tree was
 already a bst + if we chose pivot to be fist node of linked list everytime)
 3) apply second phase of DSW algorithm to recreate the tree.  O(n)
 Time :  O(n^2)
 Space: O(1)
 Bonus : After fist call tree is perfectly balanced

 If tree is small , we want  to *save run time* :
 *Algorithm #2 :*
 1) Traverse tree , store elements in array : O(n)
 2) Quick Select Kth largest element : O(n)
 Time : O(n)
 Space : O(n)




 On Thu, Sep 8, 2011 at 8:58 AM, Dave dave_and_da...@juno.com wrote:

 @Himanshu: You apparently are assuming that the data is presented in a
 binary search tree, but the original problem stated that the data is
 presented in an unordered array. You need to account for the
 complexity of forming the bst and how much space it will take.

 Dave

 On Sep 7, 7:20 pm, Himanshu Neema potential.himansh...@gmail.com
 wrote:
  Do reverse inorder and count number of nodes visited, Kth visited node
 will
  be Kth largest.
  Time : O(n)
  Space : O(1)
 
  On Mon, Sep 5, 2011 at 5:16 PM, bharatkumar bagana 
 
 
 
  bagana.bharatku...@gmail.com wrote:
   @monish:
   u'rs is correct , time =O(nlogn) Ok but, the constant behind this prog
 is
   very huge ..
   for every number coming in , u maintain minheap and maxheap,and also
 if the
   sizes are of mismatch , u delete from minheap and add that to max
 heap---
   here deletion--O(logn),addition--O(logn),this occurs on an average for
   every 3 elements ...
 
   On Mon, Sep 5, 2011 at 2:08 AM, sachin goyal monugoya...@gmail.com
 wrote:
 
   @anup,@sukran ithink u both are right in case of binary search
 tree...
   we can traverse and then easily find the value...
   but in case of heap first we have to create the heap and accordingly
 apply
   the algo the create min heap.
   it will be the complex program
   so simple is bst just traverse by inorder and compare
   if anyone has simple solution or any other case then plz tell.
 
   On Sun, Sep 4, 2011 at 9:56 PM, monish001 monish.gup...@gmail.com
 wrote:
 
   ALGO:
   1. For each element 1 to k:
 insert in into min-heap
   2. for each element k+1 to n
 delete the root of min-heap and insert this item into the min-
   heap
   3. Finally you have a min-heap of k largest numbers and the root is
   your answer
 
   COMPLEXITY: O(n logn)
 
   -Monish
 
   On Sep 3, 3:03 pm, teja bala pawanjalsa.t...@gmail.com wrote:
//Asked in MS please help me with the coding or Give an algorithm
 
Write code to return the kth largest element in a tree ...
 function
prototype is int fucnkth(node *root,int k)
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
   --
 
   **Please do not print this e-mail until urgent requirement. Go Green!!
   Save Papers = Save Trees
   *BharatKumar Bagana*
   **http://www.google.com/profiles/bagana.bharatkumar
 http://www.google.com/profiles/bagana.bharatkumar
   *
   Mobile +91 8056127652*
   bagana.bharatku...@gmail.com
 
--
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.- Hide quoted text -
 
  - Show quoted text -

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To 

Re: [algogeeks] computer organization

2011-09-08 Thread bharatkumar bagana
@vishwa : Only addr bus!! or opcode also needed to fit in the register
think of it .. and 2nd quest(RAM limitation)ans?

On Fri, Sep 9, 2011 at 10:06 AM, vishwa vishwavam...@gmail.com wrote:

 It depends on Address Bus... whether its 32bit or 64 bit... its like can
 address bus hold that address.


 On Fri, Sep 9, 2011 at 9:40 AM, bharatkumar bagana 
 bagana.bharatku...@gmail.com wrote:

 To access a data element , processor has to have the address of that data
 element .. for that, processor should have some register or address bus or
 some thing like that to fetch the data ...what is the limitation from
 processor side in extending the memory?
 and also what is the limitation from processor side in extending RAM size
 ? like while buying a laptop or a system he gives the limitation like up to
 8 GB extendable for RAM...based on what will he give that constraint ?


 On Thu, Sep 8, 2011 at 9:23 PM, Aditya Virmani 
 virmanisadi...@gmail.comwrote:

 wht do u mean by tht qn? i didn get it...OS isnt processing any data...it
 just simply maintains the imaging  indexing operations...wht do u mean by
 managing...? accessing involves use of indexing  seeking to the particular
 data point...

 On Thu, Sep 8, 2011 at 3:41 PM, bharatkumar bagana 
 bagana.bharatku...@gmail.com wrote:

 can any one tell me how a processor supports an external hard disk with
 huge memory like 1000 TB ?
 what are the requirements needed to access a data element in that drive?

 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

**Please do not print this e-mail until urgent requirement. Go Green!!
Save Papers = Save Trees
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
*
Mobile +91 8056127652*
bagana.bharatku...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT

2011-09-08 Thread praveen raj
Through heapsort

k times...
O(klogn)
.

With regards,

Praveen Raj
DCE-IT praveen0...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] computer organization

2011-09-08 Thread vishwa
I suggest you read virtual memory concept one more time(Galvin (OS
priciples))...  and of course as you said CPU registers also matters...
RAM extension is mainly depends on processor...whether it is 16 bit or 32 or
64... You check the entry for PHYSICAL ADDRESS EXTENSION in wikipedia.. hope
that will clear yoy

On Fri, Sep 9, 2011 at 10:10 AM, bharatkumar bagana 
bagana.bharatku...@gmail.com wrote:

 @vishwa : Only addr bus!! or opcode also needed to fit in the register
 think of it .. and 2nd quest(RAM limitation)ans?


 On Fri, Sep 9, 2011 at 10:06 AM, vishwa vishwavam...@gmail.com wrote:

 It depends on Address Bus... whether its 32bit or 64 bit... its like can
 address bus hold that address.


 On Fri, Sep 9, 2011 at 9:40 AM, bharatkumar bagana 
 bagana.bharatku...@gmail.com wrote:

 To access a data element , processor has to have the address of that data
 element .. for that, processor should have some register or address bus or
 some thing like that to fetch the data ...what is the limitation from
 processor side in extending the memory?
 and also what is the limitation from processor side in extending RAM size
 ? like while buying a laptop or a system he gives the limitation like up to
 8 GB extendable for RAM...based on what will he give that constraint ?


 On Thu, Sep 8, 2011 at 9:23 PM, Aditya Virmani virmanisadi...@gmail.com
  wrote:

 wht do u mean by tht qn? i didn get it...OS isnt processing any
 data...it just simply maintains the imaging  indexing operations...wht do 
 u
 mean by managing...? accessing involves use of indexing  seeking to the
 particular data point...

 On Thu, Sep 8, 2011 at 3:41 PM, bharatkumar bagana 
 bagana.bharatku...@gmail.com wrote:

 can any one tell me how a processor supports an external hard disk with
 huge memory like 1000 TB ?
 what are the requirements needed to access a data element in that
 drive?

 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --

 **Please do not print this e-mail until urgent requirement. Go Green!!
 Save Papers = Save Trees
 *BharatKumar Bagana*
 **http://www.google.com/profiles/bagana.bharatkumarhttp://www.google.com/profiles/bagana.bharatkumar
 *
 Mobile +91 8056127652*
 bagana.bharatku...@gmail.com


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] ACM

2011-09-08 Thread Manish Verma
Hey, anyone preparing for acm-icpc

what about discussing acm-icpc questions here
what say @shady??

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Kth largest element

2011-09-08 Thread praveen raj
I am considering..

Maxheapify... A[parent(i)]=A[i]
kth largest element...
therefore O(klogn)...
k times u have to extract the largest element and logn to maintain the
maxheapify everytime.

minheapifyA[parent(i)]=A[i]
kth largest element that means ... (n-k) smallest element.
therefoe... O((n-k)logn)...



With regards,

Praveen Raj
DCE-IT 3rd yr

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] ACM

2011-09-08 Thread Kunal Patil
Cool.. If you can share/ask algorithm related programming questions.. :)
In fact it is the main cause of this group. :) :) :)
There are sufficient SPOJ problem discussions over here..
You can continue asking questions if you think, that particular problem
needs special data handling techniques to make it pass all the large test
cases... :)

On Fri, Sep 9, 2011 at 11:00 AM, Manish Verma jalsa.n.sa...@gmail.comwrote:

 Hey, anyone preparing for acm-icpc

 what about discussing acm-icpc questions here
 what say @shady??

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] stack implementation with a constraint

2011-09-08 Thread surender sanke
maintain a hash of freq,linked_list
linked_list consists of values of that frequency.
values with same frequency comes under same list
if pop of a particular value is done, then frequency is changed of that
number, a new record would be created if required.
maintain two values tracking max and second_max, which would track of
highest frequency value.
let me know ur suggestions

surender

On Wed, Sep 7, 2011 at 1:03 PM, kARTHIK R k4rth...@gmail.com wrote:

 The frequency is also stored in the heap right? So to do heapify based on
 frequency, first you have to spot the element on the heap. That itself will
 take O(n). [ Heapfying after that takes only O(log n) ] If you use a hashmap
 and store frequencies, and each time mostFrequent is called, do a linear
 search on the map, it will have the same complexity. Can anyone come up with
 a better solution?


 Karthik R,
 RD Engineer,
 Tejas Networks.



 On Wed, Sep 7, 2011 at 8:49 AM, *$* gopi.komand...@gmail.com wrote:

 HI,
  Need logic to implement a stack which should support push , pop , top as
 well as mostFrequent. mostFrequent should return the most frequently pushed
 element.

 I have provided the following logic
 have one general stack implementation and one Heap .. (Heapify based on
 frequeny not based on element value)

 can any one tell me the time complexity for the above logic .. as well as
 any other good algo for the same.

 Thx,
 --Gopi

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] ACM

2011-09-08 Thread Piyush Kapoor
Go Go Go!!!

On Fri, Sep 9, 2011 at 11:07 AM, Kunal Patil kp101...@gmail.com wrote:

 Cool.. If you can share/ask algorithm related programming questions.. :)
 In fact it is the main cause of this group. :) :) :)
 There are sufficient SPOJ problem discussions over here..
 You can continue asking questions if you think, that particular problem
 needs special data handling techniques to make it pass all the large test
 cases... :)


 On Fri, Sep 9, 2011 at 11:00 AM, Manish Verma jalsa.n.sa...@gmail.comwrote:

 Hey, anyone preparing for acm-icpc

 what about discussing acm-icpc questions here
 what say @shady??

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
*Regards,*
*Piyush Kapoor,*
*2nd year,CSE
IT-BHU*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] sorting

2011-09-08 Thread praveen raj
for checking whther given array sorted or not... bubble sort or insertion
sort... takes O(n).. time...

With regards,

Praveen Raj
DCE-IT 3rd yr
735993
praveen0...@gmail.com



On Thu, Sep 8, 2011 at 11:32 PM, aayush jain ajain...@gmail.com wrote:

 thanx @piyush

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.