Search Results

Showing results 1 to 40 of 133
Search took 0.09 seconds.
Search: Posts Made By: Narue ; Forum: Java and child forums
Forum: Java Nov 22nd, 2008
Replies: 5
Views: 1,283
Posted By Narue
If you choose to make the table size prime, you should treat that as an invariant and make it prime with each resize as well. I say "if you choose to make the table size prime" because there are...
Forum: Java Nov 22nd, 2008
Replies: 5
Views: 1,283
Posted By Narue
1) You know the size of the table and you can keep track of the load factor by modifying a counter when you add or remove a chain. This is pretty efficient.

2) Separate chaining is much more...
Forum: Java Oct 13th, 2008
Replies: 11
Views: 1,341
Posted By Narue
>Is there a better way?
Yes, design the class hierarchy such that you don't need to know the dynamic type of the object. Perhaps some form of strategy pattern would clean up that selection code.
Forum: Java Jan 10th, 2008
Replies: 14
Views: 1,025
Posted By Narue
>to be able to see the importance of "front"..
If enqueue places an item at the rear of the array, then front is only important in the inverse operation: dequeue. I fail to see how your teacher...
Forum: Java Jan 10th, 2008
Replies: 14
Views: 1,025
Posted By Narue
>why is it not needed? hehehe
You're just screwing with me, aren't you?
Forum: Java Jan 10th, 2008
Replies: 14
Views: 1,025
Posted By Narue
It's possible, but not needed.
Forum: Java Jan 10th, 2008
Replies: 14
Views: 1,025
Posted By Narue
>but its a requirement for me hehehe..
You're required to use front in the enqueue method? Maybe you should describe exactly what your assignment is so that I don't have to play 20 questions with...
Forum: Java Jan 10th, 2008
Replies: 15
Views: 1,347
Posted By Narue
>public static double max(double[]x)
This signature suggests that you're supposed to pass an array of doubles to the function and the function returns the largest of them. Your code doesn't do that...
Forum: Java Jan 10th, 2008
Replies: 14
Views: 1,025
Posted By Narue
>im not really good at programming thats why...
Then you're probably not quite ready for a circular queue implementation. In that case, enqueue doesn't need to use front at all.
Forum: Java Jan 10th, 2008
Replies: 14
Views: 1,025
Posted By Narue
>umm how do i implement the "front" to the public boolean enqueue (int x) ??
If I told you, that would defeat the purpose of my exercises, wouldn't it?
Forum: Java Jan 10th, 2008
Replies: 7
Views: 806
Posted By Narue
It's impossible to help you unless you post your code.
Forum: Java Jan 10th, 2008
Replies: 14
Views: 1,025
Posted By Narue
>what does the "front" do?
A queue allows you to work with both "ends" of the data structure. You enqueue (add items) onto the rear and dequeue (remove items) from the front. This gives you the...
Forum: Java Jan 8th, 2008
Replies: 2
Views: 4,806
Posted By Narue
>For starters, I'll state that I'm not exactly sure what the 'height' of a b-tree represents.
The height of a binary search tree is the number of nodes in the longest path to a leaf.

>Do you have...
Forum: Java Jan 8th, 2008
Replies: 7
Views: 806
Posted By Narue
>Does anybody know how to make a parser???
Yes.
Forum: Java Dec 31st, 2007
Replies: 12
Views: 2,852
Posted By Narue
The message is pretty clear about what's wrong. You say that insertNumber returns an integer value, but you fail to return a value with a return statement:

return 0; // Or some other number
Forum: Java Dec 11th, 2007
Replies: 9
Views: 980
Posted By Narue
"For Dummies" books are dumbed down so much that it's virtually impossible to properly learn a technical subject like programming from them. What's worse is that the authors themselves tend to need...
Forum: Java Jun 1st, 2007
Replies: 4
Views: 1,141
Posted By Narue
>public void itemStateChanged(ItemEvent ie)
Either that's a typo and ie should be e, or you need to change any use of e to ie.
Forum: Java Mar 7th, 2006
Replies: 11
Views: 4,538
Posted By Narue
Can you post the code as well?
Forum: Java Nov 23rd, 2005
Replies: 4
Views: 2,142
Posted By Narue
>can yo give me some example of virus because i like to learn more about.
1) This request has nothing to do with the topic of the thread.
2) The chances of someone giving you the code for a virus...
Forum: Java Sep 26th, 2005
Replies: 7
Views: 2,583
Posted By Narue
Vectors are evil, look up the ArrayList if you want an array that grows as needed.
Forum: Java Jul 3rd, 2005
Replies: 38
Views: 5,079
Posted By Narue
>Okay i really thought servercrash had written winxp in java
:rolleyes:

