Re: [algogeeks] Re: constant

2011-10-05 Thread ankit sablok
take a look at this and this is exactly the reason why it works :) http://stackoverflow.com/questions/3801557/can-we-change-the-value-of-a-constant-through-pointers On Thu, Oct 6, 2011 at 9:55 AM, Raghav Garg rock.ragha...@gmail.com wrote: *it is perfectly working in turbo c. can anyone

[algogeeks] explain the putput of this program

2011-09-03 Thread Ankit Sablok
#includeiostream #includecstdio #includecctype #includecstdlib #includecstring using namespace std; int main() { int **h; int a[2][2]={1,2,3,4}; h= (int **)a; int i,j; printf(\n%d,*h); (*h)++; printf(\n%d,*h); getchar(); getchar(); return 0; } gives an output 1 and 5 why?

[algogeeks] Doubt regarding the escape sequences

2011-08-28 Thread ankit sablok
How can I store an escape sequence at each character of the string when i give the string as an input to the program? Can anybody suggest me something other than the method i mention below #includeiostream #includecstdio #includecstring using namespace std; int main() { char s[100];

Re: [algogeeks] Re: Direct - i ques

2011-07-31 Thread ankit sablok
finding min will not take O(1) time in a stack i guess On Mon, Aug 1, 2011 at 10:32 AM, kartik sachan kartik.sac...@gmail.comwrote: I think its stack where deletion insertion and finding min (as we will cal min at the time of insertion only by taking min val ) will take O(1) time correct me

[algogeeks] GETS

2011-07-19 Thread Ankit Sablok
the gets function gives me error when i execute the following code plzz provide suggestions and answers char str[100]; while(n--) { gets(str); puts(str); } suggest alternative methods to solve the anomaly -- You received this message because you are subscribed to the Google Groups

[algogeeks] Re: GETS

2011-07-19 Thread Ankit Sablok
Y is it not recommended to use gets in g++ what is the exact reason can u tell On Jul 19, 4:47 pm, SAMMM somnath.nit...@gmail.com wrote: You can try this :- fgets(buff,sizeof(buff),stdin) .. It is recomended not to use gets in g++ or gcc .. On Jul 19, 4:40 pm, Ankit Sablok ankitsablok19091

Re: [algogeeks] SDE online test

2011-07-14 Thread ankit sablok
where is the link man On Thu, Jul 14, 2011 at 5:28 PM, mohit mohit89m...@gmail.com wrote: Hey guys , is amazon conducting online test for SDE post? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Nagarro Question

2011-06-26 Thread Ankit Sablok
Need a Better Algorithm here is a trivial question we are given an array of 2n elements in the form {a1,a2,a3,..,an,b1,b2,b3b...bn} we need to output a resultiing array in the form {a1,b1,a2,b2,an,bn} but without using another array here is my algorithm which uses nested loops

Re: [algogeeks] Algorithmic Pioneers

2011-06-23 Thread ankit sablok
very nice man nice collection add Petr Mitrichev to this collection On Fri, Jun 24, 2011 at 11:14 AM, rShetty rajeevr...@gmail.com wrote: Collection of Algorithmic Pioneers can be Found here http://openprobe.blogspot.com/2011/06/pioneers-in-algorithm-deisgn-and.html Suggestion for addition

[algogeeks] help me wd the following problem

2011-06-15 Thread Ankit Sablok
Hello friends I am thinking of a combinatorics solution to this problem on spoj but cant come up wd a formula please suggest me some technique to solve this problem http://www.spoj.pl/problems/CHAIR/ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Request for books

2011-06-05 Thread Ankit Sablok
If some one has the following books Algorithms and Data structures in C - Mark Allen Weiss Network Flow Algorithms - by Ahuja please mail it to ankitsablok19091...@gmail.com thanxx in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

[algogeeks] Re: Request for books

2011-06-05 Thread Ankit Sablok
also if one can mail me all the versions of sedgewick I will b grateful On Jun 5, 6:40 pm, Ankit Sablok ankitsablok19091...@gmail.com wrote: If some one has the following books Algorithms and Data structures in C - Mark Allen Weiss Network Flow Algorithms - by Ahuja please mail

