Hi, I'm trying to build a heap sort Swing application and I decided to keep it simple for now so I'll only heap sort 3 nodes so I got the nodes (yellow circles) to draw and show up as a tree shape...
Type: Posts; User: IHeartProgramming
Hi, I'm trying to build a heap sort Swing application and I decided to keep it simple for now so I'll only heap sort 3 nodes so I got the nodes (yellow circles) to draw and show up as a tree shape...
Appreciate today's encouragements, it works! This is what I did, so now I just have to have a longer timer delay. Thanks Norm. Another questions, I'm wanting to build a selection sort and the change...
I just updated the latest code I had above, it so it compiles and runs, but nothing shows up in canvas. Appreciate it.
I made a separate method (called change_color) that handles the color change and it compiles and runs but it's a blank canvas, here's the latest (I re-posted the entire class below)
import...
How would I carry out the action performed since I need to pass the listener to the Timer in the constructor because I can't put the variable updateTask outside since it needs to reference the g2d...
ok I moved the Timer to constructor, but currently it only displays the yellow circle. I also created a method to change color with a reference to same Graphics2D object. This is the complete...
I'll try that but also which way is preferred or does it not matter, so I mean should I create instance of ActionListener object and separate instance of Timer obj or should I just do former with...
So I shouldn't be using thread and timer? Currently I just alternate by checking the remainding of the count so if a number has no remainder by using mod operation, then change to this color else...
I want to change the color of the circle. I passed as param a Graphics obj in order to work with the same object, but it's not animating the colors to alternate between green and blue, starting...
Hi, this is simple but I can't get it it to work. I want an initially yellow circle to then alternate b/t colors of green and blue. And also why can's I use the parameterized repaint method, it...
Hi, I'm trying to build simple bounching ball (eventually), so I thought I'd start with unrealistic bouncing so balls goes from top to bottom of returns back to the top in a loop. So currently the...
Actually I wanted the Dog class to be the anonymous inner class, I think that's what you meant and I understand the poorly named class of: AnonymousInnerClass. So if use of anonymous inner is to...
Hi, I'm trying to practice with anonymous inner classes, so I written a simple Dog class, AnonymousInnerClass class that uses Dog as an anonymous inner class and the main method in class:...
Appreciate it, I have took time to learn background behind it, so now new problem, I understand everything being done for this example from Oracle's tutorials on custom graphics but I'm unsure why...
Hi, I'm trying to build a heap sort Swing applet, and at the moment I just want to output the binary heap and except for the positioning of the nodes which I'll have to mess around later, it's fine,...
Hi, I need some suggestions, more solid ones for choosing a research topic. I'm in my final year and I could opt to read over papers to support existing research paper or expand on an existing...
I'm still confused, would appreciate further clarification if not too much trouble. Let's use the OP example. So this is from WIkipedia, and is it only one bucket array, so we don't have multiple...
When would alpha-beta pruning be an overhead rather than reduce time for AI to make a move? Any help appreciated.
Sorry about that, reading the sections before posting is important:). But can you clarify why there is distinction between preprocessing time and matching time?
Hi,
I'm learning string matching algorithms and I'm curious why there is a preprocessing time and matching time. Any clarification appreciated.
Hi, how do I know what to set the range of values and how many buckets to use with bucket sort?
E.g. from Wikipedia: [29,25,3,49,9,37,21,43]
They used 5 buckets of size 10
I know it's supposed...
So many dumb names when I looked it up in Wikipedia which makes it confusing, but to make sure I'll use these terms:
1) bi-directional bubble sort: alternate going thru list from both ends until...
Hi, I'm reading up on Wikipedia and it uses shaker sort is optimization, are they actually 2 different algorithms. I can't seem to find it when I google for optimized selection sort. I thought shaker...
Hi,
so shaker sort is supposed to be bi-directional bubble sort but I tried with an example, how is is it any better than regular, terrible bubble sort?
e.g.
n = 12
I put braces around the...
Hi, I'm studying for a test and trying to practice with alpha beta pruining. I found this site that I can practice potentially both (minimax with and without alpha beta, it's an applet), but it...