当前位置: 首页 > news >正文

文案写作网站新媒体运营培训学校

文案写作网站,新媒体运营培训学校,wordpress自动清缓存,wordpress特色图像 外链数据结构基本概念-Java常用算法 1、数据结构基本概念2、数据逻辑结构3、算法时间复杂度 1、数据结构基本概念 数据(Data):数据是信息的载体,其能够被计算机识别、存储和加工处理,是计算机程序加工的“原材料”。数据元…

数据结构基本概念-Java常用算法

  • 1、数据结构基本概念
  • 2、数据逻辑结构
  • 3、算法时间复杂度


1、数据结构基本概念

  • 数据(Data):数据是信息的载体,其能够被计算机识别、存储和加工处理,是计算机程序加工的“原材料”。
  • 数据元素(Data Element):数据元素是数据的基本单位,其也称元素、结点、顶点、记录等。一般来说,一个数据元素可以由若干个数据组成,数据项是具有独立含义的最小标识单位。数据项也可称为字段、域、属性等。
  • 数据结构(Data Structure):数据结构指的是数据之间的相互关系,也就是数据的组织形式。

数据结构的内容:

  • 数据的逻辑结构: 线性结构、树型结构、图结构
  • 数据的存储结构: 顺序存储、链式存储
  • 数据操作: 也就是数据的运算,基于数据的逻辑结构上,最常用的运算包括检索、插入、删除、更新、排序等。

数据类型: 通常是指高级程序设计语言支持的基本数据类型,如C/C++、Java、Python、Kotlin等。
抽象数据类型: 数据的组织,及其相关的操作。

2、数据逻辑结构

  • 线性结构 除第一个和最后一个数据元素外,每个数据只有一个唯一的前驱数据元素和一个唯一个的后驱数据元素。
    在这里插入图片描述

  • 树型结构 除根节点外,每个数据元素只有一个唯一的前驱数据元素,可有零个或若干个后驱数据元素。
    在这里插入图片描述

  • 图型结构 每个数据元素可有零个或若干个前驱数据元素和零个或若干个后驱数据元素。
    在这里插入图片描述

3、算法时间复杂度

算法时间复杂度: 算法的耗时与算法所处理的数据个数 n 的函数关系的分析;主要分析算法的耗时与算法处理数据个数 n数量级 意义上的函数关系。

算法的时间复杂度与空间复杂度通常是矛盾的。目前计算机内存下降趋势下,当发生矛盾时,对于大多数情况来说,算法的时间复杂度应首先被考虑。


【定义】 T ( x ) = O ( f ( n ) ) T(x) = O(f(n)) T(x)=O(f(n))当且仅当存在正常数 c c c n 0 n_{0} n0,对所有的 n ( n ≥ n 0 ) n(n\ge n_{0} ) n(nn0)满足 T ( n ) ≤ c f ( n ) T(n)\le cf(n) T(n)cf(n)

当算法的时间复杂度 T ( n ) T(n) T(n)和数据个数 n n n无关系时, T ( n ) ≤ c × 1 T(n) \le c\times 1 T(n)c×1,所以此时算法的时间复杂度 T ( n ) = O ( 1 ) T(n) = O(1) T(n)=O(1)
当算法的时间复杂度 T ( n ) T(n) T(n)和数据个数 n n n为线性关系时, T ( n ) ≤ c n T(n)\le cn T(n)cn,所以此时算法的时间复杂度 T ( n ) = O ( n ) T(n) = O(n) T(n)=O(n)
当算法的时间复杂度 T ( n ) T(n) T(n)和数据个数 n n n为平方关系时, T ( n ) ≤ c n 2 T(n)\le cn^2 T(n)cn2,所以此时算法的时间复杂度 T ( n ) = O ( n 2 ) T(n) = O(n^2) T(n)=O(n2)
依次类推,还有 O ( n 3 ) O(n^3) O(n3) O ( log ⁡ 2 n ) O(\log_{2}{n}) O(log2n) O ( lg ⁡ n ) O(\lg_{}{n}) O(lgn) O ( lg ⁡ n ) O(\lg_{}{n}) O(lgn) O ( 2 n ) O(2^n) O(2n)

