Search:

Type: Posts; User: IHeartProgramming

Page 1 of 3 1 2 3

Search: Search took 0.18 seconds.

  1. Replies
    1
    Views
    1,264

    Trouble with drawing a heap

    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...
  2. Re: How to animate a circle changing color

    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...
  3. Re: How to animate a circle changing color

    I just updated the latest code I had above, it so it compiles and runs, but nothing shows up in canvas. Appreciate it.
  4. Re: How to animate a circle changing color

    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...
  5. Re: How to animate a circle changing color

    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...
  6. Re: How to animate a circle changing color

    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...
  7. Re: How to animate a circle changing color

    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...
  8. Re: How to animate a circle changing color

    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...
  9. Re: How to animate a circle changing color

    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...
  10. How to animate a circle changing color

    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...
  11. Help with simple "bouncing" ball Swing application

    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...
  12. Replies
    3
    Views
    1,332

    Re: Help with Anonymous Inner class

    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...
  13. Replies
    3
    Views
    1,332

    Help with Anonymous Inner class

    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:...
  14. Replies
    3
    Views
    1,185

    Re: Help with Swing applet

    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...
  15. Replies
    3
    Views
    1,185

    Help with Swing applet

    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,...
  16. Replies
    0
    Views
    1,242

    Coming up with research topic

    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...
  17. Re: How to know size and number of buckets in bucket sort

    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...
  18. Replies
    1
    Views
    1,858

    Re: Alpha-beta pruning example

    When would alpha-beta pruning be an overhead rather than reduce time for AI to make a move? Any help appreciated.
  19. Replies
    3
    Views
    1,424

    Re: String matching

    Sorry about that, reading the sections before posting is important:). But can you clarify why there is distinction between preprocessing time and matching time?
  20. Replies
    3
    Views
    1,424

    String matching

    Hi,

    I'm learning string matching algorithms and I'm curious why there is a preprocessing time and matching time. Any clarification appreciated.
  21. How to know size and number of buckets in bucket sort

    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...
  22. Replies
    3
    Views
    2,733

    Re: optimized selection sort

    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...
  23. Replies
    3
    Views
    2,733

    optimized selection sort

    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...
  24. Replies
    1
    Views
    2,020

    shaker sort

    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...
  25. Replies
    1
    Views
    1,858

    Alpha-beta pruning example

    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...
Results 1 to 25 of 62
Page 1 of 3 1 2 3