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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C#
2 Posts 2 Posters 0 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.
  • G Offline
    G Offline
    gamer1127
    wrote on last edited by
    #1

    [Message Deleted]

    G 1 Reply Last reply
    0
    • G gamer1127

      [Message Deleted]

      G Offline
      G Offline
      ghelhei
      wrote on last edited by
      #2

      jai eto nkita ko code public void RadixSort(int[] a) { // our helper array int[] t=new int[a.Length]; // number of bits our group will be long int r=4; // try to set this also to 2, 8 or 16 to see if it is //quicker or not // number of bits of a C# int int b=32; // counting and prefix arrays // (note dimensions 2^r which is the number of all possible values of a //r-bit number) int[] count=new int[1<<r]; int[] pref=new int[1<<r]; // number of groups int groups=(int)Math.Ceiling((double)b/(double)r); // the mask to identify groups int mask = (1<<r)-1; // the algorithm: for (int c=0, shift=0; c<groups; c++, shift+=r) { // reset count array for (int j=0; j<count.Length; j++) count[j]=0; // counting elements of the c-th group for (int i=0; i<a.Length; i++) count[(a[i]>>shift)&mask]++; // calculating prefixes pref[0]=0; for (int i=1; i<count.Length; i++) pref[i]=pref[i-1]+count[i-1]; // from a[] to t[] elements ordered by c-th group for (int i=0; i<a.Length; i++) t[pref[(a[i]>>shift)&mask]++]=a[i]; // a[]=t[] and start again until the last group t.CopyTo(a,0); } // a is sorted }

      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