thanks:)
--
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
+ Manish Patidar
On Thu, Jul 26, 2012 at 10:14 PM, Manish Patidar wrote:
> 20
> Thank you,
> Have a great day !!
>
>
>* With Regards,
> *
> *
> Manish Patidar.*
>
>
>
> On Thu, Jul 26, 2012 at 11:11 PM, payal gupta wrote:
>
>> ans.20
>>
>>
>> On Thu, Jul 26,
20
Thank you,
Have a great day !!
* With Regards,
*
*
Manish Patidar.*
On Thu, Jul 26, 2012 at 11:11 PM, payal gupta wrote:
> ans.20
>
>
> On Thu, Jul 26, 2012 at 11:09 PM, Ali Ahmad Ansari <
> ali.ahamad.ans...@gmail.com> wrote:
>
>> Given a number N, gene
ans.20
On Thu, Jul 26, 2012 at 11:09 PM, Ali Ahmad Ansari <
ali.ahamad.ans...@gmail.com> wrote:
> Given a number N, generate a sequence S such that
> S[ 0 ] = N
> S[ i+1 ] = (3 * S[ i ] + 1) / 2 if S[ i ] is odd,
> = S[ i ] / 2, if S[ i ] is even,
> till you reach 1.
> For example for N = 5, the
Given a number N, generate a sequence S such that
S[ 0 ] = N
S[ i+1 ] = (3 * S[ i ] + 1) / 2 if S[ i ] is odd,
= S[ i ] / 2, if S[ i ] is even,
till you reach 1.
For example for N = 5, the sequence is 5, 8, 4, 2, 1
Given two numbers 20 and 35, generate the sequence S for A
and B, and find the numbe
/Convert roman to decimal
#include
int convert(char *s, int len)
{
int i = 0, d = 0, prev = 0;
for(;i < len; i++)
{
switch(*(s+i))
{
case 'i': d += 1;
break;
case 'v': if(i!=0 && *(s+prev) == 'i')
{
d = d + 5 - 2;
}
else
i.p: v
o/p 5
i/p ix
o/p:9
--
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
Use hashing like counting sort...
On Wed, Sep 14, 2011 at 11:20 AM, raj wrote:
> program to find the top 3 repeating number from the given array
> eg
> You r given an array and u have to find out the top 3 repeated
> numbers.
> for ex: GAURAV[]={20,8,3,7,8,9,20,6,4,6,20,8,20}
> so the output wi
Create a structure
with num,count(of num) and link
parse the array and create nodes (nodes are created with id=num).
when the no of nodes == 3 print the nodes data and count.
On Wed, Sep 14, 2011 at 5:13 PM, parag khanna wrote:
>
> find the frequencies of each alphabet ... n store it in an array
find the frequencies of each alphabet ... n store it in an array
corressponding to the ascii value of the alphabet as a index of array ... n
store its count ... then sort the array in decreasing order ... and return
the top 3 index value of the array in integer form
--
> Parag Khanna
> B.tech
heap construction ...
On Wed, Sep 14, 2011 at 4:44 PM, bharatkumar bagana <
bagana.bharatku...@gmail.com> wrote:
> with space O(n) and time O(n), we can trace the whole array and maintain
> the freq of each number and by one more trace with using 3 variables ,
> we can find top 3
>
>
with space O(n) and time O(n), we can trace the whole array and maintain the
freq of each number and by one more trace with using 3 variables , we
can find top 3
On Wed, Sep 14, 2011 at 11:20 AM, raj wrote:
> program to find the top 3 repeating number from the given array
> eg
> You
program to find the top 3 repeating number from the given array
eg
You r given an array and u have to find out the top 3 repeated
numbers.
for ex: GAURAV[]={20,8,3,7,8,9,20,6,4,6,20,8,20}
so the output will be: 20 is repeated 4 times 8 is repeated 3 times 6
is repeated 2 times.
--
You received t
http://geeksforgeeks.org/?p=7150
that will clear you very well.i'm sure...
On Mon, Aug 15, 2011 at 4:48 PM, programming love <
love.for.programm...@gmail.com> wrote:
> write a program to reverse the words in a give string.
> also state the time complexity of the algo.
>
> if the string is "i
First reverse the senetence word by word and then reverse the whole
stringthat will be easier
On Mon, Aug 15, 2011 at 4:48 PM, programming love <
love.for.programm...@gmail.com> wrote:
> write a program to reverse the words in a give string.
> also state the time complexity of the algo.
>
@gopi: Each word is being accessed thrice.
1. reverse string
2. set pointers to beginning n end of string
3. reverse the word.
If this is the came is the complexity O(n)??
It's a very good algo nevertheless :)
On Mon, Aug 15, 2011 at 9:16 PM, *$* wrote:
> method 1:
> algo:
> step 1 :reverse
method 1:
algo:
step 1 :reverse entire string .. (letter by letter)
step 2: take two pointers ... keep first pointer at the starting of the word
... keep incrementing the second pointer , till space hits.. then , swap
first pointer and second pointere data , by incrementing first pointer , and
decr
On 15 August 2011 16:48, programming love wrote:
> write a program to reverse the words in a give string.
> also state the time complexity of the algo.
>
It has already been discussed on the list a few days ago
>
> if the string is "i am a programmer"
> the output should be "programmer a am i"
@ MeHdi : Please read the problem properly yaar. You are just reversing the
string by characters, not by words.
On 15 August 2011 20:34, MeHdi KaZemI wrote:
> string str = "i am a programmer"
> for(int i = 0; i < str.size()/2; i ++)
> swap(str[i], str[str.size()-i-1]);
> time complexity O(n
string str = "i am a programmer"
for(int i = 0; i < str.size()/2; i ++)
swap(str[i], str[str.size()-i-1]);
time complexity O(n)
On Mon, Aug 15, 2011 at 6:39 PM, sukran dhawan wrote:
> reverse(string,n) // do it in place
>
>
> p = str;
> for(i=0;i {
> if(str[i] == '\0' || str[i] == ' ')
reverse(string,n) // do it in place
p = str;
for(i=0;i wrote:
> write a program to reverse the words in a give string.
> also state the time complexity of the algo.
>
> if the string is "i am a programmer"
> the output should be "programmer a am i"
>
> --
> You received this message because you
write a program to reverse the words in a give string.
also state the time complexity of the algo.
if the string is "i am a programmer"
the output should be "programmer a am i"
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this
can u pls convert this algorithm into an executable code in c++ which
can find the max and min element of an array in recursive method using
divide and conquer strategy...
int a[N]; // array
int maxmin (A[])
{
Split A into two parts: A1, A2;
(max1,min1) = maxmin(A1);
(max2,min2) = maxmin
WAP or Algo That will check whether the memory allotted to the program
at the initial and the memory returned to the system is same or not.
Thanks & Regards
Shashank Mani
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group
@Ashim
with a check that N >=n
N can also be less than n
On Wed, Dec 8, 2010 at 6:57 PM, Ashim Kapoor wrote:
> Let me try. Any thing involving n would leave no remainder.
>
> so (1 + 2 ! + ... + n ! + + N !) mod n = (1 + 2 ! + ... + (n-1)! )
> mod n
>
> This should be computed from a loop.
Let me try. Any thing involving n would leave no remainder.
so (1 + 2 ! + ... + n ! + + N !) mod n = (1 + 2 ! + ... + (n-1)! ) mod
n
This should be computed from a loop. I don't know how to reduce it further.
Ashim.
On Wed, Dec 8, 2010 at 6:49 PM, ankit sablok wrote:
> Q) can anyboy fin
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
tha
27 matches
Mail list logo