[algogeeks] Reuest for a book

2011-05-08 Thread ankit sablok
Please mail the book Data Structures and Algorithms in C by Mark Allen Weiss to the following Id - ankit4...@gmail.com if anyone has d book -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
@all please dnt give the solution to above problem as its a recrutiment problem and recrutiment is still in process On Mon, Apr 25, 2011 at 10:21 PM, hary rathor harry.rat...@gmail.comwrote: if eric start from (start of row) and finn start from end of row then this method enable the continuous

Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
I request u all please dont post solutions to this problem On Mon, Apr 25, 2011 at 10:22 PM, ankit sablok ankit4...@gmail.com wrote: @all please dnt give the solution to above problem as its a recrutiment problem and recrutiment is still in process On Mon, Apr 25, 2011 at 10:21 PM, hary

Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
coz u received this message from co cubes I got the same but we dont loof for soltions online On Mon, Apr 25, 2011 at 10:27 PM, Sudhir mishra sudhir08.mis...@gmail.comwrote: why -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

Re: [algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
Anand please dnt give a solution to it i knw its dp but the compettion is stil open On Mon, Apr 25, 2011 at 10:35 PM, Anand anandut2...@gmail.com wrote: It's a very simple DP Problem. On Mon, Apr 25, 2011 at 9:59 AM, ankit sablok ankit4...@gmail.com wrote: coz u received this message from

[algogeeks] Re: give solution(logic)

2011-04-25 Thread ankit sablok
thanks for not posting a solution to this problem On Apr 25, 11:28 pm, Anand anandut2...@gmail.com wrote: Ok On Mon, Apr 25, 2011 at 10:06 AM, ankit sablok ankit4...@gmail.com wrote: Anand please dnt give a solution to it i knw its dp but the compettion is stil open On Mon, Apr 25

[algogeeks] Please correct the error in my code

2011-04-07 Thread ankit sablok
I have debugged my program from all points of view but i cant find the cause of a wrong answer for this problem http://uva.onlinejudge.org/external/4/406.html here is my source code for the problem #includeiostream #includecstdio #includecstdlib #includevector #includeiostream #includealgorithm

Re: [algogeeks] Bytes'11

2011-02-19 Thread ankit sablok
man the browser is showing me error problem wtf is dis On Sat, Feb 19, 2011 at 7:01 PM, rohit kumra rohit.kumra...@gmail.comwrote: Play the world cup with your codes here. https://www.spoj.pl/BYTES11A/problems/main/ -- You received this message because you are subscribed to the Google

Re: [algogeeks] Bytes'11

2011-02-19 Thread ankit sablok
please look into u all On Sat, Feb 19, 2011 at 7:11 PM, ankit sablok ankit4...@gmail.com wrote: man the browser is showing me error problem wtf is dis On Sat, Feb 19, 2011 at 7:01 PM, rohit kumra rohit.kumra...@gmail.comwrote: Play the world cup with your codes here. https://www.spoj.pl

Re: [algogeeks]

2011-02-19 Thread ankit sablok
all u fuckers please chedck into the problem On Sat, Feb 19, 2011 at 6:57 PM, Troika'11 by...@dcetech.com wrote: Play the world cup here with your codes... https://www.spoj.pl/BYTES11A/problems/main/ -- You received this message because you are subscribed to the Google Groups Algorithm

Re: [algogeeks] Application of Data Structure

2011-02-16 Thread ankit sablok
trie construction would do for this On Wed, Feb 16, 2011 at 10:15 PM, yv paramesh yv.param...@gmail.com wrote: build a tree On Wed, Feb 16, 2011 at 10:10 PM, vaibhav agrawal agrvaib...@gmail.com wrote: Hash, SortedSet On Wed, Feb 16, 2011 at 9:58 PM, bittu shashank7andr...@gmail.com

[algogeeks] Re: question at K10

2011-02-16 Thread ankit sablok
AX is the low order accumulator register used in the microprocessor generally the value returned is from the accumulator if u modify that value it will return the value u set it to as the Register is Divided into 2 parts AH - higher order and AX - lower order the value 10 is stored in AX and is

[algogeeks] Re: question at K10

2011-02-16 Thread ankit sablok
nice solution On Feb 15, 11:22 pm, jagannath prasad das jpdasi...@gmail.com wrote: void change() {    #define i i=10,n} this will do.. On Tue, Feb 15, 2011 at 11:33 PM, Rel Guzman Apaza rgap...@gmail.comwrote: Nothing... 10 in base 5   =   5 in base 10. void change(){    

[algogeeks] resource for java programming language

2011-02-07 Thread ankit sablok
Can anyone tell me a nice resource to study java online also please list some of the most popular books to study the language that has a lucid and detailed explanation of the libraries and packages of the java programmiing language needed for competitive programming please help -- You received

Re: [algogeeks]

2011-02-05 Thread ankit sablok
x is 20 for sure and y i m guessing to be 1 comma operator and 0 used for octal constnts On Sat, Feb 5, 2011 at 3:01 PM, radha krishnan radhakrishnance...@gmail.com wrote: guess the output main() { int x=(1,024),y; y=1,024; printf(%d %d,x,y); } -- You received this

Re: [algogeeks] c programming question

2011-02-04 Thread ankit sablok
the output is 22 13 13 as increment and decrement operators associate from right to left hence first ++a will be evluated which makes a=11 then a++ is evaluated as its a postfix operation hence b=a+a=11+11=22 and after this a =12 then in printf statement again right associativity follows hence ++a

[algogeeks] Suggest a solution using BFS

2011-01-18 Thread ankit sablok
i have been trying this problem first i brute forced it and i was right using brute force but can someone suggest a BFS solution to the problem http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6page=show_problemproblem=347 suggest something better than brute force --

[algogeeks] Suggest a solution using BFS

2011-01-18 Thread ankit sablok
please suggest a solution for this problem using BFS i m nt able to get how we apply bfs here though brute force would do http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6 thnxx in advance please explain in detail so that i become able to tackle such problems in

Re: [algogeeks] bfs doubt

2011-01-18 Thread ankit sablok
one possible solution can be that while storing the graph using adjacency lists u can associate a color variable with each edge so that u color the edge as u traverse it like if u want to check wether edge (u,v) has been traversed while traversing u's adjacecny list check wether (u,v) has been

[algogeeks] help me debug this

2011-01-17 Thread ankit sablok
i dont knw wt wrong i have done in this simple problem bt its nt being accepted at uva judge here is the link to the problem http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6page=show_problemproblem=347 please help me debug my code #includeiostream #includecstdio

Re: [algogeeks] Re: help me debug this

2011-01-17 Thread ankit sablok
i improved upon my code but still i get a presentation error dunno wts the judge judging it shows me the correct way when i output test cases on my compiler but on the judge it says wrong answer or presentation error #includeiostream #includecstdio #includevector #includealgorithm #includecmath

[algogeeks] UVA problems getting wrong answers

2010-12-24 Thread ankit sablok
hii at all i was solving an adhoc problem on uva judge link - http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8page=show_problemcategory=121problem=208mosmsg=Submission+received+with+ID+8477913 and hers my code for the problem but i get wrong answer every tme plzzz help me debug

[algogeeks] ankit sablok wants to chat

2010-12-20 Thread ankit sablok
--- ankit sablok wants to stay in better touch using some of Google's coolest new products. If you already have Gmail or Google Talk, visit: http://mail.google.com/mail/b-a96b6b68ce-69e1b8743a-fR2v0p_gvlyJsBnTMH_Mq01Kcnk You'll

[algogeeks] Array Transform

2010-12-18 Thread ankit sablok
Can any body provide me a program for the following question thanx in advance http://www.codechef.com/problems/ARRAYTRM/ I am applying brute forc here and getting TLE everytime help me out with the problem thanx in advance -- You received this message because you are subscribed to the Google

[algogeeks] Re: Adobe Interview Question

2010-12-14 Thread ankit sablok
what i think is that the number of times foo2 being called is independent of the percentages given in the question it may be called 5000 times or 4999 times and continuinf in this fashion also none of the times as in every case there's 1/4 probability of AB and 3/4 of CD so as per me we cannot

Re: [algogeeks] Re: Adobe Interview Question

2010-12-14 Thread ankit sablok
. Given that CD turns out to be true 75% times.So why the call to foo2 will be independent?? I think it is only the simple math.Correct me if I am wrong.. On 12/15/10, ankit sablok ankit4...@gmail.com wrote: what i think is that the number of times foo2 being called is independent

Re: [algogeeks] Microsoft interview question

2010-12-10 Thread ankit sablok
just search for the word in the document using an efficient string matching algorithm use Knuth Morris Pratt algorithm as it runs in O(m) time. or use a data structure called TRIE where u can search for the word in O(1) time any suggestions are always welcomed On Fri, Dec 10, 2010 at 3:13 PM,

[algogeeks] Re: program for evaluation of remainders

2010-12-10 Thread ankit sablok
dave_and_da...@juno.com wrote: @Ankit: So how does that work with, e.g., N = n = 997? I.e., what is the calculation? Dave On Dec 8, 11:33 am, ankit sablok ankit4...@gmail.com wrote: @ all the authors thanx for the suggestions actually wt i know about the problem is i think we can solve

[algogeeks] just confirming my answer

2010-12-10 Thread ankit sablok
Q) an n-input m-output boolean function is defined as follows (F:{True,False}^n-{True,False} ^m) find the number of n X 1 functions meaning n inputs and 1 output and n X m funcrtions meaning n inputs and m outputs my answer at any time we can reduce the

Re: [algogeeks] Microsoft interview question

2010-12-10 Thread ankit sablok
then u can just use or build a dynamic dictionary of words as done in LZW coding such that if the word is there in the dictionary it just gives u the indx of the word and if its not it just adds that word to the dictionary any suggestions are always welcomed thnx in advance On Fri, Dec 10, 2010

[algogeeks] program for evaluation of remainders

2010-12-08 Thread ankit sablok
Q) can anyboy find me the solution to this problem Given an integer N and an another integer n we have to write a program to find the remainder of the following problems (1! + 2! + 3! + 4! + . + N!)mod(n) N=100 n=1000; please help me write a program for this problem

