Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8593211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:56:14+00:00 2026-06-11T23:56:14+00:00

I was going through this tutorial on the analysis of the Selection sort algorithm

  • 0

I was going through this tutorial on the analysis of the Selection sort algorithm (personal.denison.edu/~kretchmar/272/SelectionSortAnalysis.pdf). I have been spending quite some time on understanding algorithmic analysis and have not been completely successful.

If you look at the PDF, there are certain ‘times’ associated with c3,c4 an c5. I have no idea why the author added the summation symbol, why he chose the top and bottom indexes and why he chose the ‘(i+1)’ after the first summation. I understand that the summation notation is a compact way to express the sum of a set of numbers… but I can’t seem to complete the puzzle.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:56:15+00:00Added an answer on June 11, 2026 at 11:56 pm

    1) He’s summing the values from the outer loop (line 1). That’s why he uses i (the index variable from the outer loop).

    2) It’s traditional to write Σ expressions with the start value less than the end value. However, in this case the number of times the inner loop will execute for some i is n – i. When i is 1 (the start of the loop), the inner loop will execute n – 1 times, and when i gets up to n – 1 at the end of the outer loop, the inner loop will execute 1 time (n – (n – 1)). So you might want to write that as sum(i = n-1 -> 1), but as I said the tradition is to write it from smallest to largest.

    3) The loop executes i times, but the loop test executes i + 1 times: i times successfully and once unsuccessfully, terminating the loop. Hence the value summed inside the loop body is i, but the value summed for the loop termination test itself (i.e.. the for statement) is i + 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am going through this WPF tutorial http://blogs.vertigo.com/personal/alanl/Blog/Lists/Posts/Post.aspx?ID=18 and I have a question about
I am going through this tutorial , but I already had Ruby 1.8.7 installed.
I am going through this tutorial about PDO and have come to the point
Trying to learn a bit about PDO and is going through this tutorial .
I am going through a tutorial on XNA, and it uses this code: private
I'm going through this tutorial: http://tutorials.jumpstartlab.com/projects/jsattend.html In iteration 7, step 3 we get to
I been going through this tutorial http://www.codeproject.com/KB/linq/BulkOperations_LinqToSQL.aspx and them make a SP like this
I'm going through the w3cschools XSLT tutorial, and I am at this page: xsl-if
So I'm going through this tutorial that seems so simple but I can't seem
I was going through this tutorial in order to learn how Django works: https://docs.djangoproject.com/en/dev/intro/tutorial01/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.