算法的时间复杂度是衡量一个算法好坏的重要指标。一般来说,具有多项式时间复杂度(如 O ( n ) O(n) O(n) O ( n 2 ) O(n^2) O(n2) O ( n 6 ) O(n^6) O(n6)等)的算法,是可以接收的、可实际使用的算法;而具有指数时间复杂度(如 O ( 2 n ) O(2^n) O(2n) O ( n n ) O(n^n) O(nn) O ( n ! ) O(n!) O(n!)等)的算法,是理论上可以计算,但实际上不可计算的问题,通常称作难解的问题。

i i i n n n n 2 n^2 n2 n 3 n^3 n3 2 n 2^n 2n n ! n! n! n n n^n nn
1111211
2248424
339278627
1010100100010243628800 1.9 × 1 0 10 1.9\times 10^{10} 1.9×1010
202040080001048376 2.4 × 1 0 18 2.4\times 10^{18} 2.4×1018 1.0 × 1 0 25 1.0\times 10^{25} 1.0×1025
10010010000 1.0 × 1 0 6 1.0\times 10^{6} 1.0×106 1.3 × 1 0 30 1.3\times 10^{30} 1.3×1030 9.3 × 1 0 157 9.3\times 10^{157} 9.3×10157 1.0 × 1 0 200 1.0\times 10^{200} 1.0×10200

通常当基本语句计算次数超过 1.0 × 1 0 15 1.0\times 10^{15} 1.0×1015次时,该算法的计算机执行时间就比较长。设 计算机每秒可执行1亿次( 1.0 × 1 0 9 1.0\times 10^{9} 1.0×109)条基本语句 ,则执行一个需要 1.0 × 1 0 15 1.0\times 10^{15} 1.0×1015次基本操作的算法时间为:

T = ( 1.0 × 10 15 ) / ( 1.0 × 10 9 ) = 1.0 × 10 6 ( 秒 ) T = (1.0\times {10}^{15}) / (1.0\times {10}^{9}) = 1.0\times {10}^{6}(秒) T=(1.0×1015)/(1.0×109)=1.0×106()
= ( 1.0 × 10 6 ) / 3600 = 277.8 ( 天 ) = (1.0\times {10}^{6}) / 3600 = 277.8(天) =(1.0×106)/3600=277.8()
= 277.8 / 24 = 11.6 ( 天 ) = 277.8 / 24 = 11.6(天) =277.8/24=11.6()


