Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Jun 2002
    Location
    Georgia, U. S. A.
    Posts
    90
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I'm writing a program in C# and want to figure out the mode of an array of integers. Is there a way to use the Excel Mode() function which returns the value or is there an easy way to duplicate that function by writing my own in C#? J. P. Zinn

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    I don't develop in Visual Studio, but if you don't need Excel for any other purpose, I wouldn't instantiate it just for this. Searching on the web turns up sample code such as: The Most frequent Number in an array @ Stack Overflow. I'm sure you can find others. If you hit upon a particularly efficient solution, or hit a brick wall with your project, please post back.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •