Advertisement

10.13.2008 at 09:26PM PDT, ID: 23811694
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.6

Ho w do I design a more robust O(n^2) algorithm?

Asked by pmjg23 in Algorithms, Microsoft Excel Spreadsheet Software, Microsoft Applications

Tags:

I have created an O(n^2) algorithm, but like it to be more robust and quicker if possible as it might be used repeatedly on fairly large data sets. It should also be able to adjust the ouput array length to the right value. It will be used with two conditioning columns determining whether a row is to be sorted at all (as in the example), but it would be great if you could write something that accepted a variable number of conditioning columns.

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
Ex Code:
Sub test()
answer = mySort(3, 1, 2, "Sample", "Test")
MsgBox "Sorted row numbers of Sample orgs that Test:"
i = 1
Do While answer(i) <> -1
MsgBox answer(i)
i = i + 1
Loop
End Sub
 
 
Function mySort(objectiveCol As Integer, conditionCol1 As Integer, conditionCol2 As Integer, conditionValue1 As String, conditionValue2 As String)
Dim indices(10) As Integer
For i = 1 To 10
indices(i) = -1
Next
 
For i = 3 To 27
    If Cells(i, conditionCol1) = conditionValue1 And Cells(i, conditionCol2) = conditionValue2 Then
         If indices(1) = -1 Then
            indices(1) = i
         Else
            j = 1
            Do While indices(j) <> -1
                If Cells(i, objectiveCol).Value > Cells(indices(j), objectiveCol).Value Then
                    For k = 9 To j + 1 Step -1
                        indices(k) = indices(k - 1)
                    Next
                    indices(j) = i
                    Exit Do
                End If
            j = j + 1
            Loop
         End If
    End If
Next
mySort = indices
End Function
[+][-]10.13.2008 at 11:26PM PDT, ID: 22708983

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 12:54PM PDT, ID: 22715331

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.15.2008 at 12:16PM PDT, ID: 22724633

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Algorithms, Microsoft Excel Spreadsheet Software, Microsoft Applications
Tags: VB, VBA
Sign Up Now!
Solution Provided By: pepr
Participating Experts: 1
Solution Grade: B
 
 
[+][-]10.15.2008 at 12:33PM PDT, ID: 22724835

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.18.2008 at 01:34PM PDT, ID: 22749672

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.23.2008 at 07:54AM PDT, ID: 22786771

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.23.2008 at 08:15AM PDT, ID: 22787041

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628