need a code sample for bubble sort

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Kamoski

    #1

    need a code sample for bubble sort


    Hi--

    Please help.

    I need a code sample for bubble sort.

    Thank you.

    --Mark


  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: need a code sample for bubble sort


    Learn C# data structures and algorithms with examples covering arrays, collections, trees, graphs, sorting, CLR behavior, and memory tradeoffs.



    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************** *************** *************** *************** **********
    Think Outside the Box!
    *************** *************** *************** *************** **********
    "Mark Kamoski" <mkamoski@yahoo .com> wrote in message
    news:uhrL$HCjDH A.2232@TK2MSFTN GP09.phx.gbl...[color=blue]
    >
    > Hi--
    >
    > Please help.
    >
    > I need a code sample for bubble sort.
    >
    > Thank you.
    >
    > --Mark
    >
    >[/color]



    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: need a code sample for bubble sort

      Mark Kamoski <mkamoski@yahoo .com> wrote:[color=blue]
      > I need a code sample for <xyz> sort.[/color]

      Well, there are samples for any number of sorts online in various
      different languages - it should be easy enough to convert them to C#.
      Could I ask why you need samples for so many different sorts?

      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      • Brian W

        #4
        Re: need a code sample for bubble sort

        [color=blue]
        > Could I ask why you need samples for so many different sorts?[/color]

        He wants someone to do his homework assignment for him? ;-)


        Comment

        • Cowboy \(Gregory A. Beamer\)

          #5
          Re: need a code sample for bubble sort

          That is highly likely. Since the examples I found were simple google
          searches, I should have pointed to google.com instead. ;->

          --
          Gregory A. Beamer
          MVP; MCP: +I, SE, SD, DBA

          *************** *************** *************** *************** **********
          Think Outside the Box!
          *************** *************** *************** *************** **********
          "Brian W" <brianw@gold_de ath_2_spam_rush .com> wrote in message
          news:uOZV1rCjDH A.4064@TK2MSFTN GP11.phx.gbl...[color=blue]
          >[color=green]
          > > Could I ask why you need samples for so many different sorts?[/color]
          >
          > He wants someone to do his homework assignment for him? ;-)
          >
          >[/color]


          Comment

          • Mark Kamoski

            #6
            Re: need a code sample for bubble sort



            Jon--

            I've got to benchmark performance for these for an "analysis of algorithms"
            course.

            So, it is for an assignment but we have the OK to get the code samples
            anywhere we want.

            We wrote these in last semester's course in C++ but (yes) I don't feel like
            rewriting them.

            So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?

            You decide.

            --Mark


            "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
            news:MPG.19ebac 1362a7b0c19897f 4@msnews.micros oft.com...
            Mark Kamoski <mkamoski@yahoo .com> wrote:[color=blue]
            > I need a code sample for <xyz> sort.[/color]

            Well, there are samples for any number of sorts online in various
            different languages - it should be easy enough to convert them to C#.
            Could I ask why you need samples for so many different sorts?

            --
            Jon Skeet - <skeet@pobox.co m>
            Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

            If replying to the group, please do not mail me too


            Comment

            • Mark Kamoski

              #7
              Re: need a code sample for bubble sort



              Brian--

              Actually, the assignment primarily involves a write-up and a graphing of
              the result of a comparison of the algorithms.

              It is funny because one already knows that some of these have (n^2) running
              time and some have (nlogn) but we need to run the tests.

              As I stated to Jon, above, the prerequisite course involved writing these
              algorithms in C++.

              Am I "lazy" or am I rightly choosing to "avoid reinventing the wheel"?

              You decide. I already know the answer to that one.

              Thank you.

              --Mark


              "Brian W" <brianw@gold_de ath_2_spam_rush .com> wrote in message
              news:uOZV1rCjDH A.4064@TK2MSFTN GP11.phx.gbl...
              [color=blue]
              > Could I ask why you need samples for so many different sorts?[/color]

              He wants someone to do his homework assignment for him? ;-)



              Comment

              • Mark Kamoski

                #8
                Re: need a code sample for bubble sort




                Greg--

                Thank you very much.

                I appreciate it.

                I have more work than time (as usual) and so this helps out a lot.

                Thanks again.

                --Mark





                "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld @comcast.netNoS pamM> wrote in
                message news:O9lOBfCjDH A.2300@TK2MSFTN GP10.phx.gbl...

                Learn C# data structures and algorithms with examples covering arrays, collections, trees, graphs, sorting, CLR behavior, and memory tradeoffs.



                --
                Gregory A. Beamer
                MVP; MCP: +I, SE, SD, DBA

                *************** *************** *************** *************** **********
                Think Outside the Box!
                *************** *************** *************** *************** **********
                "Mark Kamoski" <mkamoski@yahoo .com> wrote in message
                news:uhrL$HCjDH A.2232@TK2MSFTN GP09.phx.gbl...[color=blue]
                >
                > Hi--
                >
                > Please help.
                >
                > I need a code sample for bubble sort.
                >
                > Thank you.
                >
                > --Mark
                >
                >[/color]




                Comment

                • Eric Cadwell

                  #9
                  Re: need a code sample for bubble sort

                  > So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?[color=blue]
                  > You decide.[/color]


                  Your fucking lazy!!!
                  Or your too dumb to do a google search.

                  You decide!

                  -Eric


                  Comment

                  • Eric Cadwell

                    #10
                    Re: need a code sample for bubble sort

                    > So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?[color=blue]
                    > You decide.[/color]


                    Your fucking lazy!!!
                    Or your too dumb to do a google search.

                    You decide!

                    -Eric


                    Comment

                    • Eric Cadwell

                      #11
                      Re: need a code sample for bubble sort

                      > So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?[color=blue]
                      > You decide.[/color]

                      Your f'ing lazy!!!
                      Or your too dumb to do a google search.

                      You decide! The rest of us know the answer to that one.

                      -Eric



                      Comment

                      • Eric Cadwell

                        #12
                        Re: need a code sample for bubble sort

                        > So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?[color=blue]
                        > You decide.[/color]


                        Your f'ing lazy!!!
                        Or your too dumb to do a google search.

                        You decide!

                        -Eric


                        Comment

                        • Mark Kamoski

                          #13
                          Re: need a code sample for bubble sort



                          Eric--

                          Your comments are out of sync with the spirit of a newsgroups intent--
                          namely, to share information with others and to help others.

                          If you don't want to help someone who asks for help, then that is fine.

                          Regardless, you have NOT addressed the other possibility mentioned-- that
                          is, the need for humankind to avoid re-inventing the wheel.

                          Aside from this, you have missed many other points.

                          What if WebSense here does not let me do Google searches but does allow
                          Outlook Express newsgroup access?

                          And so on.

                          Afterall, if you are trying to argue that asking for a code sample of a
                          particular algorithm written in C# is off-topic in a newsgroup called
                          "microsoft.publ ic.dotnet.langu ages.csharp", then there is no point in
                          continuing this conversation.

                          More to the point, I have seen your type of attitude a lot. Someone asks a
                          simple question and they are met with mean-spirited responses. It is
                          typical of someone who is angry and petty.

                          Let's look at something else. Before my posts, when one tried a Find in
                          Outlook Express in this newsgroup,
                          "microsoft.publ ic.dotnet.langu ages.csharp", for something common like
                          "bubble sort", one got no results. Until now, after my posts. Perhaps you
                          don't think it valuable to index and link such information into this
                          newsgroup. So be it. I, however, do believe it is valuable and that's one
                          of the reasons I have posted here.

                          One has to ask-- is it my goal to help people or to simply say "go ask
                          someone else"?

                          I wonder, Eric, how would you answer this question?

                          In short, if one were to extend your thinking as suggested in your message
                          below, this entire newsgroup could be replaced with a single post that
                          simply says "please search Google for your answers", which is, of course,
                          quite silly.

                          This is common today. How many times do people say in verbal
                          conversations.. .

                          "you should check the web on that"

                          ....well, of course. But is this really more than a dodge to answer a
                          question directly? Note that the web is NOT the only source of information.
                          Futhermore, what is the web if not a small segment of human knowledge. Who
                          better to ask about the contents of the human mind than another human.
                          Perhaps this seems odd to you, but to me it does not.

                          Which begs the question, why does this newsgroup exist?

                          It is academic to see that it exists as a place for people to ask questions
                          about the language CSharp, which is precisely what I have done.

                          If you haven't time to come down off your high horse to help someone with a
                          question, then I daresay you are spending your time in the wrong place.

                          What is more, if you time is so precious as to be hindered by the
                          interruptions of simple question, then it is all the more curious as to why
                          you would sacrifice a slice of that precious time to flame a legitimate
                          post. Only you can answer this.


                          Oh well, Eric. Perhaps we see things differently.

                          Let's see what YOU do from here onward.

                          My prediction is that you will either...

                          lash our with some sort of petty, better-than-you, newsgroup bully flame

                          ....or...

                          you will respond rationally and calmly, as civilization and the advancement
                          of knowledge dictates.

                          But, that's just a prediction. Let's see.

                          The future is yours to write, Eric. Use a pencil in case you make a
                          mistake.







                          "Eric Cadwell" <ecadwell@ns.in sight.com> wrote in message
                          news:%23zCsueDj DHA.2248@TK2MSF TNGP12.phx.gbl. ..[color=blue]
                          > So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?
                          > You decide.[/color]

                          Your f'ing lazy!!!
                          Or your too dumb to do a google search.

                          You decide! The rest of us know the answer to that one.

                          -Eric


                          Comment

                          • Kieran Benton

                            #14
                            Re: need a code sample for bubble sort

                            Sorry Mark but your still lazy, I had to do something very similar myself at
                            university and the whole point is to learn by writing them yourself from
                            just the algorithm. If I did what you are doing I would have been done for
                            plagiarism! ;)

                            Kieran

                            "Mark Kamoski" <mkamoski@yahoo .com> wrote in message
                            news:OAjOm$DjDH A.2512@TK2MSFTN GP11.phx.gbl...[color=blue]
                            >
                            >
                            > Eric--
                            >
                            > Your comments are out of sync with the spirit of a newsgroups intent--
                            > namely, to share information with others and to help others.
                            >
                            > If you don't want to help someone who asks for help, then that is fine.
                            >
                            > Regardless, you have NOT addressed the other possibility mentioned-- that
                            > is, the need for humankind to avoid re-inventing the wheel.
                            >
                            > Aside from this, you have missed many other points.
                            >
                            > What if WebSense here does not let me do Google searches but does allow
                            > Outlook Express newsgroup access?
                            >
                            > And so on.
                            >
                            > Afterall, if you are trying to argue that asking for a code sample of a
                            > particular algorithm written in C# is off-topic in a newsgroup called
                            > "microsoft.publ ic.dotnet.langu ages.csharp", then there is no point in
                            > continuing this conversation.
                            >
                            > More to the point, I have seen your type of attitude a lot. Someone asks a
                            > simple question and they are met with mean-spirited responses. It is
                            > typical of someone who is angry and petty.
                            >
                            > Let's look at something else. Before my posts, when one tried a Find in
                            > Outlook Express in this newsgroup,
                            > "microsoft.publ ic.dotnet.langu ages.csharp", for something common like
                            > "bubble sort", one got no results. Until now, after my posts. Perhaps you
                            > don't think it valuable to index and link such information into this
                            > newsgroup. So be it. I, however, do believe it is valuable and that's one
                            > of the reasons I have posted here.
                            >
                            > One has to ask-- is it my goal to help people or to simply say "go ask
                            > someone else"?
                            >
                            > I wonder, Eric, how would you answer this question?
                            >
                            > In short, if one were to extend your thinking as suggested in your message
                            > below, this entire newsgroup could be replaced with a single post that
                            > simply says "please search Google for your answers", which is, of course,
                            > quite silly.
                            >
                            > This is common today. How many times do people say in verbal
                            > conversations.. .
                            >
                            > "you should check the web on that"
                            >
                            > ...well, of course. But is this really more than a dodge to answer a
                            > question directly? Note that the web is NOT the only source of[/color]
                            information.[color=blue]
                            > Futhermore, what is the web if not a small segment of human knowledge. Who
                            > better to ask about the contents of the human mind than another human.
                            > Perhaps this seems odd to you, but to me it does not.
                            >
                            > Which begs the question, why does this newsgroup exist?
                            >
                            > It is academic to see that it exists as a place for people to ask[/color]
                            questions[color=blue]
                            > about the language CSharp, which is precisely what I have done.
                            >
                            > If you haven't time to come down off your high horse to help someone with[/color]
                            a[color=blue]
                            > question, then I daresay you are spending your time in the wrong place.
                            >
                            > What is more, if you time is so precious as to be hindered by the
                            > interruptions of simple question, then it is all the more curious as to[/color]
                            why[color=blue]
                            > you would sacrifice a slice of that precious time to flame a legitimate
                            > post. Only you can answer this.
                            >
                            >
                            > Oh well, Eric. Perhaps we see things differently.
                            >
                            > Let's see what YOU do from here onward.
                            >
                            > My prediction is that you will either...
                            >
                            > lash our with some sort of petty, better-than-you, newsgroup bully flame
                            >
                            > ...or...
                            >
                            > you will respond rationally and calmly, as civilization and the[/color]
                            advancement[color=blue]
                            > of knowledge dictates.
                            >
                            > But, that's just a prediction. Let's see.
                            >
                            > The future is yours to write, Eric. Use a pencil in case you make a
                            > mistake.
                            >
                            >
                            >
                            >
                            >
                            >
                            >
                            > "Eric Cadwell" <ecadwell@ns.in sight.com> wrote in message
                            > news:%23zCsueDj DHA.2248@TK2MSF TNGP12.phx.gbl. ..[color=green]
                            > > So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?
                            > > You decide.[/color]
                            >
                            > Your f'ing lazy!!!
                            > Or your too dumb to do a google search.
                            >
                            > You decide! The rest of us know the answer to that one.
                            >
                            > -Eric
                            >
                            >[/color]


                            Comment

                            • Mark Kamoski

                              #15
                              Re: need a code sample for bubble sort



                              Kieran--

                              I appreciate your response, but your assumptions about MY assignment are
                              simply not correct.

                              Our assignment is to analyze, NOT to write the algorithms.

                              The instructor specifically said "don't bother writing the algorithms...
                              get the algorithms from a book or the internet... this is a course in
                              analysis, not in programming".

                              It sounds like the intent of the course you took is different from the one
                              that I am now taking.

                              Oh well.

                              By the way, I'll take the time to caution everyone to avoid arguing against
                              "code reuse" in general as it is a circular path to "write everything from
                              scratch".

                              Case and Point: Ask yourself-- Did I WRITE the .NET Framework? Do I USE
                              ..NET Framework?

                              And so on.

                              Then again, perhaps we see things differently.

                              Take care.

                              --Mark






                              "Kieran Benton" <kieranbenton athere hotmail.com> wrote in message
                              news:%232wI8OEj DHA.4036@tk2msf tngp13.phx.gbl. ..
                              Sorry Mark but your still lazy, I had to do something very similar myself
                              at
                              university and the whole point is to learn by writing them yourself from
                              just the algorithm. If I did what you are doing I would have been done for
                              plagiarism! ;)

                              Kieran

                              "Mark Kamoski" <mkamoski@yahoo .com> wrote in message
                              news:OAjOm$DjDH A.2512@TK2MSFTN GP11.phx.gbl...[color=blue]
                              >
                              >
                              > Eric--
                              >
                              > Your comments are out of sync with the spirit of a newsgroups intent--
                              > namely, to share information with others and to help others.
                              >
                              > If you don't want to help someone who asks for help, then that is fine.
                              >
                              > Regardless, you have NOT addressed the other possibility mentioned-- that
                              > is, the need for humankind to avoid re-inventing the wheel.
                              >
                              > Aside from this, you have missed many other points.
                              >
                              > What if WebSense here does not let me do Google searches but does allow
                              > Outlook Express newsgroup access?
                              >
                              > And so on.
                              >
                              > Afterall, if you are trying to argue that asking for a code sample of a
                              > particular algorithm written in C# is off-topic in a newsgroup called
                              > "microsoft.publ ic.dotnet.langu ages.csharp", then there is no point in
                              > continuing this conversation.
                              >
                              > More to the point, I have seen your type of attitude a lot. Someone asks[/color]
                              a[color=blue]
                              > simple question and they are met with mean-spirited responses. It is
                              > typical of someone who is angry and petty.
                              >
                              > Let's look at something else. Before my posts, when one tried a Find in
                              > Outlook Express in this newsgroup,
                              > "microsoft.publ ic.dotnet.langu ages.csharp", for something common like
                              > "bubble sort", one got no results. Until now, after my posts. Perhaps you
                              > don't think it valuable to index and link such information into this
                              > newsgroup. So be it. I, however, do believe it is valuable and that's one
                              > of the reasons I have posted here.
                              >
                              > One has to ask-- is it my goal to help people or to simply say "go ask
                              > someone else"?
                              >
                              > I wonder, Eric, how would you answer this question?
                              >
                              > In short, if one were to extend your thinking as suggested in your[/color]
                              message[color=blue]
                              > below, this entire newsgroup could be replaced with a single post that
                              > simply says "please search Google for your answers", which is, of course,
                              > quite silly.
                              >
                              > This is common today. How many times do people say in verbal
                              > conversations.. .
                              >
                              > "you should check the web on that"
                              >
                              > ...well, of course. But is this really more than a dodge to answer a
                              > question directly? Note that the web is NOT the only source of[/color]
                              information.[color=blue]
                              > Futhermore, what is the web if not a small segment of human knowledge.[/color]
                              Who[color=blue]
                              > better to ask about the contents of the human mind than another human.
                              > Perhaps this seems odd to you, but to me it does not.
                              >
                              > Which begs the question, why does this newsgroup exist?
                              >
                              > It is academic to see that it exists as a place for people to ask[/color]
                              questions[color=blue]
                              > about the language CSharp, which is precisely what I have done.
                              >
                              > If you haven't time to come down off your high horse to help someone with[/color]
                              a[color=blue]
                              > question, then I daresay you are spending your time in the wrong place.
                              >
                              > What is more, if you time is so precious as to be hindered by the
                              > interruptions of simple question, then it is all the more curious as to[/color]
                              why[color=blue]
                              > you would sacrifice a slice of that precious time to flame a legitimate
                              > post. Only you can answer this.
                              >
                              >
                              > Oh well, Eric. Perhaps we see things differently.
                              >
                              > Let's see what YOU do from here onward.
                              >
                              > My prediction is that you will either...
                              >
                              > lash our with some sort of petty, better-than-you, newsgroup bully flame
                              >
                              > ...or...
                              >
                              > you will respond rationally and calmly, as civilization and the[/color]
                              advancement[color=blue]
                              > of knowledge dictates.
                              >
                              > But, that's just a prediction. Let's see.
                              >
                              > The future is yours to write, Eric. Use a pencil in case you make a
                              > mistake.
                              >
                              >
                              >
                              >
                              >
                              >
                              >
                              > "Eric Cadwell" <ecadwell@ns.in sight.com> wrote in message
                              > news:%23zCsueDj DHA.2248@TK2MSF TNGP12.phx.gbl. ..[color=green]
                              > > So, am I "lazy" or am I just "trying to avoid re-inventing the wheel"?
                              > > You decide.[/color]
                              >
                              > Your f'ing lazy!!!
                              > Or your too dumb to do a google search.
                              >
                              > You decide! The rest of us know the answer to that one.
                              >
                              > -Eric
                              >
                              >[/color]



                              Comment

                              Working...