(N–1)+(N–2)+(N–3)+ ... + 1 = N *(N–1)/2的证明是什么 [英] What is the proof of of (N–1) + (N–2) + (N–3) + ... + 1= N*(N–1)/2

查看:229
本文介绍了(N–1)+(N–2)+(N–3)+ ... + 1 = N *(N–1)/2的证明是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从气泡排序算法的一本数据结构书中得到了这个公式.

I got this formula from a data structure book in the bubble sort algorithm.

我知道我们是(n-1)*(n次),但是为什么要除以2?

I know that we are (n-1) * (n times), but why the division by 2?

任何人都可以向我解释一下或提供详细的证明.

Can anyone please explain this to me or give the detailed proof for it.

谢谢

推荐答案

请参见三角形数字.

这篇关于(N–1)+(N–2)+(N–3)+ ... + 1 = N *(N–1)/2的证明是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