>I've even heard you can't do it in c/c++ either...But don't know if that's true or not.
It's true, some routines have to...
Forum: Java May 2nd, 2005
Replies: 2
Views: 7,869
Posted By Narue
>Is there a "neater" way to code the following?

System.out.println ( "All the values in the array are: " );
for ( T x: array1 )
System.out.println ( x );

Change T to whatever the type of...
Forum: Java Apr 25th, 2005
Replies: 8
Views: 3,203
Posted By Narue
>Well how come you couldn't consider that an answer?
Because your explanation was so convoluted I didn't understand it, but it didn't smell right. ;)
Forum: Java Apr 25th, 2005
Replies: 8
Views: 3,203
Posted By Narue
>In that case, you would be instantiating a class to get to the static
Huh? No, not at all. The following is legal:

class Outer {
static class Nested {}
}

class Test {
Outer.Nested obj...
Forum: Java Apr 25th, 2005
Replies: 8
Views: 3,203
Posted By Narue
>Would both abstract and static be correct answers?
No, abstract is the correct answer. static only means that a nested class doesn't designate an inner class.
Forum: Java Apr 25th, 2005
Replies: 14
Views: 2,028
Posted By Narue
>Everyone misunderstood his question.
No, apparently only paradox misunderstood. Everyone else seemed to get the joke.
Forum: Java Apr 25th, 2005
Replies: 14
Views: 2,028
Posted By Narue
Lazy people who want hand outs deserve what they get.
Forum: Java Apr 25th, 2005
Replies: 14
Views: 2,028
Posted By Narue
>actually I don't believe they are...
The mad literalists answered the only question that was posed:

Since it's clearly a homework assignment, nobody with half a brain would just give away the...
Forum: Java Apr 24th, 2005
Replies: 14
Views: 2,028
Posted By Narue
Recursion is recursive and loops just repeat.
Forum: Java Apr 13th, 2005
Replies: 2
Views: 1,220
Posted By Narue
(int)Math.pow ( 2, b ); // Cast the result of pow to int
Forum: Java Apr 12th, 2005
Replies: 2
Views: 1,112
Posted By Narue
Math.pow(2, b) (http://java.sun.com/j2se/1.5.0/docs/api/)
Forum: Java Apr 11th, 2005
Replies: 3
Views: 5,897
Posted By Narue
>is ArrayList better than Vec
It depends on your needs. If you need a synchronized list and it has to be compatible with Java 1.1 then Vector is an option. Otherwise, ArrayList should be preferred,...
Forum: Java Mar 18th, 2005
Replies: 7
Views: 9,949
Posted By Narue
>Can you be more spesific with the term "linking to text file"

<a href="source.txt">Click here for some Javascript source</a>
Forum: Java Mar 18th, 2005
Replies: 7
Views: 9,949
Posted By Narue
You realize that the only thing in common with Java and Javascript is the word Java, right? What's wrong with just linking to a text file? At least that way you can fit more programs on a single page...
Forum: Java Mar 15th, 2005
Replies: 9
Views: 8,093
Posted By Narue
>I'd have changed it to m except that might be seen as slightly pickish
x is the better choice anyway, or my personal favorite identifier for "a chunk of memory that holds something": shtoobie. My...
Forum: Java Mar 15th, 2005
Replies: 7
Views: 3,573
Posted By Narue
>The greatest arrogance is thinking your ideas are better than those of the majority
Yes, and I'm an arrogant, willful, stubborn person. However, this reeks of the idea that the majority is always...
Forum: Java Mar 15th, 2005
Replies: 1
Views: 5,064
Posted By Narue
It looks fine, though what happens if you have a one or two node tree here?

return isBST(r,r.left.key, r.right.key);

It would be better to come up with some sentinel min and max value to pass...
Forum: Java Mar 15th, 2005
Replies: 9
Views: 8,093
Posted By Narue
>couldn't help tinker and use some more features of the Tiger
I also notice you didn't like my intuitive and obvious name for the HashMap, h. :cheesy:
Forum: Java Mar 15th, 2005
Replies: 7
Views: 3,573
Posted By Narue
>learn proper OO techniques
That I can understand.

>proper Java class naming
Sun recommends a style for Java, but that doesn't mean it has to be used. I disagree with several of their...
Forum: Java Mar 14th, 2005
Replies: 9
Views: 8,093
Posted By Narue
>static int countChars( String str, char searchChar )
This only returns the count for a single character. So to find the most common character, not only would you be forced to call countChars for...
Showing results 1 to 40 of 133

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC