Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. What happens when a Java coder decides to explain a Red Black Tree in C#?

What happens when a Java coder decides to explain a Red Black Tree in C#?

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpjavaphpvisual-studiocom
5 Posts 4 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    leppie
    wrote on last edited by
    #1

    Page 1 - good Page 2 - good Page 3 - I see at least 5 programming mistakes in the sample code... :wtf: http://www.devx.com/DevX/Article/36196/0/page/1[^] Not bad, but that last page really spoilt it for me :(

    xacc.ide
    IronScheme a R5RS-compliant Scheme on the DLR
    The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

    P R M 3 Replies Last reply
    0
    • L leppie

      Page 1 - good Page 2 - good Page 3 - I see at least 5 programming mistakes in the sample code... :wtf: http://www.devx.com/DevX/Article/36196/0/page/1[^] Not bad, but that last page really spoilt it for me :(

      xacc.ide
      IronScheme a R5RS-compliant Scheme on the DLR
      The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You'd think that he could have at least tried to compile the code. How hard could it be?

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      1 Reply Last reply
      0
      • L leppie

        Page 1 - good Page 2 - good Page 3 - I see at least 5 programming mistakes in the sample code... :wtf: http://www.devx.com/DevX/Article/36196/0/page/1[^] Not bad, but that last page really spoilt it for me :(

        xacc.ide
        IronScheme a R5RS-compliant Scheme on the DLR
        The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

        R Offline
        R Offline
        Rizwan Yasin
        wrote on last edited by
        #3

        nothing happens, C# is just as Java (i bet u can learn it with in 3 hrs :) excepts advance), and a programmer goes for concepts not the mistakes u done in syntax, of course if u compiled, it means u don't have syntax error. and also data structure/algorithm r independent to language, so conclusion = nothing happens:cool:

        programming is just like poetry

        L 1 Reply Last reply
        0
        • R Rizwan Yasin

          nothing happens, C# is just as Java (i bet u can learn it with in 3 hrs :) excepts advance), and a programmer goes for concepts not the mistakes u done in syntax, of course if u compiled, it means u don't have syntax error. and also data structure/algorithm r independent to language, so conclusion = nothing happens:cool:

          programming is just like poetry

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          Rizwan Yasin wrote:

          C# is just as Java

          If you are happy with comparing apples to pears, and coding like a absolute beginner, then thats up to you. Please note, I said mistakes, not errors.

          Rizwan Yasin wrote:

          and also data structure/algorithm r independent to language

          Thats why I considered page 1 and 2 as good content.

          xacc.ide
          IronScheme a R5RS-compliant Scheme on the DLR
          The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

          1 Reply Last reply
          0
          • L leppie

            Page 1 - good Page 2 - good Page 3 - I see at least 5 programming mistakes in the sample code... :wtf: http://www.devx.com/DevX/Article/36196/0/page/1[^] Not bad, but that last page really spoilt it for me :(

            xacc.ide
            IronScheme a R5RS-compliant Scheme on the DLR
            The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

            M Offline
            M Offline
            Mike Dimmick
            wrote on last edited by
            #5

            I have to say I can't see that many problems. Discarding every other random number is a bit weird in the first example. Throughout there's a reliance on the low-precision system clock returned with DateTime.Now and TimeSpan.Milliseconds returns the milliseconds part only, you should use TotalMilliseconds if you want it to tell you how many seconds elapsed. For more accurate timing results use a System.Diagnostics.Stopwatch. At this point any collection which doesn't support generics is pretty stupid, the whole thing should be parameterized on T with a restriction that T derives from IComparable<T> or allows you to supply an IComparer<T>. I'd like to see a comparison with inserting into a sorted ArrayList or List<T> and using BinarySearch. A lot of emphasis is put on the computational algorithmic complexity of data structures and algorithms, but these days practical algorithm performance is based on memory speed hierarchies, and cache locality is very important. Further, an array typically represents a lower load on the garbage collector than a deeply-linked data structure (fewer pointers to follow). There is a reason why Microsoft didn't and still don't supply linked list or binary tree structures with the .NET Framework.

            DoEvents: Generating unexpected recursion since 1991

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups