Click here to Skip to main content
15,888,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: Consuming SAP Web Service in C# Pin
Richard MacCutchan15-Feb-15 23:35
mveRichard MacCutchan15-Feb-15 23:35 
GeneralRe: Consuming SAP Web Service in C# Pin
Amoxtli15-Feb-15 23:41
Amoxtli15-Feb-15 23:41 
GeneralRe: Consuming SAP Web Service in C# Pin
Amoxtli16-Feb-15 1:18
Amoxtli16-Feb-15 1:18 
GeneralRe: Consuming SAP Web Service in C# Pin
Richard MacCutchan16-Feb-15 1:20
mveRichard MacCutchan16-Feb-15 1:20 
GeneralRe: Consuming SAP Web Service in C# Pin
Amoxtli16-Feb-15 1:25
Amoxtli16-Feb-15 1:25 
QuestionCan PdfFileWriter Support Chinese? Pin
gzhmrj15-Feb-15 22:23
gzhmrj15-Feb-15 22:23 
AnswerRe: Can PdfFileWriter Support Chinese? Pin
OriginalGriff15-Feb-15 22:26
mveOriginalGriff15-Feb-15 22:26 
Questioni need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
Member 1135438615-Feb-15 20:31
Member 1135438615-Feb-15 20:31 
I need the input strings to display unsorted first ... then call mergesort to arrange them alphabetically which I can not find any guidance with
The original merge sort works with the numbers and I understand that but getting the size of the array for names to be sorted is confusing me and wont work


C#
private void btnExecute_Click(object sender, EventArgs e)
      {
          int length = Int32.Parse(Microsoft.VisualBasic.Interaction.InputBox("Enter a Number for how many Names to Sort :"));

          string[] nameArray = new string[length];
          foreach (string n in nameArray)
          {
              string name = Microsoft.VisualBasic.Interaction.InputBox("Enter " + length + " Names to add to Array:");

              length = length - 1;
              txtOutput.Text += name + "\r\n";

          }

          txtOutput.Text += nameArray.Length + "Names Added to List Unsorted  ";
          //txtOutput.Text += "Sorted List : " + "\r\n";
          //mergeSort(nameArray, 0, nameArray.Length - 1);
          //foreach (string i in nameArray)
          //{
          //    txtOutput.Text += i + "\t";
          //}
      }
       public void mergeSort(string[] nameArray, int lower, int upper)
      {
          int middle;
          if (upper == lower)
              return;
          else
          {
              middle = (lower + upper) / 2;
              mergeSort(nameArray, lower, middle);
              mergeSort(nameArray, middle + 1, upper);
              Merge(nameArray, lower, middle + 1, upper);
          }
      }

      public void Merge(string[] nameArray, int lower, int middle, int upper)
      {
          string[] temp = new string[nameArray.Length];
          int lowEnd = middle - 1;
          int low = lower;
          int n = upper - lower + 1;
          while ((lower <= lowEnd) && (middle <= upper))
          {
              if ((nameArray[lower]).CompareTo(nameArray[middle]) <= 0) // https://msdn.microsoft.com/en-us/library/fkw3h78a(v=vs.110).aspx
              {
                  temp[low] = nameArray[lower];
                  low++;
                  lower++;
              }
              else
              {
                  temp[low] = nameArray[middle];
                  low++;
                  middle++;
              }
          }
          while (lower <= lowEnd)
          {
              temp[low] = nameArray[lower];
              low++;
              lower++;
          }
          while (middle <= upper)
          {
              temp[low] = nameArray[middle];
              low++;
              middle++;
          }
          for (int i = 0; i < n; i++)
          {
              nameArray[upper] = temp[upper];
              upper--;
          }
      }
  }

AnswerRe: i need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
OriginalGriff15-Feb-15 20:42
mveOriginalGriff15-Feb-15 20:42 
GeneralRe: i need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
Member 1135438616-Feb-15 11:44
Member 1135438616-Feb-15 11:44 
GeneralRe: i need to convert merge sort algorithm to accept arrays then sort them this is the code I need to modify Pin
OriginalGriff16-Feb-15 23:24
mveOriginalGriff16-Feb-15 23:24 
QuestionExecute cobol code using c#.net Pin
Member 1144452115-Feb-15 20:04
Member 1144452115-Feb-15 20:04 
AnswerRe: Execute cobol code using c#.net Pin
Garth J Lancaster15-Feb-15 20:19
professionalGarth J Lancaster15-Feb-15 20:19 
AnswerRe: Execute cobol code using c#.net Pin
OriginalGriff15-Feb-15 20:36
mveOriginalGriff15-Feb-15 20:36 
QuestionCan any one give me some hints on how to solve this problem? Pin
Truck5315-Feb-15 5:11
Truck5315-Feb-15 5:11 
AnswerRe: Can any one give me some hints on how to solve this problem? Pin
OriginalGriff15-Feb-15 5:39
mveOriginalGriff15-Feb-15 5:39 
AnswerRe: Can any one give me some hints on how to solve this problem? Pin
Dave Kreskowiak15-Feb-15 17:39
mveDave Kreskowiak15-Feb-15 17:39 
AnswerRe: Can any one give me some hints on how to solve this problem? Pin
phil.o17-Feb-15 3:20
professionalphil.o17-Feb-15 3:20 
Questionhow to identify rectangles in a bitmap Pin
neodeaths15-Feb-15 4:30
neodeaths15-Feb-15 4:30 
AnswerRe: how to identify rectangles in a bitmap Pin
Afzaal Ahmad Zeeshan15-Feb-15 4:39
professionalAfzaal Ahmad Zeeshan15-Feb-15 4:39 
QuestionA question about "bulk" Pin
Afzaal Ahmad Zeeshan14-Feb-15 22:04
professionalAfzaal Ahmad Zeeshan14-Feb-15 22:04 
AnswerRe: A question about "bulk" Pin
OriginalGriff14-Feb-15 22:26
mveOriginalGriff14-Feb-15 22:26 
AnswerRe: A question about "bulk" Pin
Richard Andrew x6415-Feb-15 1:36
professionalRichard Andrew x6415-Feb-15 1:36 
GeneralRe: A question about "bulk" Pin
Afzaal Ahmad Zeeshan15-Feb-15 2:44
professionalAfzaal Ahmad Zeeshan15-Feb-15 2:44 
GeneralRe: A question about "bulk" Pin
Garth J Lancaster15-Feb-15 20:21
professionalGarth J Lancaster15-Feb-15 20:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.