A community for students.
Here's the question you clicked on:
 0 viewing
robots_rock
 2 years ago
I am trying to finish a set of problems give to me by my teacher.
I am using C
I need to know about Arrays and How to find the mode inside an array.
robots_rock
 2 years ago
I am trying to finish a set of problems give to me by my teacher. I am using C I need to know about Arrays and How to find the mode inside an array.

This Question is Open

adhokshaj
 2 years ago
Best ResponseYou've already chosen the best response.3what do you mean by "mode"??

agdgdgdgwngo
 2 years ago
Best ResponseYou've already chosen the best response.1The mode is the most frequently occurring element. This problem seems simple enough at first glance, but then you realize that an efficient solution requires playing with different kinds of data structures :) A C example is here: http://rosettacode.org/wiki/Averages/Mode#C but it seems way too complicated for my tastes.

agdgdgdgwngo
 2 years ago
Best ResponseYou've already chosen the best response.1A simple way to do it is to sort the thing and then search for the longestrecurring element.

adhokshaj
 2 years ago
Best ResponseYou've already chosen the best response.3It can be done without sorting as well. Just create a hash table to store element as key, and total no. of repetitions as value. Traverse the source array, and upate the hash table for each element detected. After traversal, iterate through the hash table to find the key with maximum value.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.