{"id":123,"date":"2019-03-04T19:54:15","date_gmt":"2019-03-04T19:54:15","guid":{"rendered":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/?post_type=chapter&#038;p=123"},"modified":"2019-09-01T11:57:28","modified_gmt":"2019-09-01T11:57:28","slug":"andmestruktuuride-vordlustabel","status":"publish","type":"chapter","link":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/chapter\/andmestruktuuride-vordlustabel\/","title":{"raw":"Andmestruktuuride v\u00f5rdlustabel","rendered":"Andmestruktuuride v\u00f5rdlustabel"},"content":{"raw":"<p class=\"vspace\">Programmeerimiskeeltes on v\u00f5imalik kasutada mitmesuguseid andmestruktuure, mis teatud aspektides on sarnased, teistes aga erinevad. Alltoodud tabelis on v\u00f5rdlevalt v\u00e4ljatoodud Pythoni p\u00f5hiliste andmestruktuuride omadused. Tegelikult on see info eelnevates materjalides juba olemas. Siin on see lihtsalt kompaktsemalt esitatud.<\/p>\r\n\r\n<div class=\"vspace\"><\/div>\r\n<table class=\"lines alignleft\" style=\"height: 488px;width: 1040px\" border=\"1\" width=\"200%\" cellspacing=\"3\" cellpadding=\"3\">\r\n<tbody>\r\n<tr style=\"height: 16px\">\r\n<td style=\"width: 96.1333px;height: 16px\" valign=\"top\">\r\n<div class=\"vspace\"><\/div><\/td>\r\n<td style=\"width: 161.2px;height: 16px\" align=\"center\" valign=\"middle\" bgcolor=\"#FFFFCC\"><strong>J\u00e4rjend (ingl <em>list<\/em>)<\/strong><\/td>\r\n<td style=\"width: 223.267px;height: 16px\" align=\"center\" valign=\"middle\" bgcolor=\"#FFFFCC\"><strong>Ennik (ingl <em>tuple<\/em>)<\/strong><\/td>\r\n<td style=\"width: 179.217px;height: 16px\" align=\"center\" valign=\"middle\" bgcolor=\"#FFFFCC\"><strong>Hulk (ingl <em>set<\/em>)<\/strong><\/td>\r\n<td style=\"width: 313.35px;height: 16px\" align=\"center\" valign=\"middle\" bgcolor=\"#FFFFCC\"><strong>S\u00f5nastik (ingl <em>dict<\/em>)<\/strong><\/td>\r\n<\/tr>\r\n<tr style=\"height: 47px\">\r\n<td style=\"width: 96.1333px;height: 47px\" align=\"center\" valign=\"middle\"><strong>J\u00e4rjestus<\/strong><\/td>\r\n<td style=\"width: 161.2px;height: 47px\" valign=\"top\">Unikaalsed indeksid, kindel j\u00e4rjestus<\/td>\r\n<td style=\"width: 223.267px;height: 47px\" valign=\"top\">Unikaalsed indeksid, kindel j\u00e4rjestus<\/td>\r\n<td style=\"width: 179.217px;height: 47px\" valign=\"top\">Ei ole indekseid, kindel j\u00e4rjestus puudub<\/td>\r\n<td style=\"width: 313.35px;height: 47px\" valign=\"top\">Unikaalsed v\u00f5tmed, kindel j\u00e4rjestus puudub<\/td>\r\n<\/tr>\r\n<tr style=\"height: 193px\">\r\n<td style=\"width: 96.1333px;height: 193px\" align=\"center\" valign=\"middle\"><strong>N\u00e4ited<\/strong><\/td>\r\n<td style=\"width: 161.2px;height: 193px\" valign=\"top\">\r\n<ul>\r\n \t<li><code>j\u00e4rjend = []<\/code>, <code>j\u00e4rjend = list()<\/code><\/li>\r\n \t<li><code>j\u00e4rjend = [7]<\/code><\/li>\r\n \t<li><code>j\u00e4rjend = ['999', 777]<\/code><\/li>\r\n<\/ul>\r\n<\/td>\r\n<td style=\"width: 223.267px;height: 193px\" valign=\"top\">\r\n<ul>\r\n \t<li><code>ennik = ()<\/code>, <code>ennik = tuple()<\/code><\/li>\r\n \t<li><code>ennik = (42,)<\/code><\/li>\r\n \t<li><code>ennik = ('PAII', 1011)<\/code><\/li>\r\n<\/ul>\r\n<\/td>\r\n<td style=\"width: 179.217px;height: 193px\" valign=\"top\">\r\n<ul>\r\n \t<li><code>hulk = set()<\/code><\/li>\r\n \t<li><code>hulk = {4}<\/code><\/li>\r\n \t<li><code>hulk = {'s', 'e', 't', 2}<\/code><\/li>\r\n<\/ul>\r\n<\/td>\r\n<td style=\"width: 313.35px;height: 193px\" valign=\"top\">\r\n<ul>\r\n \t<li><code>s\u00f5nastik = {}, s\u00f5nastik = dict()<\/code><\/li>\r\n \t<li><code>s\u00f5nastik = {'\u00fcks': 1}<\/code><\/li>\r\n \t<li><code>s\u00f5nastik = {'\u56db': 4, '\u4e94': 5, 4: 4}<\/code><\/li>\r\n<\/ul>\r\n<\/td>\r\n<\/tr>\r\n<tr style=\"height: 47px\">\r\n<td style=\"width: 96.1333px;height: 47px\" align=\"center\" valign=\"middle\"><strong>Elemendi lisamine<\/strong><\/td>\r\n<td style=\"width: 161.2px;height: 47px\" valign=\"top\"><code>j\u00e4rjend += [element]<\/code>, <code>j\u00e4rjend.append(element)<\/code><\/td>\r\n<td style=\"width: 223.267px;height: 47px\" valign=\"top\">Mittemuteeritav, elemente ei saa lisada<\/td>\r\n<td style=\"width: 179.217px;height: 47px\" valign=\"top\"><code>hulk.add(element)<\/code><\/td>\r\n<td style=\"width: 313.35px;height: 47px\" valign=\"top\"><code>s\u00f5nastik[v\u00f5ti] = v\u00e4\u00e4rtus<\/code><\/td>\r\n<\/tr>\r\n<tr style=\"height: 47px\">\r\n<td style=\"width: 96.1333px;height: 47px\" align=\"center\" valign=\"middle\"><strong>Elemendi muutmine<\/strong><\/td>\r\n<td style=\"width: 161.2px;height: 47px\" valign=\"top\"><code>j\u00e4rjend[indeks] = v\u00e4\u00e4rtus<\/code><\/td>\r\n<td style=\"width: 223.267px;height: 47px\" valign=\"top\">Mittemuteeritav, elemente ei saa muuta<\/td>\r\n<td style=\"width: 179.217px;height: 47px\" valign=\"top\"><code>remove(element)<\/code>, <code>add(element)<\/code><\/td>\r\n<td style=\"width: 313.35px;height: 47px\" valign=\"top\"><code>s\u00f5nastik[v\u00f5ti] = v\u00e4\u00e4rtus<\/code><\/td>\r\n<\/tr>\r\n<tr style=\"height: 107px\">\r\n<td style=\"width: 96.1333px;height: 107px\" align=\"center\" valign=\"middle\"><strong>Teisendamine<\/strong><\/td>\r\n<td style=\"width: 161.2px;height: 107px\" valign=\"top\">N\u00e4iteks hulgast j\u00e4rjendiks <code>list({3, 4}) \u2192 [3, 4]<\/code><\/td>\r\n<td style=\"width: 223.267px;height: 107px\" valign=\"top\">N\u00e4iteks j\u00e4rjendist ennikuks <code>tuple([3, 4]) \u2192 (3, 4)<\/code><\/td>\r\n<td style=\"width: 179.217px;height: 107px\" valign=\"top\">N\u00e4iteks j\u00e4rjendist hulgaks <code>set([3, 4]) \u2192 {3, 4}<\/code><\/td>\r\n<td style=\"width: 313.35px;height: 107px\" valign=\"top\">N\u00e4iteks paaride j\u00e4rjendist s\u00f5nastikuks <code>dict([('Aare', 49), ('Malle', 46)]) \u2192 {'Aare': 49, 'Malle': 46}<\/code><\/td>\r\n<\/tr>\r\n<tr style=\"height: 31px\">\r\n<td style=\"width: 96.1333px;height: 31px\" align=\"center\" valign=\"middle\"><strong>Elementide korduvus<\/strong><\/td>\r\n<td style=\"width: 161.2px;height: 31px\" valign=\"top\">V\u00f5ib olla korduvaid elemente<\/td>\r\n<td style=\"width: 223.267px;height: 31px\" valign=\"top\">V\u00f5ib olla korduvaid elemente<\/td>\r\n<td style=\"width: 179.217px;height: 31px\" valign=\"top\">Korduvaid elemente ei ole<\/td>\r\n<td style=\"width: 313.35px;height: 31px\" valign=\"top\">Korduvaid <strong>v\u00f5tmeid<\/strong> ei ole<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n&nbsp;","rendered":"<p class=\"vspace\">Programmeerimiskeeltes on v\u00f5imalik kasutada mitmesuguseid andmestruktuure, mis teatud aspektides on sarnased, teistes aga erinevad. Alltoodud tabelis on v\u00f5rdlevalt v\u00e4ljatoodud Pythoni p\u00f5hiliste andmestruktuuride omadused. Tegelikult on see info eelnevates materjalides juba olemas. Siin on see lihtsalt kompaktsemalt esitatud.<\/p>\n<div class=\"vspace\"><\/div>\n<table class=\"lines alignleft\" style=\"height: 488px;width: 1040px; width: 200%; border-spacing: 3px;\" cellpadding=\"3\">\n<tbody>\n<tr style=\"height: 16px\">\n<td style=\"width: 96.1333px;height: 16px\" valign=\"top\">\n<div class=\"vspace\"><\/div>\n<\/td>\n<td style=\"width: 161.2px;height: 16px; background-color: #FFFFCC;\" align=\"center\" valign=\"middle\"><strong>J\u00e4rjend (ingl <em>list<\/em>)<\/strong><\/td>\n<td style=\"width: 223.267px;height: 16px; background-color: #FFFFCC;\" align=\"center\" valign=\"middle\"><strong>Ennik (ingl <em>tuple<\/em>)<\/strong><\/td>\n<td style=\"width: 179.217px;height: 16px; background-color: #FFFFCC;\" align=\"center\" valign=\"middle\"><strong>Hulk (ingl <em>set<\/em>)<\/strong><\/td>\n<td style=\"width: 313.35px;height: 16px; background-color: #FFFFCC;\" align=\"center\" valign=\"middle\"><strong>S\u00f5nastik (ingl <em>dict<\/em>)<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 47px\">\n<td style=\"width: 96.1333px;height: 47px\" align=\"center\" valign=\"middle\"><strong>J\u00e4rjestus<\/strong><\/td>\n<td style=\"width: 161.2px;height: 47px\" valign=\"top\">Unikaalsed indeksid, kindel j\u00e4rjestus<\/td>\n<td style=\"width: 223.267px;height: 47px\" valign=\"top\">Unikaalsed indeksid, kindel j\u00e4rjestus<\/td>\n<td style=\"width: 179.217px;height: 47px\" valign=\"top\">Ei ole indekseid, kindel j\u00e4rjestus puudub<\/td>\n<td style=\"width: 313.35px;height: 47px\" valign=\"top\">Unikaalsed v\u00f5tmed, kindel j\u00e4rjestus puudub<\/td>\n<\/tr>\n<tr style=\"height: 193px\">\n<td style=\"width: 96.1333px;height: 193px\" align=\"center\" valign=\"middle\"><strong>N\u00e4ited<\/strong><\/td>\n<td style=\"width: 161.2px;height: 193px\" valign=\"top\">\n<ul>\n<li><code>j\u00e4rjend = []<\/code>, <code>j\u00e4rjend = list()<\/code><\/li>\n<li><code>j\u00e4rjend = [7]<\/code><\/li>\n<li><code>j\u00e4rjend = ['999', 777]<\/code><\/li>\n<\/ul>\n<\/td>\n<td style=\"width: 223.267px;height: 193px\" valign=\"top\">\n<ul>\n<li><code>ennik = ()<\/code>, <code>ennik = tuple()<\/code><\/li>\n<li><code>ennik = (42,)<\/code><\/li>\n<li><code>ennik = ('PAII', 1011)<\/code><\/li>\n<\/ul>\n<\/td>\n<td style=\"width: 179.217px;height: 193px\" valign=\"top\">\n<ul>\n<li><code>hulk = set()<\/code><\/li>\n<li><code>hulk = {4}<\/code><\/li>\n<li><code>hulk = {'s', 'e', 't', 2}<\/code><\/li>\n<\/ul>\n<\/td>\n<td style=\"width: 313.35px;height: 193px\" valign=\"top\">\n<ul>\n<li><code>s\u00f5nastik = {}, s\u00f5nastik = dict()<\/code><\/li>\n<li><code>s\u00f5nastik = {'\u00fcks': 1}<\/code><\/li>\n<li><code>s\u00f5nastik = {'\u56db': 4, '\u4e94': 5, 4: 4}<\/code><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr style=\"height: 47px\">\n<td style=\"width: 96.1333px;height: 47px\" align=\"center\" valign=\"middle\"><strong>Elemendi lisamine<\/strong><\/td>\n<td style=\"width: 161.2px;height: 47px\" valign=\"top\"><code>j\u00e4rjend += [element]<\/code>, <code>j\u00e4rjend.append(element)<\/code><\/td>\n<td style=\"width: 223.267px;height: 47px\" valign=\"top\">Mittemuteeritav, elemente ei saa lisada<\/td>\n<td style=\"width: 179.217px;height: 47px\" valign=\"top\"><code>hulk.add(element)<\/code><\/td>\n<td style=\"width: 313.35px;height: 47px\" valign=\"top\"><code>s\u00f5nastik[v\u00f5ti] = v\u00e4\u00e4rtus<\/code><\/td>\n<\/tr>\n<tr style=\"height: 47px\">\n<td style=\"width: 96.1333px;height: 47px\" align=\"center\" valign=\"middle\"><strong>Elemendi muutmine<\/strong><\/td>\n<td style=\"width: 161.2px;height: 47px\" valign=\"top\"><code>j\u00e4rjend[indeks] = v\u00e4\u00e4rtus<\/code><\/td>\n<td style=\"width: 223.267px;height: 47px\" valign=\"top\">Mittemuteeritav, elemente ei saa muuta<\/td>\n<td style=\"width: 179.217px;height: 47px\" valign=\"top\"><code>remove(element)<\/code>, <code>add(element)<\/code><\/td>\n<td style=\"width: 313.35px;height: 47px\" valign=\"top\"><code>s\u00f5nastik[v\u00f5ti] = v\u00e4\u00e4rtus<\/code><\/td>\n<\/tr>\n<tr style=\"height: 107px\">\n<td style=\"width: 96.1333px;height: 107px\" align=\"center\" valign=\"middle\"><strong>Teisendamine<\/strong><\/td>\n<td style=\"width: 161.2px;height: 107px\" valign=\"top\">N\u00e4iteks hulgast j\u00e4rjendiks <code>list({3, 4}) \u2192 [3, 4]<\/code><\/td>\n<td style=\"width: 223.267px;height: 107px\" valign=\"top\">N\u00e4iteks j\u00e4rjendist ennikuks <code>tuple([3, 4]) \u2192 (3, 4)<\/code><\/td>\n<td style=\"width: 179.217px;height: 107px\" valign=\"top\">N\u00e4iteks j\u00e4rjendist hulgaks <code>set([3, 4]) \u2192 {3, 4}<\/code><\/td>\n<td style=\"width: 313.35px;height: 107px\" valign=\"top\">N\u00e4iteks paaride j\u00e4rjendist s\u00f5nastikuks <code>dict([('Aare', 49), ('Malle', 46)]) \u2192 {'Aare': 49, 'Malle': 46}<\/code><\/td>\n<\/tr>\n<tr style=\"height: 31px\">\n<td style=\"width: 96.1333px;height: 31px\" align=\"center\" valign=\"middle\"><strong>Elementide korduvus<\/strong><\/td>\n<td style=\"width: 161.2px;height: 31px\" valign=\"top\">V\u00f5ib olla korduvaid elemente<\/td>\n<td style=\"width: 223.267px;height: 31px\" valign=\"top\">V\u00f5ib olla korduvaid elemente<\/td>\n<td style=\"width: 179.217px;height: 31px\" valign=\"top\">Korduvaid elemente ei ole<\/td>\n<td style=\"width: 313.35px;height: 31px\" valign=\"top\">Korduvaid <strong>v\u00f5tmeid<\/strong> ei ole<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"author":12,"menu_order":5,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-123","chapter","type-chapter","status-publish","hentry"],"part":28,"_links":{"self":[{"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/pressbooks\/v2\/chapters\/123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/wp\/v2\/users\/12"}],"version-history":[{"count":14,"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/pressbooks\/v2\/chapters\/123\/revisions"}],"predecessor-version":[{"id":303,"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/pressbooks\/v2\/chapters\/123\/revisions\/303"}],"part":[{"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/pressbooks\/v2\/parts\/28"}],"metadata":[{"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/pressbooks\/v2\/chapters\/123\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/pressbooks\/v2\/chapter-type?post=123"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/wp\/v2\/contributor?post=123"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/web.htk.tlu.ee\/digitaru\/tarkvara\/wp-json\/wp\/v2\/license?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}