Re: [algogeeks] Re: binary matrix
@chi .. can you please share what is this and how it resolves the issue at hand ? regards --mac On Mon, Oct 4, 2010 at 5:50 PM, Chi wrote: > Traverse the matrix in z-order, or hilbert-order. This is a heuristic- > algo. > > On Oct 4, 1:51 pm, mac adobe wrote: > > Given a binary matrix, find out the maximum size square sub-matrix with > all > > 1s. > > > > For example, consider the below binary matrix. > > > >0 1 1 0 1 > >1 1 0 1 0 > >0 1 1 1 0 > >1 1 1 1 0 > >1 1 1 1 1 > >0 0 0 0 0 > > > > then a 3x3 1 matrix eists > > > > the second question is .. if such a matrix (square matrix does not > > exist) find one with maximum 1s . > > > > -- > > thanks > > --mac > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@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. > > -- thanks --mac -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
[algogeeks] binary matrix
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. 0 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 0 0 0 0 then a 3x3 1 matrix eists the second question is .. if such a matrix (square matrix does not exist) find one with maximum 1s . -- thanks --mac -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
Re: [algogeeks] repeating numbers in an array
how will this give me array_1 which lists all numbers comming 1 time , array_2 which lists all numbers comming 2 time etc ? On Sun, Oct 3, 2010 at 11:31 AM, kusuma sanjeev wrote: > One possible solution would be to create an array of pointers to the list.. > array index indicates how many times the element occurs and the list gives > the elements. > > > On Sun, Oct 3, 2010 at 11:22 AM, sharad kumar wrote: > >> it will take same amount of memory nakey value is element and vaule is >> the amount of times element occurs. >> >> >> On Sun, Oct 3, 2010 at 11:11 AM, mac adobe wrote: >> >>> i think hash map takes lots of memory ... please correct me if i am >>> wrong here .. >>> >>> anyways its a soluton but i would like to have a different solution .. :) >>> >>> >>> --mac >>> >>> >>> On Sun, Oct 3, 2010 at 10:55 AM, sharad kumar >>> wrote: >>> >>>> cant u use a hash map buddy??? >>>> >>>> On Sun, Oct 3, 2010 at 10:35 AM, mac adobe wrote: >>>> >>>>> You are given a very long array of integers . Some number in this >>>>> integer array come 1 time , some 2 times some 3 times . create 3 different >>>>> arrays . >>>>> Array 1 will have numbers with numbers comming only1 time , Array 2 >>>>> will have numbers with numbers comming 2 times, Array 3 will have numbers >>>>> with numbers repearting 3 times , >>>>> >>>>> >>>>> Can you extend the solution to create array_x with elements repeating >>>>> x times ? >>>>> >>>>> thanks >>>>> --mac >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to algoge...@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. >>>>> >>>> >>>> >>>> >>>> -- >>>> yezhu malai vaasa venkataramana Govinda Govinda >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algoge...@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. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algoge...@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. >>> >> >> >> >> -- >> yezhu malai vaasa venkataramana Govinda Govinda >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@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. >> > > > > -- > Rgds, > Kusuma S > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@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. > -- thanks --mac -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
Re: [algogeeks] repeating numbers in an array
i think hash map takes lots of memory ... please correct me if i am wrong here .. anyways its a soluton but i would like to have a different solution .. :) --mac On Sun, Oct 3, 2010 at 10:55 AM, sharad kumar wrote: > cant u use a hash map buddy??? > > On Sun, Oct 3, 2010 at 10:35 AM, mac adobe wrote: > >> You are given a very long array of integers . Some number in this integer >> array come 1 time , some 2 times some 3 times . create 3 different arrays . >> >> Array 1 will have numbers with numbers comming only1 time , Array 2 will >> have numbers with numbers comming 2 times, Array 3 will have numbers with >> numbers repearting 3 times , >> >> >> Can you extend the solution to create array_x with elements repeating x >> times ? >> >> thanks >> --mac >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@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. >> > > > > -- > yezhu malai vaasa venkataramana Govinda Govinda > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@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. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
[algogeeks] repeating numbers in an array
You are given a very long array of integers . Some number in this integer array come 1 time , some 2 times some 3 times . create 3 different arrays . Array 1 will have numbers with numbers comming only1 time , Array 2 will have numbers with numbers comming 2 times, Array 3 will have numbers with numbers repearting 3 times , Can you extend the solution to create array_x with elements repeating x times ? thanks --mac -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
Re: [algogeeks] Minimum ladders required
@ Yang .. can you please share book authors so that i can refer .. . Please share some insight also .. it will help me understand it. --mac On Fri, Oct 1, 2010 at 4:01 PM, mac adobe wrote: > correcting ... Its minimum numbers of ladders required > > > Please suggest how you think for this problem > Suppose you have many airplanes . Each plane needs a ladder so > that people can board the plane easily . > Now plane will land at time land_time and then fly away again at fly_time > . > During this time , people will continue to board the plane and the > ladder should remain attached to the plane. So if plane lands at 3 am and > fly at 3 pm , we need a ladder from 3 am to 3 pm dedicated for that plane. > Given land_time and fly_time of multiple planes in a day , find the > minimum > number of ladders your require . > > > --mac > > > On Fri, Oct 1, 2010 at 3:56 PM, Yan Wang wrote: > >> I think your question should be to find the minimum number of ladders >> required. >> >> This is a very classic Greedy-Algorithm solved problem. Please refer >> to Chapter 4 of book "Algorithm Design". >> >> On Fri, Oct 1, 2010 at 2:32 AM, mac adobe wrote: >> > Hi >> > Please suggest how you think for this problem >> > Suppose you have many airplanes . Each plane needs a ladder so >> > that people can board the plane easily . >> > Now plane will land at time land_time and then fly away again at >> fly_time . >> > During this time , people will continue to board the plane and the >> > ladder should remain attached to the plane. So if plane lands at 3 am >> and >> > fly at 3 pm , we need a ladder from 3 am to 3 pm dedicated for that >> plane. >> > Given land_time and fly_time of multiple planes in a day , find the >> minimum >> > number of ladders your require . >> > >> > >> > --mac >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Algorithm Geeks" group. >> > To post to this group, send email to algoge...@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. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@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. >> >> > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
Re: [algogeeks] Minimum ladders required
correcting ... Its minimum numbers of ladders required Please suggest how you think for this problem Suppose you have many airplanes . Each plane needs a ladder so that people can board the plane easily . Now plane will land at time land_time and then fly away again at fly_time . During this time , people will continue to board the plane and the ladder should remain attached to the plane. So if plane lands at 3 am and fly at 3 pm , we need a ladder from 3 am to 3 pm dedicated for that plane. Given land_time and fly_time of multiple planes in a day , find the minimum number of ladders your require . --mac On Fri, Oct 1, 2010 at 3:56 PM, Yan Wang wrote: > I think your question should be to find the minimum number of ladders > required. > > This is a very classic Greedy-Algorithm solved problem. Please refer > to Chapter 4 of book "Algorithm Design". > > On Fri, Oct 1, 2010 at 2:32 AM, mac adobe wrote: > > Hi > > Please suggest how you think for this problem > > Suppose you have many airplanes . Each plane needs a ladder so > > that people can board the plane easily . > > Now plane will land at time land_time and then fly away again at fly_time > . > > During this time , people will continue to board the plane and the > > ladder should remain attached to the plane. So if plane lands at 3 am and > > fly at 3 pm , we need a ladder from 3 am to 3 pm dedicated for that > plane. > > Given land_time and fly_time of multiple planes in a day , find the > minimum > > number of ladders your require . > > > > > > --mac > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To post to this group, send email to algoge...@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. > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@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. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
[algogeeks] maximum ladders required
Hi Please suggest how you think for this problem Suppose you have many airplanes . Each plane needs a ladder so that people can board the plane easily . Now plane will land at time land_time and then fly away again at fly_time . During this time , people will continue to board the plane and the ladder should remain attached to the plane. So if plane lands at 3 am and fly at 3 pm , we need a ladder from 3 am to 3 pm dedicated for that plane. Given land_time and fly_time of multiple planes in a day , find the maximum number of ladders your require . --mac -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
Re: [algogeeks] Re: BST in BT
@parody :..and how would that find me a maximum size BST .. ?? ( for checking if this BT is BST i would do inorder traversal and see if it is increasing ) On Sun, Sep 26, 2010 at 11:10 AM, mac adobe wrote: > No parody .. that would be another doubt :( > > > On Sat, Sep 25, 2010 at 11:03 PM, prodigy <1abhishekshu...@gmail.com>wrote: > >> By maintaining a current maximum and a global maximum. You do know how >> to verify a BT is BST . >> >> http://pastebin.com/xwXXTEnP >> >> On Sep 25, 9:04 pm, mac adobe wrote: >> > How would you identify a binary search tree of maximum nodes in a binary >> > tree ? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@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. >> >> > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
Re: [algogeeks] Re: BST in BT
No parody .. that would be another doubt :( On Sat, Sep 25, 2010 at 11:03 PM, prodigy <1abhishekshu...@gmail.com> wrote: > By maintaining a current maximum and a global maximum. You do know how > to verify a BT is BST . > > http://pastebin.com/xwXXTEnP > > On Sep 25, 9:04 pm, mac adobe wrote: > > How would you identify a binary search tree of maximum nodes in a binary > > tree ? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@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. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.
[algogeeks] BST in BT
How would you identify a binary search tree of maximum nodes in a binary tree ? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@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.