|
Post by Bahamut on Mar 7, 2002 22:04:56 GMT -5
Each node contains the last part of the URL associated with itwww.ign.com/page1/ignnowsucksbigtime.htmlSo does it first extract "ignnowsucksbigtime.html" then "page1" and finally "http://www.ign.com"? Is that what the sentence is saying? EDIT: I've been told that you are only supposed to store "ignnowsucksbigtime.html" and that's it (excluding the references)...
|
|
|
Post by Evotamer on Mar 9, 2002 6:34:34 GMT -5
My advice to you is that you go the other way around. Start at the root then work your way towards the final chunk. i.e. www.blah.com/~blearg/148/index.htmlusing recursion we develop as the 'root' www.blah.com and we are now left with ~blearg/148/index.html (we remove the '/' character since it is only a delimiter). The next iteration of recursion forms: ~blearg with 148/index.html then 148 with index.html then index.html as the last part. I'm not sure if this is what your assignment (I mostly skimmed it) but to develop the tree structure as given on the handout it seems that the way I've suggested should be the easiest way to develop your tree. From that, hopefully you should have some help as to how to use recursion to develop your tree.
|
|
Linksys
Junior Member
Kenshin: It doesn't matter. Use whatever technique you like. However. Once I've said I'll kill you,
Posts: 12
|
Post by Linksys on Mar 9, 2002 12:45:12 GMT -5
Ok Im also lost on "Each node contains the last part of the URL associated with it (as a String)." The way I see it is that the String instance variable contains just the name of the current node. ie if you inserted www.cs.com/pagethere would be two nodes created one with the String instance variable "http://www.cs.com" and one with the String instance variable "page" and you use the vectors to link them up accordingly. This is how I went about it and got the insert method to work. Can someone tell me if this is correct or am I totally off? Thanks
|
|
|
Post by Bahamut on Mar 9, 2002 18:15:50 GMT -5
Evotamer - yeah that's how I'm gonna do it. I'm not gonna read too much into what the handout says - I'm complicating matters. I'll just go with my instincts.
Linksys - I hope that's right cause that's the way I did it. If anyone knows this is wrong, speak up!
|
|
|
Post by Brutal_Chicken on Mar 15, 2002 16:14:48 GMT -5
Ok Im also lost on "Each node contains the last part of the URL associated with it (as a String)." The way I see it is that the String instance variable contains just the name of the current node. ie if you inserted www.cs.com/pagethere would be two nodes created one with the String instance variable "http://www.cs.com" and one with the String instance variable "page" and you use the vectors to link them up accordingly. This is how I went about it and got the insert method to work. Can someone tell me if this is correct or am I totally off? Thanks I think that's what they want. That's how I did it as well... although I'm not sure if it even works yet.
|
|
|
Post by lordaeron on Mar 16, 2002 15:18:11 GMT -5
Hiya ppl, Did you guys put the code for size in URLTreeNode or URLTree ?? I really hate the handout, makes me unsure of my code. I did the recursion in the URLTreeNode and just called it as a method from the URLTree. Just seeing if i'm doing it wrong..... thanx
|
|
|
Post by Brutal_Chicken on Mar 16, 2002 19:51:03 GMT -5
Mine's a bit lopsided... I have a constructor and getter methods in URLTreeNode and I have all the public/private static methods in URLTree.
My line of thinking was that since most of these methods are static their placement doesn't really matter. Plus, you're inserting/removing/searching a tree made up of nodes. It 'makes sense' to put them in the class where of the tree... but then you're also just manipulating nodes and their links... sigh.
|
|
|
Post by lordaeron on Mar 16, 2002 23:40:23 GMT -5
Thanx.... atleast it doesn't look like i'm doing anything wrong.....
|
|
|
Post by 1.8T on Mar 17, 2002 11:05:11 GMT -5
I'm totally lost in this assignment for URLTreeNode class, is it similar to the Node class we were using in A3?? I have no idea wut this class is about.., can someone pls clarify.., right now all i have is a vector in there.., and a constructor.,,. i'm thinking i hafta have a method to separate each url-part to store as individual nodes.,,. but i'm stumped as to how the nodes are created?.. do i hafta use the Node class from A3?, like wut exactly is the node ?., i'm really confused..
|
|