[algogeeks] help me reduce the time limit

2010-12-08 Thread ankit sablok
please help mewritea program for this problem to reduce the time limit http://www.codechef.com/problems/FLIPCOIN/ thnx in advance i have ben banging my head on this for a full day -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

[algogeeks] Re: program for evaluation of remainders

2010-12-08 Thread ankit sablok
12 =9 hence the answer is 9 so can anyone write a program for this logic On Dec 8, 6:19 pm, ankit sablok ankit4...@gmail.com wrote: Q) can anyboy find me the solution to this problem Given an integer N and an another integer n we have to write a program to find the remainder of the following

[algogeeks] help me find a solution

2010-12-08 Thread ankit sablok
can anyone suggest me how to go about this problem i m finding it quite tough http://www.codechef.com/problems/TEAMSEL/ thanx in advance -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Amazom interview question

2010-12-04 Thread ankit sablok
this is the general task scheduling problem apply greedy algorithms On Sat, Dec 4, 2010 at 10:13 AM, Prims topcode...@gmail.com wrote: You are given 'n' appointments. Each appointment contains startime and endtime. You have to retun all conflicting appointments efficiently starttime and

[algogeeks] GOOGLE SUMMER OF CODE

2010-11-21 Thread ankit sablok
WHEN IS GOOGLE SUMMER OF CODE 2011 BEGINING AND HOW CAN WE APPLY FOR IT AND WHAT ARE THE ELIGIBILITY CRITERIA FOR THE APPLICATION. PLEASE HELP ME OUT WITH THIS APPLICATION PROCEDURE... THNXX IN ADVANCE ANKIT SABLOK B.TECH COMPUTER SCIENCE AND ENGG -- You received this message because you