Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C# Question

Featured Replies

7HV9osE.png

How would one go about this? Yes im stupid as fuck

6 minutes ago, upotudrop said:

7HV9osE.png

How would one go about this? Yes im stupid as fuck


private void SortArrayWithShellSort()
        {
            int[] array = { 297,183, 464 };
            ShellSort(array);            
        }
       
 
        private void ShellSort(int[] array)
        {
            int n = array.Length;
            int gap = n / 2;
            int temp;
 
            while (gap > 0)
            {
                for (int i = 0; i + gap < n; i++)
                {
                    int j = i + gap;
                    temp = array[j];
 
                    while (j - gap >= 0 && temp < array[j - gap])
                    {
                        array[j] = array[j - gap];
                        j = j - gap;
                    }
 
                    array[j] = temp;
                }
 
                gap = gap / 2;
            }
        }

From google.

Now simply add a console.writeline of the array after each insertion.

 

EDIT:

        static void show_array_elements(int[] arr)
        {
            foreach (var element in arr)
            {
                Console.Write(element + " ");
            }
            Console.Write("\n");

        }

For printing the array

Edited by HunterRS

Eh more info? What part do you not understand? Do you even have an IDE? I assume this is for school, and if so I'd recommend you to try yourself first, information how to solve all parts of your assignment can be googled. Just copy-pasting something someone gives you will just give you more trouble your next assignment.

7 minutes ago, Product said:

Eh more info? What part do you not understand? Do you even have an IDE? I assume this is for school, and if so I'd recommend you to try yourself first, information how to solve all parts of your assignment can be googled. Just copy-pasting something someone gives you will just give you more trouble your next assignment.

You have to start somewhere, no one should just copy paste but going over the code and understanding what each part of it does will help you understand and handle this type of assignments in the future.

Edited by HunterRS

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.