CINXE.COM
Vector (informatica) - Wikipedia, le encyclopedia libere
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="ia" dir="ltr"> <head> <meta charset="UTF-8"> <title>Vector (informatica) - Wikipedia, le encyclopedia libere</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )iawikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":[",\t."," \t,"],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","januario","februario","martio","april","maio","junio","julio","augusto","septembre","octobre","novembre","decembre"],"wgRequestId":"bc43ad0b-bdab-4b76-905c-af00f8f23251","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Vector_(informatica)","wgTitle":"Vector (informatica)","wgCurRevisionId":663046,"wgRevisionId":0,"wgArticleId":24823,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Webarchive template wayback links","Structuras de datos"],"wgPageViewLanguage":"ia","wgPageContentLanguage":"ia","wgPageContentModel":"wikitext","wgRelevantPageName":"Vector_(informatica)","wgRelevantArticleId":24823,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":true,"wgFlaggedRevsParams":{"tags":{"accuracy":{"levels":1}}} ,"wgStableRevisionId":0,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"ia","pageLanguageDir":"ltr","pageVariantFallbacks":"ia"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":8000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q186152","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.globalCssJs.user.styles":"ready", "site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.math.styles":"ready","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.flaggedRevs.basic":"ready","mediawiki.codex.messagebox.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.pygments.view","mediawiki.page.media","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.flaggedRevs.advanced","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming", "ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=ia&modules=ext.flaggedRevs.basic%7Cext.math.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cmediawiki.codex.messagebox.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=ia&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=ia&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Vector (informatica) - Wikipedia, le encyclopedia libere"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//ia.m.wikipedia.org/wiki/Vector_(informatica)"> <link rel="alternate" type="application/x-wiki" title="Modificar" href="/w/index.php?title=Vector_(informatica)&action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (ia)"> <link rel="EditURI" type="application/rsd+xml" href="//ia.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://ia.wikipedia.org/wiki/Vector_(informatica)"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.ia"> <link rel="alternate" type="application/atom+xml" title="Syndication Atom de Wikipedia" href="/w/index.php?title=Special:Modificationes_recente&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Vector_informatica rootpage-Vector_informatica skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Saltar al contento</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Sito"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Menu principal" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Menu principal</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Menu principal</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">displaciar verso le barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">celar</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Pagina_principal" title="Visitar le pagina principal [z]" accesskey="z"><span>Pagina principal</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedia:Portal_del_communitate" title="A proposito del projecto, que tu pote facer, ubi trovar cosas"><span>Portal del communitate</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Wikipedia:Actualitates" title="Informationes de fundo a proposito de eventos actual"><span>Actualitates</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:Modificationes_recente" title="Le lista de modificationes recente in le wiki. [r]" accesskey="r"><span>Modificationes recente</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Aleatori" title="Visitar un pagina qualcunque [x]" accesskey="x"><span>Pagina aleatori</span></a></li><li id="n-help" class="mw-list-item"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents" title="Le solutiones de vostre problemas"><span>Adjuta</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Pagina_principal" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedia" src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" style="width: 7.5em; height: 1.125em;"> <img class="mw-logo-tagline" alt="Le encyclopedia libere" src="/static/images/mobile/copyright/wikipedia-tagline-ia.svg" width="120" height="13" style="width: 7.5em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Recerca" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Cercar in Wikipedia [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Recerca</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Cercar in Wikipedia" aria-label="Cercar in Wikipedia" autocapitalize="sentences" title="Cercar in Wikipedia [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Recerca"> </div> <button class="cdx-button cdx-search-input__end-button">Cercar</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Instrumentos personal"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Apparentia"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Cambiar le dimension, latitude e color del litteras" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Apparentia" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Apparentia</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_ia.wikipedia.org&uselang=ia" class=""><span>Donationes</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:Crear_conto&returnto=Vector+%28informatica%29" title="Tu es incoragiate a crear un conto e aperir session; totevia, non es obligatori" class=""><span>Crear conto</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:Aperir_session&returnto=Vector+%28informatica%29" title="Nos recommenda que tu te authentica, ma non es obligatori. [o]" accesskey="o" class=""><span>Aperir session</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Plus optiones" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Instrumentos personal" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Instrumentos personal</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal" title="Menu del usator" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_ia.wikipedia.org&uselang=ia"><span>Donationes</span></a></li><li id="pt-contribute" class="mw-list-item"><a href="/wiki/Special:Contribute"><span class="vector-icon mw-ui-icon-edit mw-ui-icon-wikimedia-edit"></span> <span>Contribuer</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:Crear_conto&returnto=Vector+%28informatica%29" title="Tu es incoragiate a crear un conto e aperir session; totevia, non es obligatori"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Crear conto</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:Aperir_session&returnto=Vector+%28informatica%29" title="Nos recommenda que tu te authentica, ma non es obligatori. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Aperir session</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Paginas pro redactores sin session aperte <a href="/wiki/Adjuta:Introduction" aria-label="Leger plus sur le modification"><span>leger plus</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:Mi_discussion" title="Discussion sur le modificationes facite desde iste adresse IP [n]" accesskey="n"><span>Discussion</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Sito"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contento" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contento</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">displaciar verso le barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">celar</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Initio</div> </a> </li> <li id="toc-Indices" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Indices"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Indices</span> </div> </a> <ul id="toc-Indices-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Notation" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Notation"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Notation</span> </div> </a> <ul id="toc-Notation-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Forma_de_accesso" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Forma_de_accesso"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Forma de accesso</span> </div> </a> <ul id="toc-Forma_de_accesso-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Vectores_dynamic_e_static" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Vectores_dynamic_e_static"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Vectores dynamic e static</span> </div> </a> <button aria-controls="toc-Vectores_dynamic_e_static-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Commutar subsection Vectores dynamic e static</span> </button> <ul id="toc-Vectores_dynamic_e_static-sublist" class="vector-toc-list"> <li id="toc-Exemplos_in_C" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Exemplos_in_C"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1</span> <span>Exemplos in C</span> </div> </a> <ul id="toc-Exemplos_in_C-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Vectores_multidimensional" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Vectores_multidimensional"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Vectores multidimensional</span> </div> </a> <ul id="toc-Vectores_multidimensional-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contento" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Commutar le tabula de contento" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Commutar le tabula de contento</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Vector (informatica)</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Leger un articulo in un altere lingua. Disponibile in 54 linguas." > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-54" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">54 linguas</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D9%85%D8%B5%D9%81%D9%88%D9%81%D8%A9_(%D8%AD%D9%88%D8%B3%D8%A8%D8%A9)" title="مصفوفة (حوسبة) (in arabe)" lang="ar" hreflang="ar" data-title="مصفوفة (حوسبة)" data-language-autonym="العربية" data-language-local-name="arabe" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-az mw-list-item"><a href="https://az.wikipedia.org/wiki/Massiv" title="Massiv (in azerbaidzhano)" lang="az" hreflang="az" data-title="Massiv" data-language-autonym="Azərbaycanca" data-language-local-name="azerbaidzhano" class="interlanguage-link-target"><span>Azərbaycanca</span></a></li><li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://bg.wikipedia.org/wiki/%D0%9C%D0%B0%D1%81%D0%B8%D0%B2_(%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5)" title="Масив (програмиране) (in bulgaro)" lang="bg" hreflang="bg" data-title="Масив (програмиране)" data-language-autonym="Български" data-language-local-name="bulgaro" class="interlanguage-link-target"><span>Български</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/Vector_(programaci%C3%B3)" title="Vector (programació) (in catalano)" lang="ca" hreflang="ca" data-title="Vector (programació)" data-language-autonym="Català" data-language-local-name="catalano" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/Pole_(datov%C3%A1_struktura)" title="Pole (datová struktura) (in checo)" lang="cs" hreflang="cs" data-title="Pole (datová struktura)" data-language-autonym="Čeština" data-language-local-name="checo" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/Tabel_(datastruktur)" title="Tabel (datastruktur) (in danese)" lang="da" hreflang="da" data-title="Tabel (datastruktur)" data-language-autonym="Dansk" data-language-local-name="danese" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Array_(Datentyp)" title="Array (Datentyp) (in germano)" lang="de" hreflang="de" data-title="Array (Datentyp)" data-language-autonym="Deutsch" data-language-local-name="germano" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-el mw-list-item"><a href="https://el.wikipedia.org/wiki/%CE%A0%CE%AF%CE%BD%CE%B1%CE%BA%CE%B1%CF%82_(%CE%B4%CE%BF%CE%BC%CE%AE_%CE%B4%CE%B5%CE%B4%CE%BF%CE%BC%CE%AD%CE%BD%CF%89%CE%BD)" title="Πίνακας (δομή δεδομένων) (in greco)" lang="el" hreflang="el" data-title="Πίνακας (δομή δεδομένων)" data-language-autonym="Ελληνικά" data-language-local-name="greco" class="interlanguage-link-target"><span>Ελληνικά</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/Array_(data_structure)" title="Array (data structure) (in anglese)" lang="en" hreflang="en" data-title="Array (data structure)" data-language-autonym="English" data-language-local-name="anglese" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-eo mw-list-item"><a href="https://eo.wikipedia.org/wiki/Tabelo_(datumstrukturo)" title="Tabelo (datumstrukturo) (in esperanto)" lang="eo" hreflang="eo" data-title="Tabelo (datumstrukturo)" data-language-autonym="Esperanto" data-language-local-name="esperanto" class="interlanguage-link-target"><span>Esperanto</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Vector_(inform%C3%A1tica)" title="Vector (informática) (in espaniol)" lang="es" hreflang="es" data-title="Vector (informática)" data-language-autonym="Español" data-language-local-name="espaniol" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-et mw-list-item"><a href="https://et.wikipedia.org/wiki/Massiiv_(programmeerimine)" title="Massiiv (programmeerimine) (in estoniano)" lang="et" hreflang="et" data-title="Massiiv (programmeerimine)" data-language-autonym="Eesti" data-language-local-name="estoniano" class="interlanguage-link-target"><span>Eesti</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D8%A2%D8%B1%D8%A7%DB%8C%D9%87_(%D8%B3%D8%A7%D8%AE%D8%AA%D8%A7%D8%B1_%D8%AF%D8%A7%D8%AF%D9%87)" title="آرایه (ساختار داده) (in persa)" lang="fa" hreflang="fa" data-title="آرایه (ساختار داده)" data-language-autonym="فارسی" data-language-local-name="persa" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/Taulukko_(tietorakenne)" title="Taulukko (tietorakenne) (in finnese)" lang="fi" hreflang="fi" data-title="Taulukko (tietorakenne)" data-language-autonym="Suomi" data-language-local-name="finnese" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Tableau_(structure_de_donn%C3%A9es)" title="Tableau (structure de données) (in francese)" lang="fr" hreflang="fr" data-title="Tableau (structure de données)" data-language-autonym="Français" data-language-local-name="francese" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/%D7%9E%D7%A2%D7%A8%D7%9A_(%D7%9E%D7%91%D7%A0%D7%94_%D7%A0%D7%AA%D7%95%D7%A0%D7%99%D7%9D)" title="מערך (מבנה נתונים) (in hebreo)" lang="he" hreflang="he" data-title="מערך (מבנה נתונים)" data-language-autonym="עברית" data-language-local-name="hebreo" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://hu.wikipedia.org/wiki/T%C3%B6mb_(adatszerkezet)" title="Tömb (adatszerkezet) (in hungaro)" lang="hu" hreflang="hu" data-title="Tömb (adatszerkezet)" data-language-autonym="Magyar" data-language-local-name="hungaro" class="interlanguage-link-target"><span>Magyar</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/Larik" title="Larik (in indonesiano)" lang="id" hreflang="id" data-title="Larik" data-language-autonym="Bahasa Indonesia" data-language-local-name="indonesiano" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikipedia.org/wiki/Fylki_(t%C3%B6lvunarfr%C3%A6%C3%B0i)" title="Fylki (tölvunarfræði) (in islandese)" lang="is" hreflang="is" data-title="Fylki (tölvunarfræði)" data-language-autonym="Íslenska" data-language-local-name="islandese" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Array" title="Array (in italiano)" lang="it" hreflang="it" data-title="Array" data-language-autonym="Italiano" data-language-local-name="italiano" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/%E9%85%8D%E5%88%97" title="配列 (in japonese)" lang="ja" hreflang="ja" data-title="配列" data-language-autonym="日本語" data-language-local-name="japonese" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-kk mw-list-item"><a href="https://kk.wikipedia.org/wiki/%D0%96%D0%B8%D1%8B%D0%BC" title="Жиым (in kazakh)" lang="kk" hreflang="kk" data-title="Жиым" data-language-autonym="Қазақша" data-language-local-name="kazakh" class="interlanguage-link-target"><span>Қазақша</span></a></li><li class="interlanguage-link interwiki-kn mw-list-item"><a href="https://kn.wikipedia.org/wiki/%E0%B2%85%E0%B2%B0%E0%B3%8D%E0%B2%B0%E0%B3%87_(%E0%B2%A1%E0%B3%87%E0%B2%9F%E0%B2%BE_%E0%B2%B8%E0%B3%8D%E0%B2%9F%E0%B3%8D%E0%B2%B0%E0%B2%95%E0%B3%8D%E0%B2%9A%E0%B2%B0%E0%B3%8D)" title="ಅರ್ರೇ (ಡೇಟಾ ಸ್ಟ್ರಕ್ಚರ್) (in kannada)" lang="kn" hreflang="kn" data-title="ಅರ್ರೇ (ಡೇಟಾ ಸ್ಟ್ರಕ್ಚರ್)" data-language-autonym="ಕನ್ನಡ" data-language-local-name="kannada" class="interlanguage-link-target"><span>ಕನ್ನಡ</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EB%B0%B0%EC%97%B4" title="배열 (in coreano)" lang="ko" hreflang="ko" data-title="배열" data-language-autonym="한국어" data-language-local-name="coreano" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-lmo mw-list-item"><a href="https://lmo.wikipedia.org/wiki/Array" title="Array (in Lombard)" lang="lmo" hreflang="lmo" data-title="Array" data-language-autonym="Lombard" data-language-local-name="Lombard" class="interlanguage-link-target"><span>Lombard</span></a></li><li class="interlanguage-link interwiki-lt mw-list-item"><a href="https://lt.wikipedia.org/wiki/Masyvas" title="Masyvas (in lithuano)" lang="lt" hreflang="lt" data-title="Masyvas" data-language-autonym="Lietuvių" data-language-local-name="lithuano" class="interlanguage-link-target"><span>Lietuvių</span></a></li><li class="interlanguage-link interwiki-lv mw-list-item"><a href="https://lv.wikipedia.org/wiki/Datu_mas%C4%ABvs" title="Datu masīvs (in letton)" lang="lv" hreflang="lv" data-title="Datu masīvs" data-language-autonym="Latviešu" data-language-local-name="letton" class="interlanguage-link-target"><span>Latviešu</span></a></li><li class="interlanguage-link interwiki-mhr mw-list-item"><a href="https://mhr.wikipedia.org/wiki/%D0%A7%D1%83%D0%BC%D1%8B%D1%80" title="Чумыр (in Eastern Mari)" lang="mhr" hreflang="mhr" data-title="Чумыр" data-language-autonym="Олык марий" data-language-local-name="Eastern Mari" class="interlanguage-link-target"><span>Олык марий</span></a></li><li class="interlanguage-link interwiki-ml mw-list-item"><a href="https://ml.wikipedia.org/wiki/%E0%B4%85%E0%B4%9F%E0%B5%81%E0%B4%95%E0%B5%8D%E0%B4%95%E0%B5%8D_(%E0%B4%A6%E0%B4%A4%E0%B5%8D%E0%B4%A4%E0%B4%B8%E0%B4%99%E0%B5%8D%E0%B4%95%E0%B5%87%E0%B4%A4%E0%B4%82)" title="അടുക്ക് (ദത്തസങ്കേതം) (in malayalam)" lang="ml" hreflang="ml" data-title="അടുക്ക് (ദത്തസങ്കേതം)" data-language-autonym="മലയാളം" data-language-local-name="malayalam" class="interlanguage-link-target"><span>മലയാളം</span></a></li><li class="interlanguage-link interwiki-mn mw-list-item"><a href="https://mn.wikipedia.org/wiki/%D0%9C%D0%B0%D1%81%D1%81%D0%B8%D0%B2" title="Массив (in mongol)" lang="mn" hreflang="mn" data-title="Массив" data-language-autonym="Монгол" data-language-local-name="mongol" class="interlanguage-link-target"><span>Монгол</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Array" title="Array (in nederlandese)" lang="nl" hreflang="nl" data-title="Array" data-language-autonym="Nederlands" data-language-local-name="nederlandese" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-no mw-list-item"><a href="https://no.wikipedia.org/wiki/Tabell_(datastruktur)" title="Tabell (datastruktur) (in norvegiano bokmål)" lang="nb" hreflang="nb" data-title="Tabell (datastruktur)" data-language-autonym="Norsk bokmål" data-language-local-name="norvegiano bokmål" class="interlanguage-link-target"><span>Norsk bokmål</span></a></li><li class="interlanguage-link interwiki-pa mw-list-item"><a href="https://pa.wikipedia.org/wiki/%E0%A8%90%E0%A8%B0%E0%A9%87_(%E0%A8%A1%E0%A8%BE%E0%A8%9F%E0%A8%BE_%E0%A8%AC%E0%A8%A3%E0%A8%A4%E0%A8%B0)" title="ਐਰੇ (ਡਾਟਾ ਬਣਤਰ) (in punjabi)" lang="pa" hreflang="pa" data-title="ਐਰੇ (ਡਾਟਾ ਬਣਤਰ)" data-language-autonym="ਪੰਜਾਬੀ" data-language-local-name="punjabi" class="interlanguage-link-target"><span>ਪੰਜਾਬੀ</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/Tablica_(informatyka)" title="Tablica (informatyka) (in polonese)" lang="pl" hreflang="pl" data-title="Tablica (informatyka)" data-language-autonym="Polski" data-language-local-name="polonese" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Arranjo_(computa%C3%A7%C3%A3o)" title="Arranjo (computação) (in portugese)" lang="pt" hreflang="pt" data-title="Arranjo (computação)" data-language-autonym="Português" data-language-local-name="portugese" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%9C%D0%B0%D1%81%D1%81%D0%B8%D0%B2_(%D1%82%D0%B8%D0%BF_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85)" title="Массив (тип данных) (in russo)" lang="ru" hreflang="ru" data-title="Массив (тип данных)" data-language-autonym="Русский" data-language-local-name="russo" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sh mw-list-item"><a href="https://sh.wikipedia.org/wiki/Niz_(struktura_podataka)" title="Niz (struktura podataka) (in serbocroate)" lang="sh" hreflang="sh" data-title="Niz (struktura podataka)" data-language-autonym="Srpskohrvatski / српскохрватски" data-language-local-name="serbocroate" class="interlanguage-link-target"><span>Srpskohrvatski / српскохрватски</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Array_data_structure" title="Array data structure (in Simple English)" lang="en-simple" hreflang="en-simple" data-title="Array data structure" data-language-autonym="Simple English" data-language-local-name="Simple English" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sk mw-list-item"><a href="https://sk.wikipedia.org/wiki/Pole_(%C3%BAdajov%C3%A1_%C5%A1trukt%C3%BAra)" title="Pole (údajová štruktúra) (in slovaco)" lang="sk" hreflang="sk" data-title="Pole (údajová štruktúra)" data-language-autonym="Slovenčina" data-language-local-name="slovaco" class="interlanguage-link-target"><span>Slovenčina</span></a></li><li class="interlanguage-link interwiki-sl mw-list-item"><a href="https://sl.wikipedia.org/wiki/Tabela_(ra%C4%8Dunalni%C5%A1tvo)" title="Tabela (računalništvo) (in sloveno)" lang="sl" hreflang="sl" data-title="Tabela (računalništvo)" data-language-autonym="Slovenščina" data-language-local-name="sloveno" class="interlanguage-link-target"><span>Slovenščina</span></a></li><li class="interlanguage-link interwiki-sq mw-list-item"><a href="https://sq.wikipedia.org/wiki/Vektori_(struktura_e_t%C3%AB_dh%C3%ABnave)" title="Vektori (struktura e të dhënave) (in albanese)" lang="sq" hreflang="sq" data-title="Vektori (struktura e të dhënave)" data-language-autonym="Shqip" data-language-local-name="albanese" class="interlanguage-link-target"><span>Shqip</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/%D0%9D%D0%B8%D0%B7_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%BF%D0%BE%D0%B4%D0%B0%D1%82%D0%B0%D0%BA%D0%B0)" title="Низ (структура података) (in serbo)" lang="sr" hreflang="sr" data-title="Низ (структура података)" data-language-autonym="Српски / srpski" data-language-local-name="serbo" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/F%C3%A4lt_(datastruktur)" title="Fält (datastruktur) (in svedese)" lang="sv" hreflang="sv" data-title="Fält (datastruktur)" data-language-autonym="Svenska" data-language-local-name="svedese" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-ta mw-list-item"><a href="https://ta.wikipedia.org/wiki/%E0%AE%85%E0%AE%A3%E0%AE%BF_(%E0%AE%95%E0%AE%A3%E0%AE%BF%E0%AE%A9%E0%AE%BF%E0%AE%AF%E0%AE%BF%E0%AE%AF%E0%AE%B2%E0%AF%8D)" title="அணி (கணினியியல்) (in tamil)" lang="ta" hreflang="ta" data-title="அணி (கணினியியல்)" data-language-autonym="தமிழ்" data-language-local-name="tamil" class="interlanguage-link-target"><span>தமிழ்</span></a></li><li class="interlanguage-link interwiki-th mw-list-item"><a href="https://th.wikipedia.org/wiki/%E0%B9%81%E0%B8%96%E0%B8%A7%E0%B8%A5%E0%B8%B3%E0%B8%94%E0%B8%B1%E0%B8%9A" title="แถวลำดับ (in thai)" lang="th" hreflang="th" data-title="แถวลำดับ" data-language-autonym="ไทย" data-language-local-name="thai" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-tl mw-list-item"><a href="https://tl.wikipedia.org/wiki/Array" title="Array (in Tagalog)" lang="tl" hreflang="tl" data-title="Array" data-language-autonym="Tagalog" data-language-local-name="Tagalog" class="interlanguage-link-target"><span>Tagalog</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/Dizi_(veri_yap%C4%B1s%C4%B1)" title="Dizi (veri yapısı) (in turco)" lang="tr" hreflang="tr" data-title="Dizi (veri yapısı)" data-language-autonym="Türkçe" data-language-local-name="turco" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/%D0%9C%D0%B0%D1%81%D0%B8%D0%B2_(%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D1%83%D1%80%D0%B0_%D0%B4%D0%B0%D0%BD%D0%B8%D1%85)" title="Масив (структура даних) (in ukrainiano)" lang="uk" hreflang="uk" data-title="Масив (структура даних)" data-language-autonym="Українська" data-language-local-name="ukrainiano" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-ur mw-list-item"><a href="https://ur.wikipedia.org/wiki/%D8%A7%DB%8C%D8%B1%DB%92(%DA%88%DB%8C%D9%B9%D8%A7_%D8%A7%D8%B3%D9%B9%D8%B1%DA%A9%DA%86%D8%B1)" title="ایرے(ڈیٹا اسٹرکچر) (in urdu)" lang="ur" hreflang="ur" data-title="ایرے(ڈیٹا اسٹرکچر)" data-language-autonym="اردو" data-language-local-name="urdu" class="interlanguage-link-target"><span>اردو</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/M%E1%BA%A3ng_(c%E1%BA%A5u_tr%C3%BAc_d%E1%BB%AF_li%E1%BB%87u)" title="Mảng (cấu trúc dữ liệu) (in vietnamese)" lang="vi" hreflang="vi" data-title="Mảng (cấu trúc dữ liệu)" data-language-autonym="Tiếng Việt" data-language-local-name="vietnamese" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-wuu mw-list-item"><a href="https://wuu.wikipedia.org/wiki/%E6%95%B0%E7%BB%84" title="数组 (in wu)" lang="wuu" hreflang="wuu" data-title="数组" data-language-autonym="吴语" data-language-local-name="wu" class="interlanguage-link-target"><span>吴语</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E6%95%B0%E7%BB%84" title="数组 (in chinese)" lang="zh" hreflang="zh" data-title="数组" data-language-autonym="中文" data-language-local-name="chinese" class="interlanguage-link-target"><span>中文</span></a></li><li class="interlanguage-link interwiki-zh-min-nan mw-list-item"><a href="https://zh-min-nan.wikipedia.org/wiki/T%C4%ABn-lia%CC%8Dt" title="Tīn-lia̍t (in Minnan)" lang="nan" hreflang="nan" data-title="Tīn-lia̍t" data-language-autonym="閩南語 / Bân-lâm-gú" data-language-local-name="Minnan" class="interlanguage-link-target"><span>閩南語 / Bân-lâm-gú</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/%E9%99%A3%E5%88%97" title="陣列 (in cantonese)" lang="yue" hreflang="yue" data-title="陣列" data-language-autonym="粵語" data-language-local-name="cantonese" class="interlanguage-link-target"><span>粵語</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q186152#sitelinks-wikipedia" title="Modificar ligamines a altere linguas" class="wbc-editpage">Modificar ligamines</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Spatios de nomines"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Vector_(informatica)" title="Vider le pagina de contento [c]" accesskey="c"><span>Articulo</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Discussion:Vector_(informatica)&action=edit&redlink=1" rel="discussion" class="new" title="Discussiones a proposito del pagina de contento (pagina non existe) [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Cambiar variante de lingua" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">interlingua</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Representationes"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Vector_(informatica)"><span>Leger</span></a></li><li id="ca-ve-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&veaction=edit" title="Modificar iste pagina [v]" accesskey="v"><span>Modificar</span></a></li><li id="ca-edit" class="collapsible vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&action=edit" title="Modificar le codice fonte de iste pagina [e]" accesskey="e"><span>Modificar fonte</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&action=history" title="Versiones anterior de iste pagina [h]" accesskey="h"><span>Vider historia</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Instrumentos pro paginas"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Instrumentos" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Instrumentos</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Instrumentos</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">displaciar verso le barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">celar</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Plus optiones" > <div class="vector-menu-heading"> Actiones </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Vector_(informatica)"><span>Leger</span></a></li><li id="ca-more-ve-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&veaction=edit" title="Modificar iste pagina [v]" accesskey="v"><span>Modificar</span></a></li><li id="ca-more-edit" class="collapsible vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&action=edit" title="Modificar le codice fonte de iste pagina [e]" accesskey="e"><span>Modificar fonte</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&action=history"><span>Vider historia</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:Referentias_a_iste_pagina/Vector_(informatica)" title="Lista de tote le paginas wiki con ligamines a iste pagina [j]" accesskey="j"><span>Paginas ligate a iste</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:Modificationes_recente_ligate/Vector_(informatica)" rel="nofollow" title="Modificationes recente in le paginas al quales iste pagina contine ligamines [k]" accesskey="k"><span>Modificationes ligate</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=ia" title="Incargar files [u]" accesskey="u"><span>Incargar file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:Paginas_special" title="Lista de tote le paginas special [q]" accesskey="q"><span>Paginas special</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&action=info" title="Plus information sur iste pagina"><span>Information sur le pagina</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fia.wikipedia.org%2Fwiki%2FVector_%28informatica%29"><span>Obtener URL accurtate</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fia.wikipedia.org%2Fwiki%2FVector_%28informatica%29"><span>Discargar codice QR</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Imprimer/exportar </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Special:Libro&bookcmd=book_creator&referer=Vector+%28informatica%29"><span>Crear un libro</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Vector_%28informatica%29&action=show-download-screen"><span>Discargar como PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Vector_(informatica)&printable=yes" title="Version imprimibile de iste pagina [p]" accesskey="p"><span>Version pro imprimer</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In altere projectos </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Category:Array_data_structure" hreflang="en"><span>Wikimedia Commons</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q186152" title="Ligamine a un elemento in le repositorio de datos connectite [g]" accesskey="g"><span>Elemento Wikidata</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Instrumentos pro paginas"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Apparentia"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Apparentia</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">displaciar verso le barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">celar</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> <div id="mw-indicator-indicator-fr-review-status" class="mw-indicator"><indicator name="fr-review-status" class="mw-fr-review-status-indicator" id="mw-fr-revision-toggle"><span class="cdx-fr-css-icon-review--status--unchecked"></span><b>Non revidite</b></indicator></div> </div> <div id="siteSub" class="noprint">De Wikipedia, le encyclopedia libere</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div id="mw-fr-revision-details" class="mw-fr-revision-details-dialog" style="display:none;"><div tabindex="0"></div><div class="cdx-dialog cdx-dialog--horizontal-actions"><header class="cdx-dialog__header cdx-dialog__header--default"><div class="cdx-dialog__header__title-group"><h2 class="cdx-dialog__header__title">Stato del version del pagina</h2><p class="cdx-dialog__header__subtitle">Le pagina non ha essite verificate</p></div><button class="cdx-button cdx-button--action-default cdx-button--weight-quiet 							cdx-button--size-medium cdx-button--icon-only cdx-dialog__header__close-button" aria-label="Clauder" onclick="document.getElementById("mw-fr-revision-details").style.display = "none";" type="submit"><span class="cdx-icon cdx-icon--medium 							cdx-fr-css-icon--close"></span></button></header><div class="cdx-dialog__body">Il non ha <a href="/wiki/Adjuta:Validation_de_paginas" class="mw-redirect" title="Adjuta:Validation de paginas">versiones revidite</a> de iste pagina, dunque su qualitate forsan <b>non</b> ha essite verificate.</div></div><div tabindex="0"></div></div><div class="mw-content-ltr mw-parser-output" lang="ia" dir="ltr"><table width="320px" class="infobox"> <tbody><tr style="text-align:center; font-size: larger"> <th>Vector </th></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td>subclasse de: <a href="/wiki/Structura_de_datos" title="Structura de datos">Structura de datos</a>, <a href="https://www.wikidata.org/wiki/Q17008256" class="extiw" title="d:Q17008256">collection</a><abbr title="Article is not yet available in this wiki.">[*]</abbr> </td></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td><span typeof="mw:File"><a href="/wiki/File:Array1.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Array1.svg/300px-Array1.svg.png" decoding="async" width="300" height="51" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Array1.svg/450px-Array1.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Array1.svg/600px-Array1.svg.png 2x" data-file-width="328" data-file-height="56" /></a></span> </td></tr> <tr style="text-align:center;"> <td> <p><br /> </p> </td></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td> </td></tr> <tr style="text-align:center;"> <td>Commons: <a href="https://commons.wikimedia.org/wiki/Category:Array_data_structure" class="extiw" title="commons:Category:Array data structure">Array data structure</a> </td></tr></tbody></table> <figure typeof="mw:File/Thumb"><a href="/wiki/File:Array1.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Array1.svg/300px-Array1.svg.png" decoding="async" width="300" height="51" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Array1.svg/450px-Array1.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Array1.svg/600px-Array1.svg.png 2x" data-file-width="328" data-file-height="56" /></a><figcaption>Matrice unidimensional con dece elementos.</figcaption></figure> <p>In le <a href="/w/index.php?title=Programmation&action=edit&redlink=1" class="new" title="Programmation (pagina non existe)">programmation</a>, un <b>matrice</b> o <b>vector</b> (appellate in <a href="/wiki/Lingua_anglese" title="Lingua anglese">anglese</a> <b>array</b>) es un zona de immagazinage continue, que contine un serie de elementos del mesme typo, le elementos del matrice. Ab le puncto de vista logic un matrice pote esser vidite como un ensemble de elementos ordinate in cauda (o rangos e columnas si illo ha duo dimensiones). </p><p>In principio, on pote considerar que tote le matrices son de un dimension, le dimension principal, sed le elementos del dicite cauda pote esser a lor vices matrices (un processo que pote esser <a href="/wiki/Recursion" title="Recursion">recursive</a>), lo que nos permitte de parlar del existentia de matrices multidimensional, ben que le plus facile a imaginar es los de un, duo, e tres dimensiones. </p><p>Iste <a href="/wiki/Structura_de_datos" title="Structura de datos">structuras de datos</a> es adequate pro situationes in le quales le accesso al <a href="/wiki/Dato" title="Dato">datos</a> se realisa de forma aleatori e impredicibile. Al contrario, si le elementos pote se trovar ordinate e on va a usar un accesso sequential il esserea plus adequate de usar un <a href="/w/index.php?title=Lista_(informatica)&action=edit&redlink=1" class="new" title="Lista (informatica) (pagina non existe)">lista</a>, durante que iste structura pote cambiar de mesura facilemente durante le execution de un programma. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Indices">Indices</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Vector_(informatica)&veaction=edit&section=1" title="Modificar section: Indices" class="mw-editsection-visualeditor"><span>modificar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Vector_(informatica)&action=edit&section=1" title="Modificar le codice fonte del section: Indices"><span>modificar fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Tote vector se compone de un numero determinate de elementos. Cata elemento es referentiate per le position que illo occupa intra le vector. Le dicite positiones es appellate <b>indice</b> e sempre es correlative. Il ha tres manieras de indexar le elementos de un matrice: </p> <ul><li><b>Indexation base-zero (0):</b> In iste modo le prime elemento del vector es le componente zero ('0') le qual, in altere parolas, ha le indice '0'. In consequentia, si le vector ha 'n' componentes le ultime habera como indice le valor 'n-1'. Le <a href="/wiki/C_(linguage_de_programmation)" title="C (linguage de programmation)">linguage C</a> es un exemplo typic que usa iste modo de indexation.</li></ul> <ul><li><b>Indexation base-un (1):</b> In iste forma de indexation, le prime elemento del matrice ha le indice '1' e le ultime ha le indice 'n' (pro un matrice de 'n' componentes).</li></ul> <ul><li><b>Indexation base-n (n):</b> Iste es un modo versatile de indexation in le qual le indice del prime elemento pote esser seligite liberemente, in alcun <a href="/wiki/Linguage_de_programmation" title="Linguage de programmation">linguages de programmation</a> on permitte que le indices pote esser negative e include de qualcunque typo <a href="/w/index.php?title=Scalar_(inform%C3%A1tica)&action=edit&redlink=1" class="new" title="Scalar (informática) (pagina non existe)">scalar</a> (anque catenas de characteres).</li></ul> <div class="mw-heading mw-heading2"><h2 id="Notation">Notation</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Vector_(informatica)&veaction=edit&section=2" title="Modificar section: Notation" class="mw-editsection-visualeditor"><span>modificar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Vector_(informatica)&action=edit&section=2" title="Modificar le codice fonte del section: Notation"><span>modificar fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Le representation de un elemento in un vector se face per le <a href="/wiki/Identificator" title="Identificator">identificator</a> del vector sequite del indice inter parentheses quadrate, parentheses o claves: </p> <table border="1" cellpadding="0" align="center"> <tbody><tr> <th>Notation</th> <th>Exemplos </th></tr> <tr> <td>vector[<i>indice_1</i>,<i>indice_2</i>...,<i>indice_N</i>]</td> <td>(<a href="/wiki/Java_(linguage_de_programmation)" title="Java (linguage de programmation)">Java</a>, <a href="/w/index.php?title=Lexico_(linguage_de_programmation)&action=edit&redlink=1" class="new" title="Lexico (linguage de programmation) (pagina non existe)">Lexico</a>, <a href="/w/index.php?title=Perl_(linguage_de_programmation)&action=edit&redlink=1" class="new" title="Perl (linguage de programmation) (pagina non existe)">Perl</a>, etc.) </td></tr> <tr> <td>vector[<i>indice_0</i>][<i>indice_1</i>]...[<i>indice_N</i>]</td> <td>(<a href="/wiki/C_(linguage_de_programmation)" title="C (linguage de programmation)">C</a>, <a href="/wiki/C%2B%2B" title="C++">C++</a>, <a href="/wiki/PHP" title="PHP">PHP</a>, etc.) </td></tr> <tr> <td>vector(<i>indice_1</i>,<i>indice_2</i>...,<i>indice_N</i>)</td> <td>(<a href="/wiki/BASIC" title="BASIC">BASIC</a>) </td></tr> </tbody></table> <p>Ben que multe vices in <a href="/wiki/Pseudocodice" title="Pseudocodice">pseudocodice</a> e in libros de <a href="/wiki/Mathematica" title="Mathematica">mathematica</a> on los representa como litteras accompaniate de un subindice numeric que indica le position al qual on vole acceder. Per exemplo, pro un vector "<b>A</b>": </p> <center><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle A_{0},A_{1},A_{2},...}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>A</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>0</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>A</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>A</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle A_{0},A_{1},A_{2},...}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6a4c9142a1ea7d3ad312c6b022f8c118d89f1717" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:14.209ex; height:2.509ex;" alt="{\displaystyle A_{0},A_{1},A_{2},...}"></span> (vector unidimensional)</center> <div class="mw-heading mw-heading2"><h2 id="Forma_de_accesso">Forma de accesso</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Vector_(informatica)&veaction=edit&section=3" title="Modificar section: Forma de accesso" class="mw-editsection-visualeditor"><span>modificar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Vector_(informatica)&action=edit&section=3" title="Modificar le codice fonte del section: Forma de accesso"><span>modificar fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Le maniera de acceder al elementos del matrice es <b>directe</b>; isto significa que le elemento desirate es obtenite a partir de su indice e illo non debe vader a cercar lo "elemento per elemento" (in contraposition, in le caso de un lista, pro arrivar, per exemplo, al tertie elemento illo debe acceder al duo anteriores o immagazinar un <a href="/w/index.php?title=Punctator_(programmation)&action=edit&redlink=1" class="new" title="Punctator (programmation) (pagina non existe)">punctator</a> que permitte acceder rapidemente a iste elemento). </p><p>Pro travaliar con vectores multe vices il es precise de percurrer los. Isto se realisa a fortia de <a href="/w/index.php?title=Bucla_(programmation)&action=edit&redlink=1" class="new" title="Bucla (programmation) (pagina non existe)">buclas</a>. Le sequente <a href="/wiki/Pseudocodice" title="Pseudocodice">pseudocodice</a> monstra un <a href="/wiki/Algorithmo" title="Algorithmo">algorithmo</a> typic pro percurrer un vector e applicar un function '<span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(...)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(...)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2a4bea7131b0facb6a97a8f3e9de6acf0575f960" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.19ex; height:2.843ex;" alt="{\displaystyle f(...)}"></span>' a cata un del componentes del vector (le indices va ab 0): </p> <pre>i = 0 durante_que (i < longitude) #Se realisa alcun operation con le vector in le i-esime position f(v[i]) i=i+1 fin_durante_que </pre> <div class="mw-heading mw-heading2"><h2 id="Vectores_dynamic_e_static">Vectores dynamic e static</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Vector_(informatica)&veaction=edit&section=4" title="Modificar section: Vectores dynamic e static" class="mw-editsection-visualeditor"><span>modificar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Vector_(informatica)&action=edit&section=4" title="Modificar le codice fonte del section: Vectores dynamic e static"><span>modificar fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Habitualmente un vector ha un quantitate fixe de memoria assignate, ben que dependente del typo de vector e del <a href="/wiki/Linguage_de_programmation" title="Linguage de programmation">linguage de programmation</a> un vector poterea haber un quantitate variabile de <a href="/wiki/Dato" title="Dato">datos</a>. In iste caso, illo se denomina un <b>vector dynamic</b>, in oposition, a un vector con un quantitate fixe de memoria assignate se denomina un <b>vector static</b>. </p><p>Le uso de vectores dynamic require de realisar un <a href="/w/index.php?title=Assignation_de_memoria&action=edit&redlink=1" class="new" title="Assignation de memoria (pagina non existe)">gestion de memoria dynamic</a> appropriate. Un uso incorrecte del vectores dynamic, o melior dicite, un mal gestion del memoria dynamic, pote conducer a un <a href="/w/index.php?title=Fuga_de_memoria&action=edit&redlink=1" class="new" title="Fuga de memoria (pagina non existe)">fuga de memoria</a>. Le uso de vectores dynamic deberea sempre liberar le memoria usate quando illo non es plus longe usate. </p><p><a href="/wiki/Linguage_de_programmation" title="Linguage de programmation">Linguages</a> plus moderne e de plus alte nivello con un mechanismo denominate <a href="/w/index.php?title=Recollector_de_immunditias&action=edit&redlink=1" class="new" title="Recollector de immunditias (pagina non existe)">recollector de immunditias</a> (como es le caso de <a href="/wiki/Java_(linguage_de_programmation)" title="Java (linguage de programmation)">Java</a>) permitte que le programma decide si illo debe liberar le spatio reguardante si illo va usar in le futuro o non un determinate objecto. </p> <div class="mw-heading mw-heading3"><h3 id="Exemplos_in_C">Exemplos in C</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Vector_(informatica)&veaction=edit&section=5" title="Modificar section: Exemplos in C" class="mw-editsection-visualeditor"><span>modificar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Vector_(informatica)&action=edit&section=5" title="Modificar le codice fonte del section: Exemplos in C"><span>modificar fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><u>Declaration in <a href="/wiki/C_(linguage_de_programmation)" title="C (linguage de programmation)">C</a>/<a href="/wiki/C%2B%2B" title="C++">C++</a> de un vector static</u>.</li></ul> <div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="n">v</span><span class="p">[</span><span class="mi">5</span><span class="p">];</span> <span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="p">;</span> <span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o"><</span><span class="mi">5</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span><span class="w"> </span><span class="n">v</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="o">*</span><span class="n">i</span><span class="p">;</span> <span class="p">}</span> </pre></div> <ul><li><u>Declaration in C++ de un vector de STL</u>:</li></ul> <div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">#include</span><span class="w"> </span><span class="cpf"><vector></span> <span class="n">vector</span><span class="o"><</span><span class="kt">int</span><span class="o">></span><span class="w"> </span><span class="n">v</span><span class="p">;</span><span class="w"> </span><span class="c1">// Si on non specifica le mesura initial es 0</span> <span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o"><</span><span class="mi">5</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span><span class="w"> </span><span class="n">v</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">i</span><span class="p">);</span><span class="w"> </span><span class="c1">// inserta un elemento al fin del vector</span> <span class="p">}</span> </pre></div> <p>Le exemplo anterior se trova facite pro le linguage C++. In C, pro crear vectores dynamic on deberea usar le instructiones <i><a rel="nofollow" class="external text" href="http://c.conclase.net/librerias/funcion.php?fun=malloc">malloc</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20090815074649/http://c.conclase.net/librerias/funcion.php?fun=malloc">Archived</a> 2009-08-15 at the <a href="/w/index.php?title=Wayback_Machine&action=edit&redlink=1" class="new" title="Wayback Machine (pagina non existe)">Wayback Machine</a></i> e <i><a rel="nofollow" class="external text" href="http://c.conclase.net/librerias/funcion.php?fun=realloc">realloc</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20090825033853/http://c.conclase.net/librerias/funcion.php?fun=realloc">Archived</a> 2009-08-25 at the <a href="/w/index.php?title=Wayback_Machine&action=edit&redlink=1" class="new" title="Wayback Machine (pagina non existe)">Wayback Machine</a></i> pro reservar del memoria de forma dynamic (vider <a href="/w/index.php?title=Stdlib.h&action=edit&redlink=1" class="new" title="Stdlib.h (pagina non existe)">libreria stdlib.h</a>), e le function per <i><a rel="nofollow" class="external text" href="http://c.conclase.net/librerias/funcion.php?fun=free">free</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20090825032827/http://c.conclase.net/librerias/funcion.php?fun=free">Archived</a> 2009-08-25 at the <a href="/w/index.php?title=Wayback_Machine&action=edit&redlink=1" class="new" title="Wayback Machine (pagina non existe)">Wayback Machine</a></i> pro liberar le memoria usate. </p> <ul><li><u>Resultato</u>:</li></ul> <center> <table border="1" cellpadding="3" align="center"> <caption> </caption> <tbody><tr> <th style="background:#efefef;">0</th> <th style="background:#efefef;">1</th> <th style="background:#efefef;">2</th> <th style="background:#efefef;">3</th> <th style="background:#efefef;">4 </th></tr> <tr> <td>0</td> <td>2</td> <td>4</td> <td>6</td> <td>8 </td></tr> </tbody></table> <p><i>Le resultato del duo exemplos es le mesme vector</i> </p> </center> <div class="mw-heading mw-heading2"><h2 id="Vectores_multidimensional">Vectores multidimensional</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Vector_(informatica)&veaction=edit&section=6" title="Modificar section: Vectores multidimensional" class="mw-editsection-visualeditor"><span>modificar</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=Vector_(informatica)&action=edit&section=6" title="Modificar le codice fonte del section: Vectores multidimensional"><span>modificar fonte</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>In <a href="/wiki/BASIC" title="BASIC">BASIC</a>, <a href="/wiki/Java_(linguage_de_programmation)" title="Java (linguage de programmation)">Java</a> e altere <a href="/wiki/Linguage_de_programmation" title="Linguage de programmation">linguages</a> il es possibile de declarar matrices multidimensional, comprendente los como un vector de vectores. In le dicte casos le numero de elementos del vector es le producto resultante de cata dimension. </p><p>Per exemplo, in le vector v(4,1) ha dece elementos, le numero de elementos se calcula del modo sequente: (0-4) * (0-1). Le elementos del prime dimension del vector contine cinque elementos va ab '0' al '4' e le secundo dimension ha duo elementos va ab '0' a '1'. Le elementos esserea accedite del maniera sequente: </p> <dl><dd>elemento 1: (0,0)</dd> <dd>elemento 2: (0,1)</dd> <dd>elemento 3: (1,0)</dd> <dd>...</dd> <dd>elemento 8: (3,1)</dd> <dd>elemento 9: (4,0)</dd> <dd>elemento 10: (4,1)</dd></dl> <div class="messagebox" style="padding: .5em; margin: 1ex 0 2ex 0; display: table; max-width: 50em;"> <div style="display: table-row"> <div style="display: table-cell; width: 56px; vertical-align: top"> <figure class="mw-halign-left" typeof="mw:File"><a href="/wiki/File:Wikipedia_logo_silver.png" class="mw-file-description" title="Nota"><img alt="Nota" src="//upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Wikipedia_logo_silver.png/40px-Wikipedia_logo_silver.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Wikipedia_logo_silver.png/60px-Wikipedia_logo_silver.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Wikipedia_logo_silver.png/80px-Wikipedia_logo_silver.png 2x" data-file-width="1058" data-file-height="1058" /></a><figcaption>Nota</figcaption></figure> </div> <div class="plainlinks" style="display: table-cell; width: 100%; margin-left: 1.2cm; vertical-align: top; min-height: 40px"> <div style="margin-top: .5ex; font-size: 90%; font-style: italic">Iste pagina contine material traducite ab <a href="https://es.wikipedia.org/wiki/" class="extiw" title="es:">Wikipedia in espaniol</a>. Le articulo original se trova in le <a href="https://es.wikipedia.org/wiki/Special:Permalink/50666902" class="extiw" title="es:Special:Permalink/50666902">version 50666902</a> de <a href="https://es.wikipedia.org/wiki/Vector_(inform%C3%A1tica)" class="extiw" title="es:Vector (informática)">es:Vector (informática)</a>, e es usate secundo le mandatos del licentia de Wikipedia.</div></div></div></div></div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Obtenite de “<a dir="ltr" href="https://ia.wikipedia.org/wiki/Vector_(informatica)">https://ia.wikipedia.org/wiki/Vector_(informatica)</a>”</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categorias" title="Special:Categorias">Categorias</a>: <ul><li><a href="/w/index.php?title=Categoria:Webarchive_template_wayback_links&action=edit&redlink=1" class="new" title="Categoria:Webarchive template wayback links (pagina non existe)">Webarchive template wayback links</a></li><li><a href="/wiki/Categoria:Structuras_de_datos" title="Categoria:Structuras de datos">Structuras de datos</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-copyright">Le texto es disponibile sub le <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/">licentia Creative Commons Attribution-CompartiSimile</a>; additional conditiones pote esser in vigor. Vide <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Conditiones de uso</a> pro detalios.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Politica de confidentialitate</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:A_proposito">A proposito de Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:Declaration_general_de_non-responsabilitate">Declaration de non-responsabilitate</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Codice de conducta</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Programmatores</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/ia.wikipedia.org">Statisticas</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Declaration sur cookies</a></li> <li id="footer-places-mobileview"><a href="//ia.m.wikipedia.org/w/index.php?title=Vector_(informatica)&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Version mobile</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-65496f48b4-hjwk4","wgBackendResponseTime":157,"wgPageParseReport":{"limitreport":{"cputime":"0.096","walltime":"0.412","ppvisitednodes":{"value":351,"limit":1000000},"postexpandincludesize":{"value":4143,"limit":2097152},"templateargumentsize":{"value":342,"limit":2097152},"expansiondepth":{"value":9,"limit":100},"expensivefunctioncount":{"value":2,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":2786,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00% 335.187 1 -total"," 42.87% 143.702 1 Patrono:Infobox/articulo/generic"," 6.13% 20.533 3 Patrono:Webarchive"," 4.56% 15.286 1 Patrono:PAGENAMEBASE"," 3.45% 11.570 1 Patrono:Traduction"," 2.46% 8.245 1 Patrono:Notice"," 1.49% 4.984 1 Patrono:Lingua"]},"scribunto":{"limitreport-timeusage":{"value":"0.020","limit":"10.000"},"limitreport-memusage":{"value":1382475,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-5dc468848-xq668","timestamp":"20241124124213","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Vector (informatica)","url":"https:\/\/ia.wikipedia.org\/wiki\/Vector_(informatica)","sameAs":"http:\/\/www.wikidata.org\/entity\/Q186152","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q186152","author":{"@type":"Organization","name":"Contributores al projectos de Wikimedia"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2011-11-01T18:12:16Z"}</script> </body> </html>