);
vc.push_back(2);
cout endl longest_sequence(vc);
return 0;
}
NIshant Pandey
Cell : 9911258345
Voice Mail : +91 124 451 2130
On Mon, Jan 27, 2014 at 4:29 PM, Amol Sharma amolsharm...@gmail.com wrote:
Given an array of positive numbers arranged in any order. You have to find
the length of longest
);
Permute(str,start+1,end);
swap(str,start,i);
}
}
}
int main()
{
char Str[]=aba;
Permute(Str,0,strlen(Str)-1);
return 0;
}
NIshant Pandey
Cell : 9911258345
Voice Mail : +91 124 451 2130
On Tue, Jan 7, 2014 at 4:44 PM, kumar raja rajkumar.cs...@gmail.com wrote:
This u
...@gmail.comwrote:
From StackOverflow,
---
fgets() can decode UTF-8 encoded files if you use Visual Studio 2005 and
up. Change your code like this:
infile = fopen(inname, r, ccs=UTF-8);
On Sat, Nov 23, 2013 at 8:25 PM, Nishant Pandey
nishant.bits.me...@gmail.com wrote
+ 2]; /* 2 Extra for \0 \n */
memset(buff,0,sizeof(buff));
/* fgets reads max one less than provided length so adding 1 */
while (NULL != fgets(buff,MAX_BUFF+1,fd))
printf(%d\n, non_ascii_count(buff));
return 0;
}
On Tue, Nov 26, 2013 at 7:43 PM, Nishant Pandey
nishant.bits.me
if you use Visual Studio 2005 and
up. Change your code like this:
infile = fopen(inname, r, ccs=UTF-8);
On Sat, Nov 23, 2013 at 8:25 PM, Nishant Pandey
nishant.bits.me...@gmail.com wrote:
Q) *C program* that reads multiple UTF-8 encoded strings from STDIN (1
string per line), count all *non
Q) *C program* that reads multiple UTF-8 encoded strings from STDIN (1
string per line), count all *non-ascii* characters (ascii characters are
with ordinal decimal 0 to 127) and print the total non-ascii character
count to STDOUT (1 number per line).
Contraint :
- You cannot use any
juat want to ask why the last region was not flipped from o to x?
On Tue, Jun 11, 2013 at 11:57 PM, Don dondod...@gmail.com wrote:
// Flip a region including location (x,y) from from to to.
// Returns true if region is surrounded.
bool flip(char board[][], int n, int x, int y, char from,
does that means displaying only boundary elements of tree and if yes in
which order ?
*My Answer* :
I think it would be something like doing preorder travesal of left subree
with boundary elements and leaf elements of left subtree + post order
traversal of right subtree with boundary element and
17:52, rohit jangid rohit.nsi...@gmail.com wrote:
you are doing it correct.
On Sat, May 25, 2013 at 5:37 PM, Nishant Pandey
nishant.bits.me...@gmail.com wrote:
I am not getting the y priority Q is getting used for this question, as
in case of P Queue, things are arranged as per
.
On Sun, May 26, 2013 at 9:36 AM, Ravi Ranjan ravi.cool2...@gmail.comwrote:
Rope
On Sat, May 25, 2013 at 10:24 PM, Nishant Pandey
nishant.bits.me...@gmail.com wrote:
In one of the interview it was asked, can some one suggest good DS for
this.
Thanks
--
You received this message
The solution could be given in this way.
1) In one pass get the end index of both array says e1 and e2.
2) now in next pass compare elements at e1 and e2 .
a) if a(e1) a(e2) swap the elements and then decreament e1 and e2 both.
b) if a(e1) a(e2) decreament e2.
c) if a(e1) == a(e2) then
@DOn can u explain ur first algo, it would be helpful.
On Wed, May 22, 2013 at 7:28 PM, Don dondod...@gmail.com wrote:
My program works with any numbers.
Don
On May 22, 3:45 am, Pramida Tumma pramida.tu...@gmail.com wrote:
This above program works only if the array contains consecutive
I am not getting the y priority Q is getting used for this question, as in
case of P Queue, things are arranged as per the priority so when we will
insert the data we can simply increament the priority.
Algo would be like this :
Enque(q, data) {
push(q, data, increrase the prioroty);
}
int
In one of the interview it was asked, can some one suggest good DS for this.
Thanks
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I have a list of N teams T1, T2, T3 … Tn. Each of these teams has played a
match against every other team. I have a function displayResult(Team T1,
Team T2), it returns the team which won the match between any two given
teams T1 and T2.
I have to write the teams in an order such the (n-1)th team
the ranking should be A,B,C. But based on
the third game, C should be ranked higher than A.
Don
On May 23, 11:06 am, Nishant Pandey nishant.bits.me...@gmail.com
wrote:
I have a list of N teams T1, T2, T3 … Tn. Each of these teams has played
a
match against every other team. I have
I want to implement rope data stucture from scratch in c , is there any
good material that can help me implement this with ease.
Thanks
Nishant
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To unsubscribe from this group and stop receiving
On Sunday, May 5, 2013 9:10:37 PM UTC-5, Dave wrote:
@Nishant: I'm assuming that you don't know the number of words in the
file, and that you don't want to store them all. Here is an algorithm that
requires you to store only two words and an integer.
Assume double function random() returns
i think u should utilize the property of XOR, this would help.
On Wed, May 8, 2013 at 12:02 AM, MAC macatad...@gmail.com wrote:
I was asked this in recent amazon onsite interview and asked o write code
Given an Array of integers . N elements occur k times and one element
occurs b times, in
This is my code snippet
#include iostream.h
#include string
#include set
#include map
#include vector
#include sstream
#include cctype
using namespace std;
void work() {
mapstring, int name_age;
mapint,string index_name;
mapint,string index_name_temp;
std::map int, string ::iterator it;
Hi Guys,
In this problem i am wondering how it will be done without extra memory
space, though we can easily do it with hashing and random funcs().
Is there any solution for this , Please help.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
Guys i am looking for optimize algorithm for this, please help.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To unsubscribe from this group and stop receiving emails from it, send an email
to algogeeks+unsubscr...@googlegroups.com.
For
of their set bits and after that in second loop
we are xoring only odd ones whose bits are set and we get our ans in
variable x and y.
Hope u got it .
On Fri, Apr 19, 2013 at 11:30 PM, kartik n kartik.car...@gmail.com wrote:
Hi Nishant i did not understand the code can u please describe a bit
Thanks
int main() {
int a[] = {1,2,2,3,3,3,4,4};
int size = sizeof(a)/sizeof(a[0]);
int xorr=0;
for(int i=0;isize;i++) {
xorr^=a[i];
}
int x=0,y=0;
int xor1=xorr ~(xorr-1);
for(int i=0;isize;i++) {
if(xor1 a[i]) x^=a[i];
else y^=a[i];
}
cout xy;
}
in this 1 and 3 would be output. as it
what the issue with this , while doing inorder traversal check if left and
right both are null its ur leaf node else keep traversing.
If i couldn't understood ur problem , please explain again.
On Sat, Mar 16, 2013 at 7:44 PM, Megha Agrawal megha1...@iiitd.ac.inwrote:
Hello all,
Is it
-right)) cout root-data;
}
*
*let me knw if anything seems confusing.
On Sun, Mar 10, 2013 at 4:59 PM, Nishant Pandey
nishant.bits.me...@gmail.com wrote:
i have few questions regarding ur problems pratik :
1) A tree with only parent pointer, how to find LCA?
Doubt : do u mean only root
i have few questions regarding ur problems pratik :
1) A tree with only parent pointer, how to find LCA?
Doubt : do u mean only root of the tree is given , i am assuming root along
with two nodes address whose lca need to
find too is given , i am right ?
2) Find top k searched elements
some thing like would work.
int find(int x ) {
int p = sqrt(x/2);
int total=0;
float y;
for( int i=0;i=p;i++) {
y=sqrt(x*x-i*i);
if( y(int) == y) total++;
}
return total;
}
find(
}
On Thu, Feb 14, 2013 at 10:22 AM, Shachindra A C sachindr...@gmail.comwrote:
Guneesh,
Thanks for the
i think what aditya suggested is cool but in that instead of going for
largest element we need to search smallest value and its index would he
number we are looking for.
On Sun, Feb 24, 2013 at 7:45 PM, Dave dave_and_da...@juno.com wrote:
@Marti: If you know m and k, and if m is even and k is
+1 for above approach , its called memotization .. it helps reducing
redundant recursive call for the same matter.
On Thu, Feb 21, 2013 at 2:29 PM, Karthikeyan V.B kartmu...@gmail.comwrote:
Assuming that u can either move down or right,
Using Dynamic Programming,
a DP equation can be framed
what would happen of the input is like this : 5, 5, 66, 66, 7, 1, 1, 77,7
i think in this case the moment window reaches to point (66,7,1) it will
take 7 as unique number but
that too window will not move any futhur , but 7 is not unique .
Please comment if i misunderstood ur explanation .
i already said this is not possible , in my intial draft , as we dont have
any information of memory owner in called function , just have base address
which is address of single element of the array .
On Wed, Jan 30, 2013 at 1:55 PM, Prem Krishna Chettri hprem...@gmail.comwrote:
@Piyush ..
i think this is not possible as you are passing only base address of the
int array to it , there is not information about the owner .
On Mon, Jan 28, 2013 at 3:44 PM, Anil Sharma anilsharmau...@gmail.comwrote:
How to calculate the size/lenght of an int array which is passed as an
ONLY argument
no i am using C for this implementation , can you suggest me algo for this
On Tue, Jan 8, 2013 at 5:55 PM, Sachin Maheshwari
sachin.maheshw...@gmail.com wrote:
If you are using Java, you can go with LinkedHashMap.
On Sat, Jan 5, 2013 at 6:40 PM, Nishant Pandey
nishant.bits.me
Give a Data structure to store Name-value pair like name-age
abc,12
xyz,34...
such than insert(name,value), value = search(name), name = nthentry(n),
delete(name); all can be perfomed in O(1).
Note:- after deletion order should be maintained.Ex.
ds,12
df,78
teu,54
etr,12
If delete(df) is called
i think arr[10] and int *arr are two different declaration when ,when
compiler tried to link with the memory of int arr[10] it could nt find it ,
as u have declraed it to be integer type pointer , and in file 1 it could
find integer pointer .
On Wed, Oct 24, 2012 at 11:06 PM, rahul sharma
can some body please explain voting algo to me .
On Wed, Jul 11, 2012 at 12:42 PM, Navin Kumar algorithm.i...@gmail.comwrote:
@sachin:
http://valis.cs.uiuc.edu/~sariel/research/CG/applets/linear_prog/median.html
On Wed, Jul 11, 2012 at 12:28 PM, sachin goyal
, Abhishek Sharma abhi120...@gmail.comwrote:
@nishant, you wrote until both the distance becomes equal.Which
distances ? Could you please elaborate ?
On Thu, Jul 5, 2012 at 12:52 PM, Ashish Goel ashg...@gmail.com wrote:
struct node* intersection( struct node *pL1, struct node* pL2)
{
if ((!pL1
function call
//swap()
flag[str[i]=1;
}
done
On 7/3/12, Nishant Pandey nishant.bits.me...@gmail.com wrote:
1) Find all permutations of a string.
2) Improve it so that the permutations are not repeated, Eg= string is
Answer should be just once not 4! times
get the size of both the linked list say d1,d2 ;
get their diff like df=abs(d1-d2);
now take 2 pointers both poiting to the start of both the linked list .
go to bigger list now move this pointer until both the distance becomes
equal .
at this point we have one pointer from smaller list pointing
1) Find all permutations of a string.
2) Improve it so that the permutations are not repeated, Eg= string is
Answer should be just once not 4! times.
i want suggestion to improve the recursive code in case of 2) case .
--
You received this message because you are subscribed to the
printPath(node *p,node *child)
{
if( p child)
std::cout Path: p-data =child-data
std::endl;
}
use this before you assign 'current' to its children.
e.g.
printPath(p,p-left)
or
printPath(p,p-right);
--
Amitesh
On Mon, Jun 25, 2012 at 11:34 PM, Nishant
)
//coutcurrent-dataendl;
current=current-right;
if(current)
i++;
}
}
}
}
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message
://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
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.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan
I am asking again .. can any one please suggest better method for getting
the median on the longest path of the tree ..
efficient method .
On Tue, Jun 19, 2012 at 5:08 PM, Nishant Pandey
nishant.bits.me...@gmail.com wrote:
for getting diameter we can simply add the max height of left subtree
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you are subscribed to the Google
this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
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.
--
Cheers,
Nishant Pandey
/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
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.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received
/algogeeks/-/54GHWSwHHw8J.
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.
--
Cheers,
Nishant Pandey
://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you
://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you
+ i) = *(char *)(data + i);
temp-next = *p;
*p = temp;
}
void(List *p,void (*f)(void*))
{
while (p)
{
(*f)(p-data);
p = p-next;
}
}
void printstr(void *str)
{
printf( \%s\, (char *)str);
}
Regads
Nishant Pandey
On Thu, May 31, 2012 at 1:15 PM, Hassan
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Cheers,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
You received this message because you are subscribed to the Google Groups
,
Nishant Pandey |Specialist Tools Development |
npan...@google.comgvib...@google.com |
+91-9911258345
--
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
@abhi
we can do it without passing the address to a function. just store the
address of const variable in another variable and change the value...
On Mon, Jul 18, 2011 at 11:56 AM, Abhi abhi123khat...@gmail.com wrote:
Perhaps the only way to alter the value of a variable declared constant in
C
1.Calculate XOR of all the array elements.
2.XOR the result with all numbers from 1 to n =x1
3.After 2nd step, all elements would nullify each other except 2 missing
elements(let x and y) and x1 will contain XOR of x and y
4.All the bits that are set in x1 will be set in either x or y. Get the
@ankit...i m assuming that array of size n contains n-2 elements with 2
elements missing
On Mon, Jul 18, 2011 at 6:07 PM, SAMMM somnath.nit...@gmail.com wrote:
#includestdio.h
int main()
{
int a[]={1,2,3,5,2}; // 2 isrepeated and 4 is missing
int i=0,x=0,j=0,bit;
while(i5)
{
ok then 1st remove duplicates from the array in O(n) then apply my algo...
On Mon, Jul 18, 2011 at 6:13 PM, ankit sambyal ankitsamb...@gmail.comwrote:
@Nishant: Read the question carefully. It says Each number is present
at least once except for 2 numbers.
--
You received this message
@SkRiPt KiDdIe... I think you need to analyze my algo again it will work
for both the cases...
On Mon, Jul 18, 2011 at 6:33 PM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote:
Nishant. Your algorithm works for finding repeated nos. in a [n+2] array
where [1-n] are present atleast once
@ankit for removing duplicates=O(n)+O(n)
On Mon, Jul 18, 2011 at 6:36 PM, ankit sambyal ankitsamb...@gmail.comwrote:
@nishant : Time complexity ?? will increase too much
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
and for finding missing 2 elements= O(n)+O(n)+O(n)+O(n)
so total will be O(n)
but there will be no overflow
On Mon, Jul 18, 2011 at 6:41 PM, Nishant Mittal
mittal.nishan...@gmail.comwrote:
@ankit for removing duplicates=O(n)+O(n)
On Mon, Jul 18, 2011 at 6:36 PM, ankit sambyal
@SkRiPt KiDdIe... see my 3rd post...i've mentioned that 1st we have to
remove duplicate numbers
On Mon, Jul 18, 2011 at 6:56 PM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote:
@Nishant:
1 4 5 4 5n=5
1 2 3 4 5
after xor i.e. your x1 answer contains (2^3^4^5).The missing elements
start from top right corner... if a[i][j] x then move left, else if
a[i][j] x then move down and if a[i][j] == x then print i and j
On Mon, Jul 18, 2011 at 11:30 PM, sivaviknesh s sivavikne...@gmail.comwrote:
-- Forwarded message --
From: sivaviknesh s
value of the static variable persists between different function call
On Mon, Jul 18, 2011 at 11:43 PM, geek forgeek geekhori...@gmail.comwrote:
int main()
{
static int var = 5;
printf(%d ,var--);
if(var)
main();
}
y output is 5 4 3 2 1
not 5 5 5 5 5 5 5 5 5
1st convert base 5 to base 10 and then base 10 to base 9
On Mon, Jul 18, 2011 at 11:54 PM, sivaviknesh s sivavikne...@gmail.comwrote:
convert a number in base 5 to base 9
--
Regards,
$iva
--
You received this message because you are subscribed to the Google Groups
Algorithm
void rev_recursion(NODE **head)
{
if(*head==NULL)
return;
NODE *first, *rest;
first=*head;
rest=first-next;
if(!rest)
return;
rev_recursion(rest);
first-next-next=first;
first-next=NULL;
*head=rest;
}
On Sun, Jul 17, 2011 at 2:53 PM, vaibhav shukla
take 2 arrays before and after... before[i] contains the product of all the
numbers before i and after[i] contains product of all the numbers after i
something like this
before[0]=1;
after[n-1]=1;
for(i=1;in;i++)
{
before[i]=a[i-1]*before[i-1];
1.while typing it must show most popular searches starting from the string
which we have typed so far
2.it must show most popular websites first
3.it must show related searches
there can be many more
On Sun, Jul 17, 2011 at 8:05 PM, swetha rahul swetharahu...@gmail.comwrote:
Write
1.If string is NULL then it should return 1 i.e. string is palindrome
2.If there is only one character in string then it is palindrome
3.If reverse of given string is same as string
On Jul 17, 8:18 pm, swetha rahul swetharahu...@gmail.com wrote:
ya got it..thanks...
how abt test cases for
will be O(n) this won't work for large numbers...
On Sat, Jul 16, 2011 at 1:58 AM, Nishant Mittal
mittal.nishan...@gmail.com wrote:
@sagar... I know this solution but it was strictly asked to do in O(n)
time and O(1) space complexity and what if range of numbers is very
large
value of b = 10 (in binary) and since b is a signed integer and also MSB is
1 so final value of b is 2's complement of 10 i.e. -2
On Sun, Jul 17, 2011 at 12:55 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:
@gaurav :y it is -2?y not +2?
On Sat, Jul 16, 2011 at 2:13 PM, sukhmeet singh
delete all the numbers found in list2 from list1 recursively or iteratively
Also optimize ur algo when list1 is sorted in ascending order and list2 is
sorted in descending order
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
How will you delete duplicate odd numbers from a linked list in O(n) time
--
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
to do it in O(n)... rather not even in
O(nlogn) without modifying the list
On Fri, Jul 15, 2011 at 11:23 PM, Nishant Mittal
mittal.nishan...@gmail.com wrote:
How will you delete duplicate odd numbers from a linked list in O(n)
time
--
You received this message because you are subscribed
number of elements from both lists and reverse list with minimum
number of elements, go ahead with checking and deleting linearly
surender
On Fri, Jul 15, 2011 at 10:38 PM, Nishant Mittal
mittal.nishan...@gmail.com wrote:
delete all the numbers found in list2 from list1 recursively
if BST contains integers then sort the postorder traversal which will
give you inorder traversal...
On Jun 30, 6:27 pm, oppilas . jatka.oppimi...@gmail.com wrote:
Is it possible to create a binary search tree (not binary tree) from post
order traversal only?
If give, how and if not please give
segregate even and odd nodes in a singly linked list.Order of even and
odd numbers must be same...
e.g:-
i/p list is 4-1-3-6-12-8-7-NULL
o/p list 4-6-12-8-1-3-7-NULL
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
how to find kth smallest element in BST...
--
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.
in 1st printf no. of characters written are 3 and 4 and 3 4
is 0 which is equal to i
next 3 printf are easy...
now in last printf no. of characters written by 2 printf(s) are 3 and
3 and 3 3 is 3 which is printed by outer printf
On Jun 29, 7:40 pm, ashwini singh asingh...@gmail.com
On Wed, Jun 29, 2011 at 8:18 PM, Nishant mittal.nishan...@gmail.com wrote:
@sunny plz tell me the solution without using extra list...i've solved
it using extra list...
On Jun 29, 7:38 pm, sunny agrawal sunny816.i...@gmail.com wrote:
maintain two pointers one at the tail of even number list one
plz recommend me some good sites for OS interview questions...
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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
do inorder traversal of tree and store values in an array.
Now find pairs by applying binary search on array..
On 6/27/11, manish kapur manishkapur.n...@gmail.com wrote:
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
WAP to sort an array of character strings on the basis of last
character of each string
eg:- {xxxc , yyya, zzzb} = {yyya , zzzb, xxxc}
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
space
On Mon, Jun 27, 2011 at 1:40 AM, Nishant Mittal
mittal.nishan...@gmail.com wrote:
do inorder traversal of tree and store values in an array.
Now find pairs by applying binary search on array..
On 6/27/11, manish kapur manishkapur.n...@gmail.com wrote:
--
You received
@Harshal... ur solution is nt correct.it is nt printing the
characters in order as given in i/p...
i know the solution using auxiliary array and using an extra character
array to hold the o/p string but if any1 knows inplace solution then
plz rply...
On 6/22/11, Harshal hc4...@gmail.com wrote:
It does *not* prevent deadlock so i think (D) is definitely true.
On Sun, Jun 19, 2011 at 5:15 PM, Akshata Sharma
akshatasharm...@gmail.comwrote:
Two processes, P1 and P2, need to access a critical section of code.
Consider the following synchronization construct used by the processes:
/* P1
//Prog 1
#includestdio.h
int main()
{
float a=75.7;
printf(%.10f\n,a); //prints 75.669482
if(75.7a)
printf(Hi);
else
printf(Hello);
return 0;
}
//Prog 2
#includestdio.h
int main()
{
float a=275.7;
printf(%.10f\n,a);//prints 275.7000122070 *WHY???*
if(275.7a)
printf(Hi);
else
conversion frm int to float and float to int is very poor in case of
printf funtion
so when we give the input to t then that value is displayed for all
the printf function
since %f modifier doesn't accept x (int) as
a successful argument so it takes the
latest float value..
On May 22, 2:41 pm,
#includestdio.h
void print1();
void print2()
{
printf(Hello\n);
print1();
}
void print1()
{
printf(Hello\n);
print2();
}
int main()
{
print1();
}
On Thu, Mar 10, 2011 at 11:47 AM, nidhi jain nidhi.jain311...@gmail.comwrote:
@abhishek:isn't it recursion?
--
You
#includestdio.h
main()
{
long x;
float t;
scanf(%f,t);
printf(%d\n,t);
x=90;
printf(%f\n,x);
{
x=1;
printf(%f\n,x);
{
x=30;
printf(%f\n,x);
}
printf(%f\n,x);
}
x==9;
printf(%f\n,x);
}
use recursion.
On Tue, Mar 1, 2011 at 5:13 PM, bittu shashank7andr...@gmail.com wrote:
here we go
void main()
{
int i;
i=1;
loop:
printf(%d, i)
(i100)? i++: return 0;
go to loop;
}
Thanks Regards
Shashank Mani The Best Way to Escape From The Problem is to Solve
it
--
#includestdio.h
#includestdlib.h
int main()
{
int a[20],i,n,max,t,j,k;
printf(Enter the no. of elements\n);
scanf(%d,n);
for(i=0;in;i++)
scanf(%d,a[i]);
for(i=0;in-1;i++)
{
j=n-1;
max=0;
k=i;
while(ij)
{
...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
:-)
*
Nishant Agarwal
Computer Science and Engineering
NIT Allahabad
.
--
:-)
*
Nishant Agarwal
Computer Science and Engineering
NIT Allahabad
*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
1 - 100 of 111 matches
Mail list logo