In work case (ie max value of i,j and k ll be)
for(i=0;in;i++) //i=n
{
for(j=0;jn*n;j++) // j=i=n;
{
for(k=0;kn*n;k++) // k=j=i=n;
}
}
So Ans O(n^5)
-- Prashant Kulkarni
On Sat, Sep 10, 2011 at 12:05 PM, deepikaanand swinyanand...@gmail.comwrote:
ans : O(n^5)
inner
The Algorithm Design Manual By Steve S. Skiena
-- Prashant Kulkarni
On Tue, Sep 6, 2011 at 3:48 PM, Udit Gupta uditgupta...@gmail.com wrote:
Fundamentals of Computer Algorithms by Sartaj Sahni
On Tue, Sep 6, 2011 at 3:45 PM, Neha Gupta nehagup...@gmail.com wrote:
hey guys , do tell me
are printing its starting location so we will some
garbage value.
-- Prashant Kulkarni
On Mon, Aug 8, 2011 at 11:28 AM, Mohit Goel mohitgoel291...@gmail.comwrote:
can anyone one explain output of question 1.
--
You received this message because you are subscribed to the Google Groups
hi,
for 1 question, use stack to display elements in reverse order.
can you elaborate your 2nd question ?
-- Prashant Kulkarni
On Thu, Jan 6, 2011 at 4:56 PM, dinesh bansal bansal...@gmail.com wrote:
Hi Guys,
There are some questions asked to me:
1. How do you print the SLL in reverse
4)look for 'z' in the list by considering all numbers as unsigned if u found
then check sign of that number it be opposite of 'z' if so return 1 else 0
[above steps is repeated for all elements]
*correct me if I am wrong*
--
Prashant Kulkarni
IISc Bangalore
On Wed, Dec 15, 2010 at 10:36 AM
we can use binary search algorithm to find the z
( sorting ll take O(n log n ) but it is very less compared to n^2 * log n )
-- Prashant Kulkarni
On Wed, Dec 15, 2010 at 3:32 PM, Ankur Murarka
ankur.murarka@gmail.comwrote:
wouldn't your algo take n^3 time as well given the fact
I think we can do XOR operation Over all numbers and result will contain
number which appeared only once.
Correct Me If I'm Wrong
-- Prashant Kulkarni
On Mon, Oct 4, 2010 at 3:17 PM, malli mallesh...@gmail.com wrote:
I have an array. All numbers in the array repeat twice except two
i think it is similar to finding max in a list O(n) or sorting algorithm
O(n log n)
-- Prashant Kulkarni
On Tue, Sep 28, 2010 at 11:33 PM, Rahul Singal rahulsinga...@gmail.comwrote:
A possible solution i can think is create a directed graph where each
vertex is a envelope and edges
of the linked list
-- Prashant Kulkarni
On Tue, Sep 28, 2010 at 10:54 PM, Divesh Dixit
dixit.coolfrog.div...@gmail.com wrote:
Given a singly-linked, find out (just give the basic logic) the mid
point of a single linked list in a single parse of the list. Assume
the program would be loaded
i think we can use recursion method to reverse the list
-- Prashant Kulkarni
On Sat, Aug 14, 2010 at 11:40 PM, Lokesh Agarwal lokesh...@gmail.comwrote:
how can you traverse from last without reversing it.
and there is no need fof using extra stack space.
--
You received this message
every printf statement wll return how many number of parameter/variable
print r printed so 2nd nested wll print number 1 n remaing two printf
statement wll print number of parameters are printed so total three 1's
.:)
-- Prashant Kulkarni
|| Lokaha Samastaha Sukhino Bhavanthu ||
|| Sarve Jana
)
here if (n-1) th is greater so it will return its value
-- Prashant Kulkarni
On Fri, Jun 4, 2010 at 7:13 PM, Raj N rajn...@gmail.com wrote:
int Max(int a[],int n)
{
int max;
if(n==1)
return a[0];
else
max=Max(a,n-1);
if(maxa[n
i think we can use sorting algorithm like insertion sort, in insertion sort
whenever we are putting the element into it's proper position we can check
whether this elements already exists don't put otherwise insert into into
it's proper position (element)
-- Prashant Kulkarni
|| Lokaha Samastaha
13 matches
Mail list logo