[algogeeks] Re: Implement lastindexofastring(String s1,String s2)

2014-04-07 Thread Dan
repeatedly to find the last occurrence... or... write your own special Index function. I'm not sure what the fastest search algorithm is for that. I seem to remember reading up on it a long time ago. It's not a brute force method if I recall correctly. Dan :-) -- You received this message

[algogeeks] Re: strictly sorting by adding or subtracting a range of numbers

2014-03-24 Thread Dan
it's just an interesting problem. Dan:-) Module Transform Contains * Function TransformArray( v ) Result(x) !--- ! Find a minium X value to transform the array, v(:) ! Transformed array values can be negative

[algogeeks] Re: Pointers Usage

2013-02-19 Thread Dan
On Tuesday, January 1, 2013 12:05:31 PM UTC-8, shady wrote: Why do we use pointers at all considering space as a factor other than allocating memory dynamically does it have any other use ? to store an integer (int *) = 8 bytes, and while making it point to an integer location would

[algogeeks] Re: find point lies in side circle

2012-01-07 Thread Dan
don't have that many points... the simplest and arguably the best algorithm is the one that has the simplest and easiest to understand coding by an average programmer. These are just my thoughts for whatever they're worth, Dan :-) -- You received this message because you are subscribed

[algogeeks] Re: NULL pointer

2011-11-15 Thread Dan
are talking about in your questions comments. Dan :-) On Nov 14, 1:52 pm, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: is subtraction of two NULL pointers defined ? -- *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed

[algogeeks] Re: Intersection of arrays

2011-10-27 Thread Dan
, 1 element at a time, looking to see if each value is in the just created list of intersection elements 4) Do the save thing now with each of the remaining original K arrays. Dan:-) On Oct 24, 10:17 pm, kumar raja rajkumar.cs...@gmail.com wrote:  Find intersection of K unsorted

[algogeeks] Re: Inplace Array Convertion

2011-10-17 Thread Dan
are dealing with some very large arrays. Dan :-) On Oct 14, 9:44 pm, Ankur Garg ankurga...@gmail.com wrote: @Dan ..can you post the algo here or link to the book?? @Anika ...yes please post the code here..but please explain a bit about underlying algo ...(algo is more important than actual code

[algogeeks] Re: content extraction

2011-10-14 Thread Dan
Pick a language to work in. Open the file in whatever way your language of choice allows. Read the data. And... you are done. A better answer will probably require a better question. Dan ;-) On Oct 13, 10:44 am, karthikeya s karthikeya.a...@gmail.com wrote: Does anyone have an idea about

[algogeeks] Re: Inplace Array Convertion

2011-10-14 Thread Dan
++ or Algorithms in Pascal, etc. Dan -- 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

[algogeeks] Re: NEED ALGO IN TIME 0.00

2011-06-26 Thread Dan
of this test (other than it might be worthwhile as a homework assignment to new coders). Have I missed something? Dan :-) On Jun 24, 9:53 am, prathimzn prathi...@gmail.com wrote: http://www.spoj.pl/problems/FASHION/ i summit this question and my time is 0.02 as i used sorting

[algogeeks] Re: Sorting Array

2011-06-26 Thread Dan
.Don't assume that an O(x) algorithm is better than an O(y) algorithm just because x is less than y. Dan :-) On Jun 26, 12:14 am, ross jagadish1...@gmail.com wrote: Given a sequence of numbers in the range of 1-N^2, what is the most efficient way to sort the numbers (better than NlgN).. Can

[algogeeks] Re: MS Question

2011-06-25 Thread Dan
I don't think you need a temp string (though, this may be a language dependent issue). Just use the string as given and keep track of the character positions within the string. The length of the original string is irrelevant as long as your system can handle it. Dan :-) On Jun 23, 2:44 pm

[algogeeks] Re: a doubt..

2011-06-14 Thread Dan
it. Just my opinion, Dan :-) -- 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

[algogeeks] Re: Find min after rotating an array

2011-06-05 Thread Dan
requirement. Here's a simple Fortran solution: given: an integer array a(n) with n elements in it an integer scalar variable, smallest_a, to store the result in ::: sorting, rotating, etc., etc. ::: Finding the minimum value is just a one-liner: smallest_a = MINVAL( a, dim=1 ) Dan

[algogeeks] Re: Array Question

2011-02-22 Thread Dan
Look up the Subset Sum problem. I think you may find that you can put together a hybrid algorithm based on the classic method of performing subset sum calculations. I did something similar a few years back. It worked out pretty good as I recall. Dan:-) -- You received this message

[algogeeks] Re: Minimum positive-sum subarray

2011-01-29 Thread Dan
On Jan 21, 1:05 am, snehal jain learner@gmail.com wrote: In this variation of the Maximum-Sum Subarray Problem, you are given a one-dimensional array A[1 : n] of positive or negative numbers, and you are asked to find a subarray A[i : j] such that the sum of its elements is (1) strictly

[algogeeks] Re: Symmetric matrix

2011-01-13 Thread Dan
. Dan :-) -- 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

[algogeeks] Re: subsorted array

2010-12-18 Thread Dan
On Dec 18, 9:57 am, snehal jain learner@gmail.com wrote: Given an unsorted array arr[0..n-1] of size n, find the minimum length subarray arr[s..e] such that sorting this subarray makes the whole array sorted. Sounds like a simple homework problem to me.:-) -- You

[algogeeks] Re: Algorithm intensive Please solve

2010-02-17 Thread Dan
we pair them up such that for each pair of points, a(x,y) b(x,y), we get a maximum value of xa*xb + ya*yb ??? If you solve this algorithm I think you have a solution. Is it easier this way? I'm not really sure. Dan :-) -- You received this message because you are subscribed

[algogeeks] mutual exclusion algorithm problem

2006-06-14 Thread Dan Ulman
code of original A; /* Whose step complexity may depend on other processes */ 5 critical section; 6 flag := false; Does the modifed algorithm satisfy deadlock-freedom and/or mutual exclusion (for any A)? Prove your answers. thanks !! Dan. --~--~-~--~~~---~--~~ You