@ashish...4 all selected...remaining 2 to be selected..1 m,ba 1
betch makes one 2 mba and 1 mca...but as it is not only option coz we can
put 2 mcas at 2 remaing pos so this is not true...3 are ignored 4th must be
true..
On Mon, Apr 29, 2013 at 7:37 AM, ashish gupta
Ans is 1 M.A + 2 B.Tech + 2 MBA + 1 MCA.
Explanation:
(1) Exactly one must be an MA.
(2) Given: 2 b.tech are seleceted and the statement if at least one
btech is selected then exactly 2 MBA are selected (vice versa condition)
So exactly 2 MBA will be selected.
(3) Remaining 1 would be MCA.
So
b and d cannot be true at the same time.
d) - 2 MBA - 2 BTECH - 2 left to allocate. But b) allocates 3 more.
On Sat, Apr 27, 2013 at 4:02 AM, rahul sharma rahul23111...@gmail.comwrote:
10 candidates appear for an interview and 6 selected.
2-M.A
2-MCA
4-BTECH
2-MBA.
If at least one MBA is
(oh sorry forgot to mention - d must be true because of the statement 'if
at least one MBA is selected then exactly 2 BTECH are selected and vice
versa')
On Mon, Apr 29, 2013 at 6:22 AM, Padarn Wilson pad...@gmail.com wrote:
b and d cannot be true at the same time.
d) - 2 MBA - 2 BTECH - 2
10 candidates appear for an interview and 6 selected.
2-M.A
2-MCA
4-BTECH
2-MBA.
If at least one MBA is selected then exactly 2 btech are selected and vice
versa.
Of six candidates,exactly one must be an MA cndidate
question:- which of the following statementsis definitely true:,if 2 btech
are
1. Make a trie of all dictionary words.
2.then run a loop for all characters of string
3.suppose start from I ,as I is a word in dictionary,word found then
increment counter
4.Now counter comes to X,no word found
5.Now it comes to A,two word could start from A(A and AM)
now run this loop till end
lines = 0;
string last_n_lines[n];
//read each line into a circular buffer
while(getline(file,last_n_lines[lines%n]))
{
lines++;
}
// if number of lines n
// then print all of them
if(lines=n)
{
start = 0;
count = lines;
}
else
{
start = lines%n;
count = lines;
}
//Now print all of
Read line by line . use doublylinkedlist(Queue)/ Circular Buffer of size N.
when EOF is achieved print the lines.
On Mon, Mar 4, 2013 at 9:10 AM, Ashish Goel ashg...@gmail.com wrote:
Q1. Given a log file, pirnt last n lines. Note that the Log file is being
written into.
Q2. Implement
Both questions look related to me. If the log file is being updated as well
simultaneously, you should be able to use Circular queue/buffer for that.
On Mon, Mar 4, 2013 at 9:10 AM, Ashish Goel ashg...@gmail.com wrote:
Q1. Given a log file, pirnt last n lines. Note that the Log file is being
int main()
{
int n=10;
coutEnter the value of n:;
cinn;
int i=0;
ifstream file(C:\\Users\\kvb\\Desktop\\sample.txt);
string line;
string buffer[n];
if(file.is_open())
{
while(file.good())
{
getline(file,line);
Q1. Given a log file, pirnt last n lines. Note that the Log file is being
written into.
Q2. Implement Circular Buffer.
Best Regards
Ashish Goel
Think positive and find fuel in failure
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
you can't implement in O(log n). It can be done in O(log n) in case of
Ranked BS Tree.
--
Amitesh
On Sun, Jan 20, 2013 at 6:23 PM, Praveen praveensonare...@gmail.com wrote:
If for all the nodes in BST we also store the size of subtree, then it is
possible to find nth smallest element in
not possible unless u use augmented bst..which itself takes o(n) to built
--
http://stackoverflow.com/questions/2329171/find-kth-smallest-element-in-a-binary-search-tree-in-optimum-way
On Sun, Jan 20, 2013 at 4:57 PM, Guneesh Paul Singh gunees...@gmail.comwrote:
not possible unless u use augmented bst..which itself takes o(n) to built
--
--
If for all the nodes in BST we also store the size of subtree, then it is
possible to find nth smallest element in O(logN).
On Sun, Jan 20, 2013 at 4:57 PM, Guneesh Paul Singh gunees...@gmail.comwrote:
not possible unless u use augmented bst..which itself takes o(n) to built
--
--
Given a BST, how would you return the nth smallest element. The code had to
cover all the edge cases and was expected to write a logn solution.
--
Umer
--
Ques Given a large text... in the text.. there are gt; , lt; etc
representing and .(there can be others like eq; etc)
the task is to replace such (gt;) with the '' symbol...
and (lt;) with ''
given the table which have corresponding matches... and
table is
Hi all,
This was asked in microsoft, question is write a program to
reverse a linked list.and write it's test cases.
i got very few test cases
1) check if the node is null
2) check if there is only one node
3) check if there is any loop in the linked list.
can any one tell how to
Reversing a linked list if loop exists:
1. Find the node from which loop start by any loop finding algorithm in
linked list and keep the position of that node.
2. Unroll the loop i.e. set the last node's(last unrepeating node) next
pointer to NULL.
3. Reverse this singly linked list.
4. Change
Few more Test cases :
Check for 10 node.
Check for 1 million node
Check for even number of nodes
Check for odd number of nodes...
etc etc...
On Fri, Aug 24, 2012 at 6:25 PM, Navin Kumar algorithm.i...@gmail.comwrote:
Reversing a linked list if loop exists:
1. Find the node from which loop
Anagram problem solution using TRIE..
For each word in dictionary we will put it in TRIE as..
1. First sort the word
2. Search in trie using sorted word. If search found then we will add the
original word in that TRIE node.
3. If node node not found then using simple TRIE insertion insert
Ques..
Given a m-word dictionary ... and a n-sized word... .. now suggest DS for
dictionary such that you can find out all the anagrams of the given word
present in dictionary...
--
Regards,
G C
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
O(n)
convert each string into format a1b2and then insert into multimap wityh
this a1b2...as key and original word as value. All words with same key are
anagrams
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Wed, Aug 22, 2012 at 11:39 PM,
@Ashish: According to your algo making multimap itself takes O(mn) time
complexity (preprocessing). After then getting anagram of a string takes
O(n) time. Am i right?
On Thu, Aug 23, 2012 at 6:51 AM, Ashish Goel ashg...@gmail.com wrote:
O(n)
convert each string into format a1b2and then
i was thinking of character array. which is same as string.
Any thoughts on better alternatives?
On Friday, 6 July 2012 13:34:01 UTC-4, anshu wrote:
yes, We can have much better data structure for storing big integer
instead of string just for simplicity I have taken string.
On Fri, Jul 6,
Best will be storing BIG_INT in array of integers.
int [] val; //store actual number
int size; // required length of val array.
take the string as input for constructors and convert it into 2's
complement form, maintaining little endian order or big endian order.
Perform other operation keeping
@anshuman...
Are you converting numbers to string because data types ranges
and precision differs? or is there any other reason?
-mithun
On Fri, Jul 6, 2012 at 12:58 AM, payal gupta gpt.pa...@gmail.com wrote:
thnx...4 d rply..
Regards,
PAYAL GUPTA,
NIT-B.
On Fri, Jul 6, 2012 at 12:43
yes, We can have much better data structure for storing big integer instead
of string just for simplicity I have taken string.
On Fri, Jul 6, 2012 at 11:11 AM, Mithun Kumar mithunsi...@gmail.com wrote:
@anshuman...
Are you converting numbers to string because data types ranges
and precision
First define all the basic operation you can apply on two numbers.
Binary operation : +, -, *, /, %, optional((and), |(or), ^(xor))
Unary operation : !, ~, -
Comparison : , ==, !=
Define all these operation.
Most simplest one can be,
class BIG_INT {
private string val;
//Define
thnx...4 d rply..
Regards,
PAYAL GUPTA,
NIT-B.
On Fri, Jul 6, 2012 at 12:43 AM, Anshu Mishra anshumishra6...@gmail.comwrote:
First define all the basic operation you can apply on two numbers.
Binary operation : +, -, *, /, %, optional((and), |(or), ^(xor))
Unary operation : !, ~, -
can you elaborate question...what is BIG_INT?
On Sun, Jul 1, 2012 at 8:13 PM, payal gupta gpt.pa...@gmail.com wrote:
design a BIG_INT library...
Regards,
PAYAL GUPTA,
NIT-B.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view
peacelover1987...@yahoo.co.in wrote:
This is a variant of that one
--
*From:* saurabh singh saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos
--
*From:* saurabh singh saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer
;
}
On Fri, Jun 29, 2012 at 3:37 PM, raghavan M
peacelover1987...@yahoo.co.in wrote:
This is a variant of that one
--
*From:* saurabh singh saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question
@amol :
#includestdio.h
int main()
{
int arr[]={5,0,1,2,6,7,8,3,4,9};
int i,j,n,temp;
n=sizeof(arr)/sizeof(arr[0]);
for(j=0;j=1;j++)
{
for(i=0;in;i++)
{
if(arr[i]!=i){
temp=arr[i];
arr[i]=arr[arr[i]];
i don't see any change in the code you posted...other than expanding swap
function
i believe in discussing the idea/algonot the code..
--
Amol Sharma
Final Year Student
Computer Science and Engineering
MNNIT Allahabad
http://gplus.to/amolsharma99
yes it is same and it not working . Apart for this you had provided code
for sorting O(n) time and not the idea/algo.
please explain the algorithm , how you are sorting it within O(n) time and
O(1) space complexity.
On Mon, Jul 2, 2012 at 3:18 PM, Amol Sharma amolsharm...@gmail.com wrote:
i
opssyeah dat was the bug... now got it :)
On Mon, Jul 2, 2012 at 4:08 PM, Amol Sharma amolsharm...@gmail.com wrote:
@atul:
the logic for the O(n) counting is same as for the count sort.
you haven't write the swap function correctly,
here is correct code for swap function --
design a BIG_INT library...
Regards,
PAYAL GUPTA,
NIT-B.
--
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/-/EHIiPPFJ4t0J.
To post to this group, send email to
: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Fri, Jun 29, 2012 at 10:41 AM, raghavan M
peacelover1987
PM, raghavan M
peacelover1987...@yahoo.co.in wrote:
This is a variant of that one
--
*From:* saurabh singh saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive
saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science
: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Fri, Jun 29, 2012 at 10:41 AM, raghavan M
--
*From:* saurabh singh saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly
--
*From:* saurabh singh saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer to that post
Hi
Question as in subject
*No extra spaceĀ (can use one extra space)-O(1) max
*No order change allowed
example:
input : 1,-5,2,10,-100,-2
output: -5,-10,-100,1,2
input : -1,-5,10,11,15,-500,200,-10
output : -1,-5,-10,-500,-10,10,11,15
Thanks
Raghavn
--
You received this message because you
This link should help
http://stackoverflow.com/questions/5667793/how-does-a-read-write-mutex-lock-work?rq=1
-mithun
On Fri, Jun 29, 2012 at 7:30 AM, bharat b bagana.bharatku...@gmail.comwrote:
class lock
{
enum{read, write,free}status;
};
By default, make status value as free.
Based
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Fri, Jun 29, 2012 at 10:41 AM, raghavan M
peacelover1987...@yahoo.co.inwrote:
Hi
Question as in subject
*No extra space (can use one extra
one can modify dutch national flag algo for two colors(2 types positive n
negative)
--
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
Quick sort partition routine variation.
On Fri, Jun 29, 2012 at 3:06 PM, Ravi Ranjan ravi.cool2...@gmail.comwrote:
one can modify dutch national flag algo for two colors(2 types positive n
negative)
--
You received this message because you are subscribed to the Google Groups
Algorithm
To: algogeeks@googlegroups.com
Sent: Friday, 29 June 2012 3:06 PM
Subject: Re: [algogeeks] MS Question: Segregrate positive and negative nos in
array without changing order
one can modify dutch national flag algo for two colors(2 types positive n
negative)
--
You received this message because you
This is a variant of that one
From: saurabh singh saurab...@gmail.com
To: algogeeks@googlegroups.com
Sent: Friday, 29 June 2012 3:05 PM
Subject: Re: [algogeeks] MS Question: Segregrate positive and negative nos in
array without changing order
duplicate
of that one
--
*From:* saurabh singh saurab...@gmail.com
*To:* algogeeks@googlegroups.com
*Sent:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and negative
nos in array without changing order
duplicate of a previous
:* Friday, 29 June 2012 3:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and negative
nos in array without changing order
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Fri, Jun
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Fri, Jun 29, 2012 at 10:41 AM
:05 PM
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Fri, Jun 29, 2012 at 10:41
*Subject:* Re: [algogeeks] MS Question: Segregrate positive and
negative nos in array without changing order
duplicate of a previous post.Kindly refer to that post.
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Fri, Jun 29, 2012 at 10:41 AM, raghavan M
we can create linked list for the number where each node will store some k
digits (say 5) in the reverse order.then we just perform a normal addition
of the data of the nodes with the help of carry.
note that if the numbers are not positive then we need to maintain a sign
bit node also.if any of
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
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
class lock
{
enum{read, write,free}status;
};
By default, make status value as free.
Based on the request, status value will be changed...
Based on the value of the status, we should decide whether another
read/write lock can be given.
Any suggestions ?
On Thu, Jun 28, 2012 at 4:46 PM, Ashish
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
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
whether it is in character array or integer array??
On Tue, Jun 26, 2012 at 3:40 PM, Ashish Goel ashg...@gmail.com wrote:
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
You received this message because you are subscribed to the Google
^ Does it make any difference?
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Tue, Jun 26, 2012 at 5:32 PM, Navin Kumar algorithm.i...@gmail.comwrote:
whether it is in character array or integer array??
On Tue, Jun 26, 2012 at 3:40 PM, Ashish Goel
MSB is at end or at the last of the array .. ??
On Tue, Jun 26, 2012 at 5:43 PM, saurabh singh saurab...@gmail.com wrote:
^ Does it make any difference?
Saurabh Singh
B.Tech (Computer Science)
MNNIT
blog:geekinessthecoolway.blogspot.com
On Tue, Jun 26, 2012 at 5:32 PM, Navin Kumar
I mean 123 is store as 1,2,3 or 3,2,1
On Tue, Jun 26, 2012 at 6:01 PM, Kumar Vishal kumar...@gmail.com wrote:
MSB is at end or at the last of the array .. ??
On Tue, Jun 26, 2012 at 5:43 PM, saurabh singh saurab...@gmail.comwrote:
^ Does it make any difference?
Saurabh Singh
the base is not given, so 10 can't be assumed
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Tue, Jun 26, 2012 at 4:38 PM, amrit harry dabbcomput...@gmail.comwrote:
make size of both array by adding '0' in front of smaller array
then
int
This solution works perfectly :)
On Friday, June 15, 2012 10:59:22 AM UTC+5:30, Navin Kumar wrote:
I corrected in function InsertAtBottom :In my code isntead of
(!IsEmptyStack) use IsEmptyStack
On Fri, Jun 15, 2012 at 10:49 AM, Navin Kumar algorithm.i...@gmail.comwrote:
@all:
In my
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
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
to store items in stack you will need some DS. Do they mean you cant use
any auxillary DS than stack ?
On Thu, Jun 14, 2012 at 2:24 PM, Ashish Goel ashg...@gmail.com wrote:
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
You received this
void Reverse(struct Stack *S) {
int data;
if(IsEmptyStack(S)) return;
data=pop(s);
ReverseStack(S);
InsertAtBottom(S, data);
}
void InsertAtBottom(struct stack *S, int data)
{
int temp;
if(!IsEmptyStack(S)){
push(S,data);
return;
}
temp=pop(S);
@ Navin Kumar
Nice . Solution.
But
your function also make a stack only. so you are using a stack[internal]
here.
but may be this one is allowed:-)
On Thu, Jun 14, 2012 at 5:23 AM, Navin Kumar algorithm.i...@gmail.comwrote:
void Reverse(struct Stack *S) {
int data;
Navin: copy pastes not encouraged till the logic is also clarified ;)
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Thu, Jun 14, 2012 at 7:25 PM, Sourabh Singh singhsourab...@gmail.comwrote:
@ Navin Kumar
Nice . Solution.
But
your
how can you pop from empty stack ?
temp=pop(S);
Regards,
Hassan
On Thu, Jun 14, 2012 at 8:25 PM, Ashish Goel ashg...@gmail.com wrote:
Navin: copy pastes not encouraged till the logic is also clarified ;)
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
void pushreverse(int data)
{
int temp;
if(top==0)
{
push(data);
return;
}
else
temp=pop();
pushreverse(data);
push(temp);
}
int reversestack()
{
//static int arr[50];
int top2=0;
int i;
if(top==0)
{ return top2;
}
top2=pop();
reversestack();
pushreverse(top2);
}
On Thu, Jun 14, 2012 at 2:44
Hi all,
Generate combinations (taken k out of n) of a given string
Eg: Input : abcd
Output:
abc
acd
abd
bcd
--
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
the steps would be like this :
if i say stack is like this 1,2,3,4 then
1) pop each and every item from the stack till stack is empty
the nodes will be ther in function call stack stil not pushed
2) now now take elements from function call stack like 4 and push it
3) when 3 comes next time first
stack means inbuild stack we cant use any DS from our program explicitly.
On Thu, Jun 14, 2012 at 2:44 PM, rahul patil
rahul.deshmukhpa...@gmail.comwrote:
to store items in stack you will need some DS. Do they mean you cant use
any auxillary DS than stack ?
On Thu, Jun 14, 2012 at 2:24 PM,
i think i already explained the logic initially :)
On Thu, Jun 14, 2012 at 9:30 PM, Hassan Monfared hmonfa...@gmail.comwrote:
how can you pop from empty stack ?
temp=pop(S);
Regards,
Hassan
On Thu, Jun 14, 2012 at 8:25 PM, Ashish Goel ashg...@gmail.com wrote:
Navin: copy pastes not
@all:
In my code isntead of (!IsEmptyStack) use IsEmptyStack
Logic :
First pop the all element and then start putting element at bottom in
reverse order i.e. the element which is fetched last is put at the bottom
and so on.
ex: let our stack is: 1 2 3 4 (1 is at bottom).
function Call is will
I corrected in function InsertAtBottom :In my code isntead of
(!IsEmptyStack) use IsEmptyStack
On Fri, Jun 15, 2012 at 10:49 AM, Navin Kumar algorithm.i...@gmail.comwrote:
@all:
In my code isntead of (!IsEmptyStack) use IsEmptyStack
Logic :
First pop the all element and then start putting
@utsav u haven't initialized match anywhere so ur algo fails
On Thu, Jun 7, 2012 at 2:50 AM, utsav sharma utsav.sharm...@gmail.comwrote:
i think it can be solved using DP
word=bcdf take hash of word h[b]=1 h[c]=2 h[d]=3 h[f]=4
given 2d matrix m[][]=
{b c b e f g h
b c d f p o u
d f d
Things like sensor data coming from CAN/MoST from the car is collected and
analysed in real time to avoid collisions, off-lane movement, distance
maintenance, auto parking(including parallel), slippage on road/snow, GPS
integration for perfect location and location specific data (like
What are the specs of the car. Can you please give the answer to the
following clarifying questions:
- How much distance is it suppose to travel without the driver?
- Is it suppose to run on smooth roads only or can it also run on roads
with jumps on it? On what type of road is the car most
WAP to find a word in a 2D array. The word can be formed on
row/col/diagnal/reverse diagnal
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
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
i did this question long time back
well simple brute force check can be doneyou can keep one flag
matrix of same size to avoid necessary recursion.
On 6/6/12, Ashish Goel ashg...@gmail.com wrote:
WAP to find a word in a 2D array. The word can be formed on
row/col/diagnal/reverse
i think it can be solved using DP
word=bcdf take hash of word h[b]=1 h[c]=2 h[d]=3 h[f]=4
given 2d matrix m[][]=
{b c b e f g h
b c d f p o u
d f d f g k p }
take another matrix match[][]
if( h[ m[i][j] ] 0 ) //if this char is in word then
{a=h[ m[i][j] ];
if (match[i-1][j] ==a-1
here is the question ans solution with proper explanation
http://www.geeksforgeeks.org/archives/11604
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
http://gplus.to/amolsharma99
whats problem with the approch provided by navin
http://k2code.blogspot.in/2011/09/deleting-node-in-singly-linked-list-if.html
it seems much simpler ...is there any test case for which it wont work ??
On Mon, Jun 4, 2012 at 3:25 PM, Amol Sharma amolsharm...@gmail.com wrote:
here is the
directory/subdirectories
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
The question is to implement without use of any library
Sent from my Windows Phone
From: atul anand
Sent: 03-06-2012 11:19
To: algogeeks@googlegroups.com
Subject: Re: [algogeeks
We have given a list 14 6 7 15 8 9 we have to find 15 in (log
n ) times.
--
*Thanks and Regards,*
Abhinav Kumar Gupta
**abhinav@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
Hi,
I have found two url which contain answer of your question some extent.
42bits.wordpress.com/2010/04/17/find-kth-minimum-in-a-unsorted-array/
http://www.medwelljournals.com/fulltext/?doi=rjasci.2011.70.75
On Sun, Jun 3, 2012 at 8:31 PM, abhinav gupta abhinav@gmail.com wrote:
@abhinav: if you want to search just 15 in log(n) time then you can use the
concept of heap tree.. apply one round of heapification (not for all
elements but just one time it will be complete in log(n) times), and you
will need to swap elements but when you got element 15 you can stop..
although
@Rahul: but for heapify, i need to build heap tree first from the list.
which will cost linear traversal of the elements, that will cost O(n). but
i need to search it in O(log n) or polylogrithmic complexity of (log n)
i.e. (log^2 n).
On Sun, Jun 3, 2012 at 8:55 AM, Rahul Kumar Patle
@ Abhishek : Link that you have provided is for kth min element in the
unsorted array, but here i dont know the given value is of at what min
position.
On Sun, Jun 3, 2012 at 9:06 AM, abhinav gupta abhinav@gmail.com wrote:
@Rahul: but for heapify, i need to build heap tree first from the
Hi Rahul,
In the below url,They have mentioned the parallel searching. it means
divide array than search element from two point.
i.e number of element is {48,23,10,32,5} search 32.
divide array [0-2] and [3-4] range... traverse the array from p[0] and p
[3]... till half of the loop.
I hope
ls-r implementation needed...
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
--
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
i wrote this program in college labbut used shell script to
simulate ls -r functionality.
now to do in c or java .. we only need to knw about the libraries to use.
On 6/3/12, Ashish Goel ashg...@gmail.com wrote:
ls-r implementation needed...
Best Regards
Ashish Goel
Think positive and
#include stdio.h
#include stdlib.h
#include sys/types.h
#include dirent.h
#include unistd.h
#include ctype.h
#include string.h
void dirfun(char *);
int main()
{
char *home=/home/navin/temp/;
dirfun(home);
return 0;
}
void dirfun(char *path)
{
struct dirent
you can set your directory path in this line
char *home=/home/navin/temp/;
On Sun, Jun 3, 2012 at 11:26 AM, Navin Kumar algorithm.i...@gmail.comwrote:
#include stdio.h
#include stdlib.h
#include sys/types.h
#include dirent.h
#include unistd.h
#include ctype.h
#include string.h
void
1 - 100 of 438 matches
Mail list logo