Announcement

Collapse
No announcement yet.

Hauldren Collider's Computer Science Challenge

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hauldren Collider's Computer Science Challenge

    Write a program that will perform binary search on a linked list.

    (This was on one of my problem sets the other day. Very depressing.)
    If there is no sound in space, how come you can hear the lasers?
    ){ :|:& };:

  • #2
    In another universe I've already done that.

    Comment


    • #3
      It's possible to do, just incredibly stupid.
      If there is no sound in space, how come you can hear the lasers?
      ){ :|:& };:

      Comment


      • #4
        What's a linked list?
        “As a lifelong member of the Columbia Business School community, I adhere to the principles of truth, integrity, and respect. I will not lie, cheat, steal, or tolerate those who do.”
        "Capitalism ho!"

        Comment


        • #5

          Comment


          • #6
            A list of values that are linked to each other by pointers. Basically you start with the head, which includes a value and then the address of the next node. You can only get from one end to the other by following all of the "links" (addresses). This is in contrast to an ordinary list where you can just access any node at random.
            If there is no sound in space, how come you can hear the lasers?
            ){ :|:& };:

            Comment


            • #7
              So you can make Mandelbrot linked lists?
              “As a lifelong member of the Columbia Business School community, I adhere to the principles of truth, integrity, and respect. I will not lie, cheat, steal, or tolerate those who do.”
              "Capitalism ho!"

              Comment


              • #8
                Originally posted by Hauldren Collider View Post
                A list of values that are linked to each other by pointers. Basically you start with the head, which includes a value and then the address of the next node. You can only get from one end to the other by following all of the "links" (addresses). This is in contrast to an ordinary list where you can just access any node at random.
                Uh oh, better edit this with an admission that you cross-posted.

                Comment


                • #9
                  Originally posted by DaShi View Post
                  So you can make Mandelbrot linked lists?
                  Hm, that sounds about as nonsensical as running binary search on a linked list...so.....maybe?
                  If there is no sound in space, how come you can hear the lasers?
                  ){ :|:& };:

                  Comment


                  • #10
                    Instead of self-similarity you would have to use recursion due to memory constraints, so it really wouldn't be a Mandelbrot.

                    (This is the first thing that popped into my head, I don't care if it's true or not.)

                    Comment


                    • #11
                      Code:
                      dont();
                      SP
                      I got the Jete from C.C. Sabathia. : Jon Miller

                      Comment


                      • #12
                        Why would you run a binary search on a linked list? It will have the same asymptotic worst case as a regular full scan of the linked list, and I don't think that the linear coefficients or the lower order terms would make any valuable difference.
                        The algorithm is easy to write, just plainly pointless.

                        Comment


                        • #13
                          Originally posted by Carreidas View Post
                          Why would you run a binary search on a linked list? It will have the same asymptotic worst case as a regular full scan of the linked list, and I don't think that the linear coefficients or the lower order terms would make any valuable difference.
                          The algorithm is easy to write, just plainly pointless.
                          Correct. As for why anyone would do this, ask my professor, I have no idea. I think he was trying to demonstrate the disadvantages of linked lists/binary search, but the idea of running binary search on a linked list is just nonsense.

                          This whole class is kind of depressing. It's the most advanced CS class available to freshmen, but I did all this stuff in my junior year of high school. Oh well. I get an easy semester.
                          If there is no sound in space, how come you can hear the lasers?
                          ){ :|:& };:

                          Comment


                          • #14
                            It' viable if your comparison check is VERY expensive and your list has been sorted beforehand. This still means that the man who decided to use a list was either retarded or an Indian.
                            Graffiti in a public toilet
                            Do not require skill or wit
                            Among the **** we all are poets
                            Among the poets we are ****.

                            Comment


                            • #15
                              Originally posted by onodera View Post
                              It' viable if your comparison check is VERY expensive and your list has been sorted beforehand. This still means that the man who decided to use a list was either retarded or an Indian.
                              Yes, that was an observation I made, but when would these two things simultaneously be true?
                              If there is no sound in space, how come you can hear the lasers?
                              ){ :|:& };:

                              Comment

                              Working...
                              X