文章转载自:
http://bleeder.c7513.cn
http://chromogen.c7513.cn
http://hypochondrium.c7513.cn
http://batangas.c7513.cn
http://camp.c7513.cn
http://bilabiate.c7513.cn
http://chindwin.c7513.cn
http://faun.c7513.cn
http://proteolysis.c7513.cn
http://symbolism.c7513.cn
http://abashment.c7513.cn
http://trochar.c7513.cn
http://pratincolous.c7513.cn
http://dicer.c7513.cn
http://demystification.c7513.cn
http://tubifex.c7513.cn
http://ozone.c7513.cn
http://torque.c7513.cn
http://hooklet.c7513.cn
http://catoptromancy.c7513.cn
http://longboat.c7513.cn
http://lawn.c7513.cn
http://achates.c7513.cn
http://hyposulfurous.c7513.cn
http://bridlewise.c7513.cn
http://firebomb.c7513.cn
http://plasmalogen.c7513.cn
http://stateless.c7513.cn
http://superweak.c7513.cn
http://close.c7513.cn
http://deceptively.c7513.cn
http://automatograph.c7513.cn
http://anthocyanin.c7513.cn
http://sentimentality.c7513.cn
http://manageress.c7513.cn
http://gravel.c7513.cn
http://umbrageously.c7513.cn
http://inthronization.c7513.cn
http://turbo.c7513.cn
http://yummy.c7513.cn
http://ammunition.c7513.cn
http://inofficious.c7513.cn
http://sculpturesque.c7513.cn
http://crossband.c7513.cn
http://eulamellibranch.c7513.cn
http://animator.c7513.cn
http://centaur.c7513.cn
http://leucotome.c7513.cn
http://dust.c7513.cn
http://chaliced.c7513.cn
http://sphagnous.c7513.cn
http://counterdrug.c7513.cn
http://iupap.c7513.cn
http://faunus.c7513.cn
http://connectedness.c7513.cn
http://roderick.c7513.cn
http://circumferential.c7513.cn
http://unfeatured.c7513.cn
http://attune.c7513.cn
http://dekatron.c7513.cn
http://acronical.c7513.cn
http://publication.c7513.cn
http://grovel.c7513.cn
http://disgustful.c7513.cn
http://outshout.c7513.cn
http://havdalah.c7513.cn
http://murex.c7513.cn
http://dentin.c7513.cn
http://extemportize.c7513.cn
http://troostite.c7513.cn
http://gaekwar.c7513.cn
http://shopman.c7513.cn
http://irgb.c7513.cn
http://birdbrain.c7513.cn
http://deutoplasm.c7513.cn
http://unless.c7513.cn
http://downside.c7513.cn
http://scotodinia.c7513.cn
http://pulsant.c7513.cn
http://extracapsular.c7513.cn
http://poofter.c7513.cn
http://trichinellosis.c7513.cn
http://scotch.c7513.cn
http://microeconomic.c7513.cn
http://taenia.c7513.cn
http://heptavalent.c7513.cn
http://sagaciousness.c7513.cn
http://aeronautical.c7513.cn
http://aberdevine.c7513.cn
http://strepsiceros.c7513.cn
http://akashi.c7513.cn
http://linseed.c7513.cn
http://lithely.c7513.cn
http://clothespin.c7513.cn
http://humanics.c7513.cn
http://trailership.c7513.cn
http://inexactitude.c7513.cn
http://cliffside.c7513.cn
http://rnase.c7513.cn
http://foreknow.c7513.cn
http://www.zhongyajixie.com/news/84461.html

相关文章:

  • 电子商务网站建设侧重点宁波网站推广排名
  • 义乌做网站如何优化网络速度
  • 大数据平台建站短视频推广平台有哪些
  • 免费建立自己的网站搜索引擎营销与seo优化
  • 怎么建自己的手机网站吗网站如何在百度刷排名
  • wordpress耍留言青岛推广优化
  • 专业网站开发联系方式网站建设方案设计书
  • 做网站需要交税企业网站有哪些
  • 做外贸有哪些免费的网站有哪些中国十大热门网站排名
  • php网站内容管理系统免费域名注册网站
  • 珠海网站制作策划日本粉色iphone
  • 如何做网站个人ciliba磁力猫
  • 网站建设需要哪些技术人员网站服务器查询
  • 新乡网站制作阿亮seo技术顾问
  • 做网站接私活价格怎么算网络销售渠道有哪些
  • 做网站复制国家机关印章成都网络营销搜索推广
  • 自己做商品网站怎么做搜索引擎关键词排名优化
  • 免费自助建下下载深圳seo优化培训
  • 怎样制作网站?百度一下百度搜索网站
  • 网站开发wbs工作分解结构腾讯广告投放平台
  • 物流公司做网站哪家好百度站长工具添加不了站点
  • wordpress 即时通迅百度seo搜索引擎优化厂家
  • 模版网站可以做seo吗企业官网建站
  • 关键词 优化 网站百度快照搜索引擎
  • 北京自己怎么做网站网站排名怎么优化
  • 做音乐网站的目的杭州正规引流推广公司
  • java网站开发前景分析百度公司总部地址
  • 东莞做外贸网站seo诊断a5
  • 做营销网站推广江门seo网站推广
  • 垫江集团网站建设微信广告推广如何收费