From 1ffa25152f18588b381fa9260f437f07d9a04003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 15 Apr 2024 10:33:24 +0200 Subject: =?UTF-8?q?=C5=A1ola?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + prog/sear.php/index.php | 2 + skripti/namesti.sh | 1 + skripti/registracija_uporabnika.sh | 12 + skripti/transcribe_large_file.sh | 14 + "\305\241ola/ars/kol1.txt" | 51 + "\305\241ola/ds2/kolokvij1.lyx" | 1779 +++++++++++++++++++++++ "\305\241ola/ds2/teorija.lyx" | 1911 +++++++++++++++++++++++++ "\305\241ola/kro\305\276ek/spremenljivke.odp" | Bin 0 -> 15619 bytes "\305\241ola/kro\305\276ek/uvodno.odp" | Bin 0 -> 822850 bytes "\305\241ola/la/dn6/dokument.lyx" | 1514 ++++++++++++++++++++ "\305\241ola/p2/dn/.gitignore" | 6 + "\305\241ola/p2/dn/dn06-naloga1.c" | 29 + "\305\241ola/p2/dn/dn06-naloga2.c" | 41 + "\305\241ola/p2/dn/naloga.c" | 30 + 15 files changed, 5391 insertions(+) create mode 100755 skripti/registracija_uporabnika.sh create mode 100755 skripti/transcribe_large_file.sh create mode 100644 "\305\241ola/ars/kol1.txt" create mode 100644 "\305\241ola/ds2/kolokvij1.lyx" create mode 100644 "\305\241ola/ds2/teorija.lyx" create mode 100644 "\305\241ola/kro\305\276ek/spremenljivke.odp" create mode 100644 "\305\241ola/kro\305\276ek/uvodno.odp" create mode 100644 "\305\241ola/la/dn6/dokument.lyx" create mode 100644 "\305\241ola/p2/dn/.gitignore" create mode 100644 "\305\241ola/p2/dn/dn06-naloga1.c" create mode 100644 "\305\241ola/p2/dn/dn06-naloga2.c" create mode 100644 "\305\241ola/p2/dn/naloga.c" diff --git a/.gitignore b/.gitignore index 524229a..1e4a91f 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ vendor/ node_modules/ *.class javac.*.args +*.emergency diff --git a/prog/sear.php/index.php b/prog/sear.php/index.php index 1f90c9c..2e695c5 100644 --- a/prog/sear.php/index.php +++ b/prog/sear.php/index.php @@ -59,6 +59,8 @@ function query_google ($s, $image = false, $noredirect = false, $bindstring = fa } $results = []; $x = new DOMDocument(); + // file_put_contents("/tmp/x", $txtdoc); + $txtdoc = mb_convert_encoding($txtdoc, "ISO-8859-1"); $x->loadHTML($txtdoc); if ($image) foreach ($x->getElementsByTagName("div") as $div) { diff --git a/skripti/namesti.sh b/skripti/namesti.sh index 88253bf..e36a894 100755 --- a/skripti/namesti.sh +++ b/skripti/namesti.sh @@ -7,4 +7,5 @@ Uporabnik $DOAS_USER na računalniku `hostname` je pravkar zahteval poganjanje p EOF p=`grep -Eo '[a-zA-Z0-9+][a-zA-Z0-9_+.-]*[a-zA-Z0-9_+./]*' <<<$1 | head -n1` echo Začel bom nameščanje $p. +[ $DOAS_USER = dijak ] && echo "PREKINJAM NAMEŠČANJE. uporabnik dijak ne sme nameščati programov iz varnostnih razlogov." echo | emerge $p diff --git a/skripti/registracija_uporabnika.sh b/skripti/registracija_uporabnika.sh new file mode 100755 index 0000000..a2419fa --- /dev/null +++ b/skripti/registracija_uporabnika.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# $1 je username, $2 je fullname, $3 je komentar, $4 je expiredate YYYY-MM-DD, $5 je groups, $6 je crypt password +# GECOS: full name,room number,office tel,home tel,other contact +set -euo pipefail +username=`grep -o "[a-z][-_.a-z0-9]*" <<<"$1" | head -n1 | head -c16` +if [ ! "$username" = "$1" ] +then + echo uporabniško ime ni pravilne oblike. predlagam takole uporabniško ime: $username -- uporabnika nisem izdelal + exit 1 +fi +useradd --expiredate "$4" --groups "$5" --password "$6" --comment "`sed -e s/,//g<<<$2`,,,,`sed -e s/,//<<<$3`-reg.sh $DOAS_USER `date +%s`" $username +echo uporabnik uspešno izdelan! diff --git a/skripti/transcribe_large_file.sh b/skripti/transcribe_large_file.sh new file mode 100755 index 0000000..e9bcc27 --- /dev/null +++ b/skripti/transcribe_large_file.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -xeuo pipefail +p=`rev <<<$0 | cut -d/ -f1 | rev` +d=`mktemp -p "" -d $p.XXX` +trap "rm -fr $d" EXIT +ffmpeg -i $1 -f segment -segment_time 240 -acodec pcm_s16le -ac 1 -ar 16000 $d/%03d.wav +for i in $d/*.wav +do + curl -X 'POST' \ + 'http://splet.4a.si.:8000/api/transcribe' \ + -H 'accept: application/json' \ + -H 'Content-Type: multipart/form-data' \ + -F "audio_file=@$i;type=audio/wav" | jq --raw-output .result > $1.`rev <<<$i | cut -d. -f2 | cut -d/ -f1 | rev`.txt +done diff --git "a/\305\241ola/ars/kol1.txt" "b/\305\241ola/ars/kol1.txt" new file mode 100644 index 0000000..8d10834 --- /dev/null +++ "b/\305\241ola/ars/kol1.txt" @@ -0,0 +1,51 @@ +registri: x0 zero 0 + x1 ra return address + x2 sp stack pointer + x5-7 t0-2 temporary + x8-9 fp/s0-1 saved + x10-17 a0-7 argument + x18-27 s2-11 saved + x28-31 t3-6 temporary + +psevdoinštrukcije: + + delta = symbol - pc + la rd, sym auipc rd, delta[31:12]+delta[11]; addi rd, rd, delta[11:0] + lla rd, sym TODO + l[bhwd] rd, sym auipc rd, delta[31:12]+delta[11]; l[bhwd] rd, delta[11:0](rd) + s[bhwd] rd, sym, rt auipc rt, delta[31:12]+delta[11]; s[bhws] rd, delta[11:0](rt) + + nop addi x0, x0, 0 + mv rd, rs addi rd, rs, 0 + not rd, rs xori rd, rs, -1 + neg rd, rs sub rd, x0, rs + + bgt[u] rs, rt, off blt[u] rt, rs, off + ble[u] rs, rt, off bge[u] rt, rs, off + + j off jal x0, off + jal off jal x1, off + jr rs jalr x0, 0(rs) + jalr rs jalr x1, 0(rs) + ret jalr x0, 0(x1) + call of auipc x1, of[31:12]+of[11]; jalr x1, of[11:0](x1) + tail of auipc x6, of[31:12]+of[11]; jalr x0, of[11:0](x6) + +float: (-1)^s*2^(E-e)*1,M_1 M_2 M_3 M_4...M_n + exp e man + single 32 8 127 23 + double 64 11 1023 52 + + inf: E=255/2047, m=0 + nan: E=255/2047, m!=0 + računamo z več biti: varovalni, zaokroževalni, lepljivi + +.data, .text, .byte, .half, .word, .dword, .align + +a*10 = a*(8+2) = a*8+a*2 + +rabimo ceil(log_base(1/error)) decimalk + +Dostop do visokih naslovov: %hi(A) -- top 20b, %lo(A) low 12b + +TODO: slide 3b množenje floatov, chapter 2.4 intager computation diff --git "a/\305\241ola/ds2/kolokvij1.lyx" "b/\305\241ola/ds2/kolokvij1.lyx" new file mode 100644 index 0000000..2227d5e --- /dev/null +++ "b/\305\241ola/ds2/kolokvij1.lyx" @@ -0,0 +1,1779 @@ +#LyX 2.3 created this file. For more info see http://www.lyx.org/ +\lyxformat 544 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\begin_preamble +\usepackage{siunitx} +\usepackage{pgfplots} +\usepackage{listings} +\usepackage{multicol} +\sisetup{output-decimal-marker = {,}, quotient-mode=fraction, output-exponent-marker=\ensuremath{\mathrm{3}}} +\DeclareMathOperator{\g}{g} +\DeclareMathOperator{\sled}{sled} +\DeclareMathOperator{\Aut}{Aut} +\DeclareMathOperator{\Cir}{Cir} +\DeclareMathOperator{\ecc}{ecc} +\DeclareMathOperator{\rad}{rad} +\DeclareMathOperator{\diam}{diam} +\newcommand\euler{e} +\end_preamble +\use_default_options true +\begin_modules +enumitem +\end_modules +\maintain_unincluded_children false +\language slovene +\language_package default +\inputencoding auto +\fontencoding global +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics xetex +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification false +\use_refstyle 1 +\use_minted 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 1cm +\topmargin 1cm +\rightmargin 1cm +\bottommargin 2cm +\headheight 1cm +\headsep 1cm +\footskip 1cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style german +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +setlength{ +\backslash +columnseprule}{0.2pt} +\backslash +begin{multicols}{2} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Največja stopnja +\begin_inset Formula $\Delta G$ +\end_inset + +, najmanjša +\begin_inset Formula $\delta G$ +\end_inset + +. +\end_layout + +\begin_layout Standard +Rokovanje: +\begin_inset Formula $\sum_{v\in VG}\deg_{G}v=2\left|EG\right|$ +\end_inset + +. +\end_layout + +\begin_layout Standard +Vsak graf ima sodo mnogo vozlišč lihe stopnje. +\end_layout + +\begin_layout Standard +Presek/unija grafov je presek/unija njunih +\begin_inset Formula $V$ +\end_inset + + in +\begin_inset Formula $E$ +\end_inset + +. +\end_layout + +\begin_layout Standard +\begin_inset Formula $G\cup H$ +\end_inset + + je disjunktna unija grafov +\begin_inset Formula $\sim$ +\end_inset + + +\begin_inset Formula $VG\cap VH=\emptyset$ +\end_inset + +. +\end_layout + +\begin_layout Standard +Komplement grafa: +\begin_inset Formula $\overline{G}$ +\end_inset + + (obratna povezanost) +\end_layout + +\begin_layout Standard +\begin_inset Formula $0\leq\left|EG\right|\leq{\left|VG\right| \choose 2}\quad\quad\quad$ +\end_inset + +Za padajoče +\begin_inset Formula $d_{i}$ +\end_inset + + velja: +\end_layout + +\begin_layout Standard +\begin_inset Formula $\left(d_{1},\dots d_{n}\right)$ +\end_inset + + graf +\begin_inset Formula $\Leftrightarrow\left(d_{2}-1,\dots,d_{d_{1}+1}-1,\dots,d_{n}\right)$ +\end_inset + + graf +\end_layout + +\begin_layout Standard +Če je +\begin_inset Formula $AG$ +\end_inset + + matrika sosednosti, +\begin_inset Formula $\left(\left(AG\right)^{n}\right)_{i,j}$ +\end_inset + + pove št. + +\begin_inset Formula $i,j-$ +\end_inset + +poti. +\end_layout + +\begin_layout Standard +\begin_inset Formula +\[ +\text{Število trikotnikov: }\frac{\sled\left(\left(AG\right)^{3}\right)}{2\cdot3} +\] + +\end_inset + + +\end_layout + +\begin_layout Paragraph +Sprehod +\end_layout + +\begin_layout Standard +je zaporedje vozlišč, ki so verižno povezana. +\end_layout + +\begin_layout Standard +Dolžina sprehoda je število prehojenih povezav. +\end_layout + +\begin_layout Standard +Sklenjen sprehod dolžine +\begin_inset Formula $k$ +\end_inset + +: +\begin_inset Formula $v_{0}=v_{k}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Enostaven sprehod ima disjunktna vozlišča razen +\begin_inset Formula $\left(v_{0},v_{k}\right)$ +\end_inset + +. +\end_layout + +\begin_layout Standard +Pot v grafu: podgraf +\begin_inset Formula $P_{k}$ +\end_inset + + +\begin_inset Formula $\sim$ +\end_inset + + enostaven nesklenjen sprehod. +\end_layout + +\begin_layout Paragraph +Cikel +\end_layout + +\begin_layout Standard +podgraf, ki je enostaven sklenjen sprehod dolžine +\begin_inset Formula $>3$ +\end_inset + +. +\end_layout + +\begin_layout Standard +Če v +\begin_inset Formula $G$ +\end_inset + + +\begin_inset Formula $\exists$ +\end_inset + + dve različni +\begin_inset Formula $u,v-$ +\end_inset + +poti +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + +\begin_inset Formula $G$ +\end_inset + + premore cikel +\end_layout + +\begin_layout Standard +Sklenjen sprehod lihe dolžine +\begin_inset Formula $\in G$ +\end_inset + + +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + lih cikel +\begin_inset Formula $\in G$ +\end_inset + + +\end_layout + +\begin_layout Paragraph +Povezanost +\end_layout + +\begin_layout Standard +\begin_inset Formula $u,v$ +\end_inset + + sta v isti komponenti +\begin_inset Formula $\text{\ensuremath{\sim}}$ +\end_inset + + +\begin_inset Formula $\text{\ensuremath{\exists}}$ +\end_inset + + +\begin_inset Formula $u,v-$ +\end_inset + +pot +\end_layout + +\begin_layout Standard +Število komponent grafa: +\begin_inset Formula $\Omega G$ +\end_inset + +. + +\begin_inset Formula $G$ +\end_inset + + povezan +\begin_inset Formula $\sim\Omega G=1$ +\end_inset + + +\end_layout + +\begin_layout Standard +Komponenta je maksimalen povezan podgraf. +\end_layout + +\begin_layout Standard +Premer: +\begin_inset Formula $\diam G=\max\left\{ d_{G}\left(v,u\right);\forall v,u\in VG\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +Ekscentričnost: +\begin_inset Formula $\ecc_{G}u=max\left\{ d_{G}\left(u,x\right);\forall x\in VG\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +Polmer: +\begin_inset Formula $\rad G=\min\left\{ \ecc u;\forall u\in VG\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\diam C_{n}=\rad C_{n}=\lfloor\frac{n}{2}\rfloor$ +\end_inset + + +\end_layout + +\begin_layout Standard +(Liha) ožina ( +\begin_inset Formula $\g G$ +\end_inset + +) je dolžina najkrajšega (lihega) cikla. +\end_layout + +\begin_layout Standard +Vsaj en od +\begin_inset Formula $G$ +\end_inset + + in +\begin_inset Formula $\overline{G}$ +\end_inset + + je povezan. +\end_layout + +\begin_layout Standard +Povezava +\begin_inset Formula $e$ +\end_inset + + je most +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + +\begin_inset Formula $\Omega\left(G-e\right)>\Omega G$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $u$ +\end_inset + + je prerezno vozlišče +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + +\begin_inset Formula $\Omega\left(G-u\right)>\Omega G$ +\end_inset + + +\end_layout + +\begin_layout Standard +Za nepovezan +\begin_inset Formula $G$ +\end_inset + + velja +\begin_inset Formula $\diam\overline{G}\leq2$ +\end_inset + + +\end_layout + +\begin_layout Paragraph +Dvodelni +\end_layout + +\begin_layout Standard +\begin_inset Formula $\sim V=A\cup B,A\cap B=\emptyset,\forall uv\in E:u\in A\oplus v\in A$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $K_{m,n}$ +\end_inset + + je poln dvodelni graf, +\begin_inset Formula $\left|A\right|=m$ +\end_inset + +, +\begin_inset Formula $\left|B\right|=n$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + dvodelen +\begin_inset Formula $\Leftrightarrow\forall$ +\end_inset + + komponenta +\begin_inset Formula $G$ +\end_inset + + dvodelna +\end_layout + +\begin_layout Standard +Pot, sod cikel, hiperkocka so dvodelni, petersenov ni. +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + dvodelen +\begin_inset Formula $\Leftrightarrow G$ +\end_inset + + ne vsebuje lihega cikla. +\end_layout + +\begin_layout Standard +Biparticija glede na parnost +\begin_inset Formula $d_{G}\left(u,x_{0}\right)$ +\end_inset + +, +\begin_inset Formula $x_{0}$ +\end_inset + + fiksen. +\end_layout + +\begin_layout Standard +Dvodelen +\begin_inset Formula $k-$ +\end_inset + +regularen, +\begin_inset Formula $\left|E\right|\ge1\Rightarrow$ +\end_inset + + +\begin_inset Formula $\left|A\right|=\left|B\right|$ +\end_inset + +. + Dokaz: +\begin_inset Formula $\sum_{u\in A}\deg u=\left|E\right|=\cancel{k}\left|A\right|=\cancel{k}\left|B\right|=\sum_{u\in B}\deg u$ +\end_inset + + +\end_layout + +\begin_layout Paragraph +Krožni +\end_layout + +\begin_layout Standard +\begin_inset Formula $\Cir\left(n,\left\{ s_{1},\dots,s_{k}\right\} \right):\left|V\right|=n,$ +\end_inset + + množica preskokov +\end_layout + +\begin_layout Standard +\begin_inset Formula $\Omega\Cir\left(n,\left\{ s,n-s\right\} \right)=\gcd\left\{ n,s\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $W_{n}$ +\end_inset + + (kolo) pa je cikel z univerzalnim vozliščem. +\end_layout + +\begin_layout Paragraph +Homomorfizem +\end_layout + +\begin_layout Standard +\begin_inset Formula $\varphi:VG\to VH$ +\end_inset + + slika povezave v povezave +\end_layout + +\begin_layout Standard +Primer: +\begin_inset Formula $K_{2}$ +\end_inset + + je homomorfna slika +\begin_inset Formula $\forall$ +\end_inset + + bipartitnega grafa. +\end_layout + +\begin_layout Standard +V povezavah in vozliščih surjektiven +\begin_inset Formula $hm\varphi$ +\end_inset + + je epimorfizem. +\end_layout + +\begin_layout Standard +V vozliščih injektiven +\begin_inset Formula $hm\varphi$ +\end_inset + + je monomorfizem/vložitev. +\end_layout + +\begin_layout Standard +Vložitev, ki ohranja razdalje, je izometrična. +\end_layout + +\begin_layout Standard +Kompozitum homomorfizmov je spet homomorfizem. +\end_layout + +\begin_layout Standard +Izomorfizem je bijektivni +\begin_inset Formula $hm\varphi$ +\end_inset + + s homomorfnim inverzom. +\end_layout + +\begin_layout Standard +\begin_inset Formula $im\varphi$ +\end_inset + + +\begin_inset Formula $f:VG\to VH$ +\end_inset + + +\begin_inset Formula $\forall u,v\in VG:uv\in EG\Leftrightarrow fufv\in EH$ +\end_inset + + +\end_layout + +\begin_layout Standard +Nad množico vseh grafov +\begin_inset Formula $\mathcal{G}$ +\end_inset + + je izomorfizem ( +\begin_inset Formula $\cong$ +\end_inset + +) ekv. + rel. +\end_layout + +\begin_layout Standard +\begin_inset Formula $im\varphi$ +\end_inset + + +\begin_inset Formula $G\to G$ +\end_inset + + je avtomorfizem. +\end_layout + +\begin_layout Standard +\begin_inset Formula $\Aut G$ +\end_inset + + je grupa avtomorfizmov s komponiranjem. +\end_layout + +\begin_layout Standard +\begin_inset Formula $\Aut K_{n}=\left\{ \pi\in S_{n}=\text{permutacije }n\text{ elementov}\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\Aut P_{n}=\left\{ \text{trivialni }id,f\left(i\right)=n-i-1\right\} $ +\end_inset + +, +\begin_inset Formula $\Aut G\cong\Aut\overline{G}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Izomorfizem ohranja stopnje, št. + +\begin_inset Formula $C_{4}$ +\end_inset + +, povezanost, +\begin_inset Formula $\left|EG\right|,\dots$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G\cong\overline{G}\Rightarrow\left|VG\right|\%4\in\left\{ 0,1\right\} $ +\end_inset + + +\end_layout + +\begin_layout Paragraph +Operacije +\end_layout + +\begin_layout Standard +\begin_inset Formula $H$ +\end_inset + + vpeti podgraf +\begin_inset Formula $G\Leftrightarrow\exists F\subseteq EG\ni:H=G-F$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $H$ +\end_inset + + inducirani podgraf +\begin_inset Formula $G\Leftrightarrow\exists S\subseteq VG\ni:H=G-S$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $H$ +\end_inset + + podgraf +\begin_inset Formula $G\Leftrightarrow\exists S\subseteq VG,F\subseteq EG\ni:H=\left(G-F\right)-S$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $uv=e\in EG$ +\end_inset + +. + +\begin_inset Formula $G/e$ +\end_inset + + je skrčitev. + (identificiramo +\begin_inset Formula $u=v$ +\end_inset + +) +\end_layout + +\begin_layout Standard +\begin_inset Formula $H$ +\end_inset + + minor +\begin_inset Formula $G$ +\end_inset + +: +\begin_inset Formula $H=f_{1}...f_{k}G$ +\end_inset + + za +\begin_inset Formula $f_{i}$ +\end_inset + + skrčitev/odstranjevanje +\end_layout + +\begin_layout Standard +\begin_inset Formula $VG^{+}e\coloneqq VG\cup\left\{ x_{e}\right\} $ +\end_inset + +, +\begin_inset Formula $EG^{+}e\coloneqq EG\setminus e\cup\left\{ x_{e}u,x_{e}v\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $VG^{+}e$ +\end_inset + + je subdivizija, +\begin_inset Formula $e\in EG$ +\end_inset + +. + Na +\begin_inset Formula $e$ +\end_inset + + dodamo vozlišče. +\end_layout + +\begin_layout Standard +\begin_inset Formula $H$ +\end_inset + + subdivizija +\begin_inset Formula $G$ +\end_inset + + +\begin_inset Formula $\Leftrightarrow H=G^{+}\left\{ e_{1},\dots,e_{k}\right\} ^{+}\left\{ f_{1}\dots f_{j}\right\} ^{+}\dots$ +\end_inset + + +\end_layout + +\begin_layout Standard +Stopnja vozlišč se s subdivizijo ne poveča. +\end_layout + +\begin_layout Standard +Glajenje +\begin_inset Formula $G^{-}v$ +\end_inset + +, +\begin_inset Formula $v\in VG$ +\end_inset + + je obrat subdivizije. + +\begin_inset Formula $\deg_{G}v=2$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + in +\begin_inset Formula $H$ +\end_inset + + sta homeomorfna, če sta subdivizija istega grafa. +\end_layout + +\begin_layout Standard +Kartezični produkt: +\begin_inset Formula $V\left(G\square H\right)\coloneqq VG\times VH$ +\end_inset + +, +\begin_inset Formula $E\left(G\square H\right)\coloneqq\left\{ \left\{ \left(g,h\right),\left(g',h'\right)\right\} ;g=g'\wedge hh'\in EH\vee h=h'\wedge gg'\in EG\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\left(\mathcal{G},\square\right)$ +\end_inset + + monoid, enota +\begin_inset Formula $K_{1}$ +\end_inset + +. + +\begin_inset Formula $Q_{n}\cong Q_{n-1}\square K_{2}=Q_{n-2}\square K_{2}^{\square,2}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Disjunktna unija: +\begin_inset Formula $G$ +\end_inset + +, +\begin_inset Formula $H$ +\end_inset + + disjunktna. + +\begin_inset Formula $V\left(G\cup H\right)\coloneqq VG\cup VH$ +\end_inset + +, +\begin_inset Formula $E\left(G\cup H\right)\coloneqq EG\cup EH$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G,H$ +\end_inset + + dvodelna +\begin_inset Formula $\Rightarrow G\square H$ +\end_inset + + dvodelen +\end_layout + +\begin_layout Paragraph +\begin_inset Formula $k-$ +\end_inset + +povezan graf +\end_layout + +\begin_layout Standard +ima +\begin_inset Formula $\geq k+1$ +\end_inset + + vozlišč in ne vsebuje prerezne množice moči +\begin_inset Formula $\Omega G$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $Y\subseteq EG$ +\end_inset + + prerezna množica povezav +\begin_inset Formula $\Leftrightarrow\Omega\left(G-Y\right)>\Omega G$ +\end_inset + + +\end_layout + +\begin_layout Standard +Povezanost grafa: +\begin_inset Formula $\kappa G=\max k$ +\end_inset + +, da je +\begin_inset Formula $G$ +\end_inset + + +\begin_inset Formula $k-$ +\end_inset + +povezan. + Primeri: +\begin_inset Formula $\kappa K_{n}=n-1$ +\end_inset + +, +\begin_inset Formula $\kappa P_{n}=1$ +\end_inset + +, +\begin_inset Formula $\kappa C_{n}=2$ +\end_inset + +, +\begin_inset Formula $\kappa K_{n,m}=\min\left\{ n,m\right\} $ +\end_inset + +, +\begin_inset Formula $\kappa Q_{n}=n$ +\end_inset + +, +\begin_inset Formula $\kappa G\text{\ensuremath{\leq}}\delta G$ +\end_inset + + +\end_layout + +\begin_layout Standard +Izrek (Menger): +\begin_inset Formula $\left|VG\right|\geq k+1$ +\end_inset + +: +\begin_inset Formula $G$ +\end_inset + + +\begin_inset Formula $k-$ +\end_inset + +povezan +\begin_inset Formula $\Leftrightarrow\forall u,v\in VG,uv\not\in EG:\exists k$ +\end_inset + + notranje disjunktnih +\begin_inset Formula $u,v-$ +\end_inset + +poti +\end_layout + +\begin_layout Standard +Graf je +\begin_inset Formula $k-$ +\end_inset + +povezan po povezavah, če ne vsebuje prerezne množice povezav moči +\begin_inset Formula $\left|S\right|\Rightarrow G$ +\end_inset + + ni hamiltonov. + Primer: +\begin_inset Formula $G$ +\end_inset + + vsebuje prerezno vozlišče +\begin_inset Formula $\Rightarrow G$ +\end_inset + + ni hamiltonov. +\end_layout + +\begin_layout Standard +\begin_inset Formula $K_{n,m}$ +\end_inset + + je hamiltonov +\begin_inset Formula $\Leftrightarrow m=n$ +\end_inset + + (za +\begin_inset Formula $S$ +\end_inset + + vzamemo +\begin_inset Formula $\min\left\{ m,n\right\} $ +\end_inset + +) +\end_layout + +\begin_layout Standard +\begin_inset Formula $\left|VG\right|\geq3,\forall u,v\in VG:\deg_{G}u+\deg_{G}v\geq\left|VG\right|\Rightarrow G$ +\end_inset + + hamil. +\end_layout + +\begin_layout Standard +Dirac: +\begin_inset Formula $\left|VG\right|\geq3,\forall u\in VG:\deg_{G}u\geq\frac{\left|VG\right|}{2}\Rightarrow G$ +\end_inset + + hamilton. +\end_layout + +\begin_layout Paragraph +Ravninski +\end_layout + +\begin_layout Standard +graf brez sekanja povezav narišemo v ravnino +\end_layout + +\begin_layout Standard +\begin_inset Formula $K_{2,3}$ +\end_inset + + je ravninski, +\begin_inset Formula $K_{3,3}$ +\end_inset + +, +\begin_inset Formula $K_{5}$ +\end_inset + +, +\begin_inset Formula $C_{5}\square C_{5}$ +\end_inset + + in +\begin_inset Formula $P_{5,2}$ +\end_inset + + niso ravninski. +\end_layout + +\begin_layout Standard +Vložitev je ravninski graf z ustrezno risbo v ravnini. +\end_layout + +\begin_layout Standard +Lica so sklenjena območja vložitve brez vozlišč in povezav. +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + lahko vložimo v ravnino +\begin_inset Formula $\Leftrightarrow G$ +\end_inset + + lahko vložimo na sfero. +\end_layout + +\begin_layout Standard +Dolžina lica +\begin_inset Formula $F\sim lF$ +\end_inset + + je št. + povezav obhoda lica. +\end_layout + +\begin_layout Standard +Drevo je ravninski graf z enim licem dolžine +\begin_inset Formula $2\left|ET\right|$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\sum_{F\in FG}lF=2\left|EG\right|$ +\end_inset + +, +\begin_inset Formula $lF\geq gG$ +\end_inset + + za ravninski +\begin_inset Formula $G$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $2\left|EG\right|=\sum_{F\in FG}lF\geq\sum_{F\in FG}gG=gG\left|FG\right|$ +\end_inset + + ( +\begin_inset Formula $G$ +\end_inset + + ravn.) +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + ravninski +\begin_inset Formula $\Rightarrow\left|EG\right|\geq\frac{gG}{2}$ +\end_inset + + +\begin_inset Formula $\left|FG\right|$ +\end_inset + + +\end_layout + +\begin_layout Standard +Euler: +\begin_inset Formula $\left|VG\right|-\left|EG\right|+\left|FG\right|=1+\Omega G$ +\end_inset + + za ravninski +\begin_inset Formula $G$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + ravninski, +\begin_inset Formula $\left|VG\right|\geq3\Rightarrow\left|EG\right|\leq3\left|VG\right|-6$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + ravninski brez +\begin_inset Formula $C_{3}$ +\end_inset + +, +\begin_inset Formula $\left|VG\right|\geq3\Rightarrow\left|EG\right|\text{\ensuremath{\leq2\left|VG\right|-4}}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Triangulacija je taka vložitev, da so vsa lica omejena s +\begin_inset Formula $C_{3}$ +\end_inset + +. +\end_layout + +\begin_layout Standard +V maksimalen ravninski graf ne moremo dodati povezave, da bi ostal ravninski. + +\begin_inset Formula $\sim$ +\end_inset + + Ni pravi vpet podgraf ravn. + grafa. +\end_layout + +\begin_layout Standard +\begin_inset Formula $K_{5}-e$ +\end_inset + + je maksimalen ravninski graf +\begin_inset Formula $\forall e\in EK_{5}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + ravninski. + NTSE: +\begin_inset Formula $G$ +\end_inset + + triangulacija +\begin_inset Formula $\Leftrightarrow G$ +\end_inset + + maksimalen ravninski +\begin_inset Formula $\Leftrightarrow\left|EG\right|=3\left|VG\right|-6$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $G$ +\end_inset + + ravninski +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + vsaka subdivizija +\begin_inset Formula $G$ +\end_inset + + ravninska. +\end_layout + +\begin_layout Standard +Kuratovski: +\begin_inset Formula $G$ +\end_inset + + ravn. + +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + ne vsebuje subdivizije +\begin_inset Formula $K_{5}$ +\end_inset + + ali +\begin_inset Formula $K_{3,3}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Wagner: +\begin_inset Formula $G$ +\end_inset + + ravn. + +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + niti +\begin_inset Formula $K_{5}$ +\end_inset + + niti +\begin_inset Formula $K_{3,3}$ +\end_inset + + nista njegova minorja +\end_layout + +\begin_layout Standard +Zunanje-ravninski ima vsa vozlišča na robu zunanjega lica. +\end_layout + +\begin_layout Standard +\begin_inset Formula $2-$ +\end_inset + +povezan zunanje-ravninski je +\series bold +hamiltonov +\series default +. +\end_layout + +\begin_layout Standard +Zunanje-ravninski +\begin_inset Formula $G$ +\end_inset + +, +\begin_inset Formula $\left|VG\right|\geq2$ +\end_inset + + ima vozlišče stopnje +\begin_inset Formula $\leq2$ +\end_inset + +. +\end_layout + +\begin_layout Paragraph +Barvanje +\end_layout + +\begin_layout Standard +je taka +\begin_inset Formula $C:VG\to\left\{ 1..k\right\} \Leftrightarrow\forall uv\in EG:Cu\not=Cv$ +\end_inset + + +\end_layout + +\begin_layout Standard +Kromatično število +\begin_inset Formula $\chi G$ +\end_inset + + je najmanjši +\begin_inset Formula $k$ +\end_inset + +, +\begin_inset Formula $\ni:\exists$ +\end_inset + + +\begin_inset Formula $k-$ +\end_inset + +barvanje +\begin_inset Formula $G$ +\end_inset + + +\end_layout + +\begin_layout Standard +Primer: +\begin_inset Formula $\chi K_{n}=n$ +\end_inset + +, +\begin_inset Formula $\chi C_{n}=\begin{cases} +2 & ;n\text{ sod}\\ +3 & ;n\text{ lih} +\end{cases}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +end{multicols} +\end_layout + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git "a/\305\241ola/ds2/teorija.lyx" "b/\305\241ola/ds2/teorija.lyx" new file mode 100644 index 0000000..f442310 --- /dev/null +++ "b/\305\241ola/ds2/teorija.lyx" @@ -0,0 +1,1911 @@ +#LyX 2.3 created this file. For more info see http://www.lyx.org/ +\lyxformat 544 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\begin_preamble +\usepackage{siunitx} +\usepackage{pgfplots} +\usepackage{listings} +\usepackage{multicol} +\sisetup{output-decimal-marker = {,}, quotient-mode=fraction, output-exponent-marker=\ensuremath{\mathrm{3}}} +\end_preamble +\use_default_options true +\begin_modules +enumitem +\end_modules +\maintain_unincluded_children false +\language slovene +\language_package default +\inputencoding auto +\fontencoding global +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification false +\use_refstyle 1 +\use_minted 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 1cm +\topmargin 1cm +\rightmargin 1cm +\bottommargin 2cm +\headheight 1cm +\headsep 1cm +\footskip 1cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style german +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +newcommand +\backslash +euler{e} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +setlength{ +\backslash +columnseprule}{0.2pt} +\backslash +begin{multicols}{2} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Paragraph +Izjavni račun +\end_layout + +\begin_layout Standard +\begin_inset Formula $\forall\exists$ +\end_inset + +, +\begin_inset Formula $\neg$ +\end_inset + +, +\begin_inset Formula $\wedge\uparrow\downarrow$ +\end_inset + +, +\begin_inset Formula $\vee\oplus$ +\end_inset + +, +\begin_inset Formula $\Rightarrow$ +\end_inset + + (left to right), +\begin_inset Formula $\Leftrightarrow$ +\end_inset + + +\end_layout + +\begin_layout Standard +absorbcija: +\begin_inset Formula $a\wedge\left(b\vee a\right)\sim a,\quad a\vee\left(b\wedge a\right)\sim a$ +\end_inset + + +\end_layout + +\begin_layout Standard +kontrapozicija: +\begin_inset Formula $a\Rightarrow b\quad\sim\quad\neg a\vee b$ +\end_inset + + +\end_layout + +\begin_layout Standard +osnovna konjunkcija +\begin_inset Formula $\coloneqq$ +\end_inset + + minterm +\end_layout + +\begin_layout Standard +globina +\begin_inset Formula $\coloneqq$ +\end_inset + + +\begin_inset Formula $\begin{cases} +1 & \text{izraz nima veznikov}\\ +1+\max\left\{ A_{1}\dots A_{n}\right\} & A_{i}\text{ param. zun. vezn.} +\end{cases}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $A_{1},\dots,A_{n},B$ +\end_inset + + je pravilen sklep, če +\begin_inset Formula $\vDash\bigwedge_{k=1}^{n}A_{k}\Rightarrow B$ +\end_inset + +. + +\begin_inset Note Note +status open + +\begin_layout Plain Layout +zaključek +\begin_inset Formula $B$ +\end_inset + + drži pri vseh tistih naborih vrednostih spremenljivk, pri katerih hkrati + držijo vse predpostavke +\begin_inset Formula $A_{i}$ +\end_inset + +. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Paragraph + +\series bold +Pravila sklepanja +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + +&& A, A +\backslash +Rightarrow B & +\backslash +vDash B && +\backslash +text{ +\backslash +emph{modus ponens}} && +\backslash +text{M. + P.} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& A +\backslash +Rightarrow B, +\backslash +neg B & +\backslash +vDash +\backslash +neg A && +\backslash +text{ +\backslash +emph{modus tollens}} && +\backslash +text{M. + T.} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& A +\backslash +wedge B, +\backslash +neg B & +\backslash +vDash A && +\backslash +text{ +\backslash +emph{disjunktivni silogizem}} && +\backslash +text{D. + S.} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& A +\backslash +Rightarrow B, B +\backslash +Rightarrow C & +\backslash +vDash A +\backslash +Rightarrow C && +\backslash +text{ +\backslash +emph{hipotetični silogizem}} && +\backslash +text{H. + S} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& A, B & +\backslash +vDash A +\backslash +wedge B && +\backslash +text{ +\backslash +emph{združitev}} && +\backslash +text{Zd.} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& A +\backslash +wedge B & +\backslash +vDash A && +\backslash +text{ +\backslash +emph{poenostavitev}} && +\backslash +text{Po.} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Protiprimer +\begin_inset Formula $1,\dots,1\vDash0$ +\end_inset + + dokaže nepravilnost sklepa. +\end_layout + +\begin_layout Paragraph + +\series bold +Pomožni sklepi +\series default +: +\end_layout + +\begin_layout Itemize +Pogojni sklep (P.S.): +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +newline +\end_layout + +\end_inset + + +\begin_inset Formula $A_{1},\dots,A_{n}\vDash B\Rightarrow C\quad\sim\quad A_{1},\dots,A_{n},B\vDash C$ +\end_inset + + +\end_layout + +\begin_layout Itemize +S protislovjem (R.A. + – +\emph on +reduction ad absurdum +\emph default +): +\begin_inset Formula $A_{1},\dots,A_{n}\vDash B\quad\sim\quad A_{1},\dots,A_{n},\neg B\vDash0$ +\end_inset + + +\end_layout + +\begin_layout Itemize +Analiza primerov (A. + P.): +\begin_inset Formula $A_{1},\dots,A_{n},B_{1}\vee B_{2}\vDash C\sim\left(A_{1},\dots,A_{n},B_{1}\vDash C\right)\wedge\left(A_{1},\dots,A_{n},B_{2}\vDash C\right)$ +\end_inset + + +\end_layout + +\begin_layout Itemize +\begin_inset Formula $A_{1},\dots,A_{n},B_{1}\wedge B_{2}\vDash C\quad\sim\quad A_{1},\dots,A_{n},B_{1},B_{2}\vDash C$ +\end_inset + + +\end_layout + +\begin_layout Paragraph +Predikatni račun +\end_layout + +\begin_layout Standard +\begin_inset Formula $P:D^{n}\longrightarrow\left\{ 0,1\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +De Morganov zakon negacije: +\end_layout + +\begin_layout Itemize +\begin_inset Formula $\forall x:\neg P\left(x\right)\quad\sim\quad\neg\exists x:P\left(x\right)$ +\end_inset + + +\end_layout + +\begin_layout Itemize +\begin_inset Formula $\exists x:\neg P\left(x\right)\quad\sim\quad\neg\forall x:P\left(x\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Izjava je zaprta izjavna formula, torej taka, ki ne vsebuje prostih ( +\begin_inset Formula $=$ +\end_inset + +nevezanih) nastopov spremenljivk. +\end_layout + +\begin_layout Paragraph +Množice +\end_layout + +\begin_layout Standard +\begin_inset Formula $^{\mathcal{C}},\cap\backslash,\cup\oplus$ +\end_inset + + (left to right) +\end_layout + +\begin_layout Standard +Distributivnost: +\begin_inset Formula $\cup\cap$ +\end_inset + +, +\begin_inset Formula $\cap\cup$ +\end_inset + +, +\begin_inset Formula $\left(\mathcal{A}\oplus\mathcal{B}\right)\cap\mathcal{C}=\left(\mathcal{A\cap\mathcal{C}}\right)\oplus\left(\mathcal{B}\cap\mathcal{C}\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +Asociativnost: +\begin_inset Formula $\oplus\cup\cap$ +\end_inset + +. + Distributivnost: +\begin_inset Formula $\oplus\cup\cap$ +\end_inset + + +\end_layout + +\begin_layout Standard +Absorbcija: +\begin_inset Formula $\mathcal{A}\cup\left(\mathcal{A}\cap\mathcal{B}\right)=\mathcal{A}=A\cap\left(\mathcal{A}\cup\mathcal{B}\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}\subseteq\mathcal{B}\Leftrightarrow\mathcal{A}\cup\mathcal{B}=\mathcal{B}\Leftrightarrow\mathcal{A}\cup\mathcal{B}=\mathcal{A}\Leftrightarrow\mathcal{A}\backslash\mathcal{B}=\emptyset\Leftrightarrow\mathcal{B}^{\mathcal{C}}\subseteq\mathcal{A^{\mathcal{C}}}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}=\mathcal{B}\Longleftrightarrow\mathcal{A\oplus\mathcal{B}}=\emptyset$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}=\emptyset\wedge\mathcal{B}=\emptyset\Longleftrightarrow\mathcal{A}\cup\mathcal{B}=\emptyset$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\left(\mathcal{X}\cap\mathcal{P}\right)\cup\left(\mathcal{X^{C}}\cap\mathcal{Q}\right)=\emptyset\Longleftrightarrow\text{\ensuremath{\mathcal{Q\subseteq X}\subseteq\mathcal{P^{C}}}}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}\backslash\mathcal{B}\sim\mathcal{A}\cap\mathcal{B}^{C}$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{X}\cup\mathcal{X^{C}}=\emptyset$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{W}=\mathcal{W}\cap\mathcal{U}=\mathcal{W\cap}\left(\mathcal{X}\cup\mathcal{X^{C}}\right)=\left(\mathcal{W}\cap\mathcal{X}\right)\cup\left(\mathcal{W}\cap\mathcal{X^{C}}\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\mathcal{A}\oplus\mathcal{B}=\left(\mathcal{A}\backslash\mathcal{B}\right)\cup\left(\mathcal{B\backslash\mathcal{A}}\right)$ +\end_inset + + +\end_layout + +\begin_layout Paragraph + +\series bold +Lastnosti binarnih relacij +\end_layout + +\begin_layout Paragraph +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a +\backslash +in A : & +\backslash +left(a R a +\backslash +right) && +\backslash +text{refleksivnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b +\backslash +in A : & +\backslash +left(a R b +\backslash +Rightarrow b R a +\backslash +right)&& +\backslash +text{simetričnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b +\backslash +in A : & +\backslash +left(a R b +\backslash +wedge b R a +\backslash +Rightarrow a=b +\backslash +right) && +\backslash +text{antisimetričnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b,c +\backslash +in A : & +\backslash +left(a R b +\backslash +wedge b R c +\backslash +Rightarrow a R c +\backslash +right) && +\backslash +text{tranzitivnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a +\backslash +in A : & +\backslash +neg +\backslash +left(a R a +\backslash +right) && +\backslash +text{irefleksivnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b +\backslash +in A: & +\backslash +left(a R b +\backslash +Rightarrow +\backslash +neg +\backslash +left(b R a +\backslash +right) +\backslash +right) && +\backslash +text{asimetričnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b,c +\backslash +in A:& +\backslash +left(a R b +\backslash +wedge b R c +\backslash +Rightarrow +\backslash +neg +\backslash +left(a R c +\backslash +right) +\backslash +right) && +\backslash +text{itranzitivnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b +\backslash +in A:& +\backslash +left(a +\backslash +not=b +\backslash +Rightarrow +\backslash +left(a R b +\backslash +vee b R a +\backslash +right) +\backslash +right) && +\backslash +text{sovisnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b +\backslash +in A:& +\backslash +left(a R b +\backslash +vee b R a +\backslash +right)&& +\backslash +text{stroga sovisnost} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall a,b,c +\backslash +in A:& +\backslash +left(aRb +\backslash +wedge aRc +\backslash +Rightarrow b=c +\backslash +right)&& +\backslash +text{enoličnost} +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\end_inset + +Sklepanje s kvantifikatorji +\end_layout + +\begin_layout Standard +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +begin{align*} +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +exists x:P +\backslash +left(x +\backslash +right) +\backslash +longrightarrow& x_0 +\backslash +coloneqq x, P +\backslash +left(x +\backslash +right) && +\backslash +text{eksistenčna specifikacija} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& P +\backslash +left(x_0 +\backslash +right) +\backslash +longrightarrow& +\backslash +exists x:P +\backslash +left(x +\backslash +right)&& +\backslash +text{eksistenčna generalizacija} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +forall x:P +\backslash +left(x +\backslash +right) +\backslash +longrightarrow& x_0 +\backslash +coloneqq x, P +\backslash +left(x +\backslash +right)&& +\backslash +text{univerzalna specifikacija} +\backslash + +\backslash + +\end_layout + +\begin_layout Plain Layout + +&& +\backslash +text{poljub. + } x_0, P +\backslash +left(x_0 +\backslash +right) +\backslash +longrightarrow& +\backslash +forall x:P +\backslash +left(x +\backslash +right)&& +\backslash +text{univerzalna generalizacija} +\end_layout + +\begin_layout Plain Layout + + +\backslash +end{align*} +\end_layout + +\end_inset + + +\begin_inset Formula $R\subseteq A\times B:aR\oplus Sb\sim\left(a,b\right)\in R\backslash S\vee\left(a,b\right)\in S\backslash R\sim aRb\oplus aSb$ +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Formula $R^{-1}\coloneqq\left\{ \left(b,a\right);\left(a,b\right)\in R\right\} :\quad aRb\sim bR^{-1}a$ +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Formula $R*S\coloneqq\left\{ \left(a,c\right);\exists b:\left(aRb\wedge bSc\right)\right\} :R^{2}\coloneqq R*R,R^{n+1}\coloneqq R^{n}*R$ +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Formula $\left(R^{-1}\right)^{-1}=R,\left(R\cup S\right)^{-1}=R^{-1}\cup S^{-1},\left(R\cap S\right)^{-1}=R^{-1}\cap S^{-1}$ +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Formula $\left(R*S\right)=R^{-1}*S^{-1}$ +\end_inset + +. + +\begin_inset Formula $*\cup$ +\end_inset + + in +\begin_inset Formula $\cup*$ +\end_inset + + sta distributivni. +\end_layout + +\begin_layout Standard +\begin_inset Formula $R^{+}=R\cup R^{2}\cup R^{3}\cup\dots,\quad R^{*}=I\cup R^{+}$ +\end_inset + + +\begin_inset Newline newline +\end_inset + +Ovojnica +\begin_inset Formula $R^{L}\supseteq R$ +\end_inset + + je najmanjša razširitev +\begin_inset Formula $R$ +\end_inset + +, ki ima lastnost +\begin_inset Formula $L$ +\end_inset + +. +\end_layout + +\begin_layout Standard +\begin_inset Formula $R^{\text{ref}}\coloneqq I\cup R,R^{\text{sim}}\coloneqq R\cup R^{-1},R^{\text{tranz}}=R^{+},R^{\text{tranz+ref}}=R^{*}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Ekvivalenčna rel. + je simetrična, tranzitivna in refleksivna. +\end_layout + +\begin_layout Standard +Ekvivalenčni razred: +\begin_inset Formula $R\left[x\right]\coloneqq\left\{ y;xRy\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +Faktorska množica: +\begin_inset Formula $A/R\coloneqq\left\{ R\left[x\right];x\in A\right\} $ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\vec{\mathcal{B}}\text{ razbitje}A\Longleftrightarrow\bigcup_{i}\mathcal{B}_{i}=A\wedge\forall i\mathcal{B}_{i}\not=\emptyset\wedge\mathcal{B}_{i}\cap\mathcal{B}_{j}=\emptyset,i\not=j$ +\end_inset + + +\end_layout + +\begin_layout Paragraph +Urejenosti +\end_layout + +\begin_layout Standard +\begin_inset Formula $\left(M,\preccurlyeq\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +Delna: refl., antisim. + in tranz. + Linearna: delna, sovisna +\end_layout + +\begin_layout Standard +def.: +\begin_inset Formula $x\prec y\Longleftrightarrow x\preccurlyeq y\wedge x\not=y$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $x\text{ je nepo. predh. }y\Longleftrightarrow x\prec y\wedge\neg\exists z\in M:\left(x\prec z\wedge z\prec y\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $a\in M\text{ je minimalen}\Longleftrightarrow\forall x\in M\left(x\preccurlyeq a\Rightarrow x=a\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $a\in M\text{ je maksimalen}\Longleftrightarrow\forall x\in M\left(a\preccurlyeq x\Rightarrow x=a\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $a\in M\text{ je prvi}\Longleftrightarrow\forall x\in M:\left(a\preccurlyeq x\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $a\in M\text{ je zadnji}\Longleftrightarrow\forall x\in M:\left(x\preccurlyeq a\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $M_{1}\times M_{2}$ +\end_inset + +: +\begin_inset Formula $\left(a_{1},b_{1}\right)\preccurlyeq\left(a_{2},b_{2}\right)\coloneqq a_{1}\preccurlyeq a_{2}\wedge b_{1}\preccurlyeq b_{2}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Srečno! +\end_layout + +\begin_layout Paragraph +Funkcijska polnost +\end_layout + +\begin_layout Standard +\begin_inset Formula $T_{0},$ +\end_inset + + +\begin_inset Formula $T_{1}$ +\end_inset + +, +\begin_inset Formula $S$ +\end_inset + + – +\begin_inset Formula $f\left(\vec{x}\right)=\neg f\left(\vec{x}\oplus\vec{1}\right)$ +\end_inset + +, +\begin_inset Formula $L$ +\end_inset + +, +\begin_inset Formula $M$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $L$ +\end_inset + + – +\begin_inset Formula $f\left(\vec{x}\right)=\left[\begin{array}{ccc} +a_{0} & \dots & a_{n}\end{array}\right]^{T}\oplus\wedge\left[\begin{array}{cccc} +1 & x_{1} & \dots & x_{n}\end{array}\right]$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $M$ +\end_inset + + – +\begin_inset Formula $\forall i,j:\vec{w_{i}}<\vec{w_{j}}\Rightarrow f\left(\vec{w_{i}}\right)\leq f\left(\vec{w_{j}}\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage pagebreak +\end_inset + + +\end_layout + +\begin_layout Paragraph +Supermum in infimum +\end_layout + +\begin_layout Standard +\begin_inset Formula $\sup\left(a,b\right)$ +\end_inset + + in +\begin_inset Formula $\inf\left(a,b\right)$ +\end_inset + + v +\begin_inset Formula $\left(M,\preceq\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\sup\left(a,b\right)\coloneqq j\ni:a\preceq j\wedge b\preceq j\wedge\forall x:a\preceq x\wedge b\preceq x\Rightarrow j\preceq x$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $\inf\left(a,b\right)\coloneqq j\ni:j\preceq a\wedge j\preceq b\wedge\forall x:x\preceq a\wedge x\preceq b\Rightarrow x\preceq j$ +\end_inset + + +\end_layout + +\begin_layout Standard +Relacijska +\series bold +def. + mreže +\series default +: Delna urejenost je mreža +\begin_inset Formula $\Leftrightarrow\forall a,b\in M:\exists\sup\left(a,b\right)\wedge\exists\inf\left(a,b\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +Algebrajska +\series bold +def. + mreže +\series default +: +\begin_inset Formula $\left(M,\wedge,\vee\right)$ +\end_inset + + je mreža, če veljata idempotentnosti +\begin_inset Formula $a\vee a=a\wedge a=a$ +\end_inset + +, komutativnosti, asociativnosti in absorpciji. +\end_layout + +\begin_layout Standard +Mreža je +\series bold +omejena +\series default + +\begin_inset Formula $\Leftrightarrow\exists0,1\in M\ni:\forall x\in M:0\preceq x\preceq1$ +\end_inset + + +\end_layout + +\begin_layout Standard +Mreža je +\series bold +komplementarna +\series default + +\begin_inset Formula $\Leftrightarrow\forall a\in M\exists a^{-1}\in M\ni:a\wedge a^{-1}\sim0\text{ in }a\vee a^{-1}\sim1$ +\end_inset + + +\end_layout + +\begin_layout Standard +V +\series bold +distributivni mreži +\series default + veljata obe distributivnosti. +\end_layout + +\begin_layout Standard +\begin_inset Formula $\sup\left(a,b\right)\sim a\wedge b,\quad\inf\left(a,b\right)\sim a\vee b$ +\end_inset + + +\end_layout + +\begin_layout Standard +V delni urejenosti velja: +\begin_inset Formula $a\preceq b\Leftrightarrow a=\inf\left(a,b\right)\Leftrightarrow b=\sup\left(a,b\right)$ +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Formula $M_{5},N_{5}$ +\end_inset + + nista distributivni. +\end_layout + +\begin_layout Standard + +\series bold +\begin_inset Formula $\left(N,\wedge,\vee\right)$ +\end_inset + + +\series default +je +\series bold + podmreža +\series default + +\begin_inset Formula $\left(M,\wedge,\vee\right)\Leftrightarrow\emptyset\not=N\subseteq M,\forall a,b\in N:a\vee b\in N\text{ in }a\wedge b\in N$ +\end_inset + + +\end_layout + +\begin_layout Standard + +\series bold +Boolova algebra +\series default + je komplementarna distributivna mreža. + Tedaj ima vsak element natanko en komplement in velja dualnost ter De Morganova + zakona. +\end_layout + +\begin_layout Paragraph +Funkcije +\end_layout + +\begin_layout Standard +Funkcija +\begin_inset Formula $f$ +\end_inset + + je preslikava, če je +\begin_inset Formula $D_{f}$ +\end_inset + + domena. +\end_layout + +\begin_layout Itemize +\begin_inset Formula $f,g\text{ injekciji }\Rightarrow g\circ f\text{ injekcija}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +\begin_inset Formula $f,g\text{ surjekciji }\Rightarrow g\circ f\text{ surjekcija}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +\begin_inset Formula $g\circ f\text{ injekcija }\Rightarrow f\text{ injekcija}$ +\end_inset + + +\end_layout + +\begin_layout Itemize +\begin_inset Formula $g\circ f\text{ surjekcija }\Rightarrow g\text{ surjekcija}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Slika množice +\begin_inset Formula $A_{1}\subseteq A$ +\end_inset + +: +\begin_inset Formula $f\left(A_{1}\right)\coloneqq\left\{ y\in B;\exists x\in A_{1}\ni:f\left(x\right)=y\right\} $ +\end_inset + +. + Praslika +\begin_inset Formula $B_{1}\subseteq B$ +\end_inset + +: +\begin_inset Formula $f^{-1}\left(B_{1}\right)=\left\{ x\in A:\exists y\in B_{1}\ni:f\left(x\right)=y\right\} $ +\end_inset + +. +\end_layout + +\begin_layout Paragraph +Permutacije +\end_layout + +\begin_layout Standard +\begin_inset Formula $\pi=\pi^{-1}\Leftrightarrow\pi$ +\end_inset + + je konvolucija. +\end_layout + +\begin_layout Standard +V disjunktnih ciklih velja: +\begin_inset Formula $C_{1}C_{2}=C_{2}C_{1}$ +\end_inset + +. +\end_layout + +\begin_layout Standard +V ciklih velja: +\begin_inset Formula $C_{2}^{-1}C_{1}^{-1}=\left(C_{1}C_{2}\right)^{-1}$ +\end_inset + + +\end_layout + +\begin_layout Standard +Razcep na disjunktne cikle je enoličen. +\end_layout + +\begin_layout Standard +Neenolično razbitje cikla dolžine +\begin_inset Formula $n$ +\end_inset + + na produkt +\begin_inset Formula $n-1$ +\end_inset + + transpozicij: +\begin_inset Formula $\left(a_{1}a_{2}a_{3}a_{4}a_{5}\right)=\left(a_{1}a_{2}\right)\left(a_{1}a_{3}\right)\left(a_{1}a_{4}\right)\left(a_{1}a_{5}\right)$ +\end_inset + +. + Parnost števila transpozicij je enolična. + +\begin_inset ERT +status open + +\begin_layout Plain Layout + + +\backslash +newcommand +\backslash +red{ +\backslash +text{red}} +\backslash +newcommand +\backslash +sgn{ +\backslash +text{sgn}} +\backslash +newcommand +\backslash +lcm{ +\backslash +text{lcm}} +\end_layout + +\end_inset + + +\begin_inset Formula $\sgn\pi=\sgn\pi^{-1}$ +\end_inset + +. +\end_layout + +\begin_layout Standard +\begin_inset Formula $\red\pi$ +\end_inset + + je najmanjše +\begin_inset Formula $k\ni:\pi^{k}=id$ +\end_inset + + +\end_layout + +\begin_layout Standard +Za cikel +\begin_inset Formula $C$ +\end_inset + + dolžine +\begin_inset Formula $n$ +\end_inset + + velja: +\begin_inset Formula $C^{n}=id$ +\end_inset + + — +\begin_inset Formula $\red C=n$ +\end_inset + + +\end_layout + +\begin_layout Standard +Red produkta disjunktnih ciklov dolžin +\begin_inset Formula $\vec{n}$ +\end_inset + + je +\begin_inset Formula $\lcm\left(\vec{n}\right)$ +\end_inset + +. +\end_layout + +\begin_layout Paragraph +Moči končnih množic +\end_layout + +\begin_layout Standard +\begin_inset Formula $\left|A\times B\right|=\left|A\right|\left|B\right|$ +\end_inset + +, +\begin_inset Formula $\left|\mathcal{P}\left(A\right)\right|=2^{\left|A\right|}$ +\end_inset + +, +\begin_inset Formula $\left|B^{A}\right|=\left|B\right|^{\left|A\right|}$ +\end_inset + +, +\begin_inset Formula $\left|B\backslash A\right|=\left|B\right|-\left|A\cap B\right|$ +\end_inset + + +\end_layout + +\begin_layout Standard +Princip vključitve in izključitve: +\begin_inset Formula $\left|A_{1}\cup A_{2}\cup\cdots\cup A_{n}\right|=\sum_{i=1}^{n}\left(-1\right)^{i+1}S_{i}$ +\end_inset + +, kjer +\begin_inset Formula $S_{k}\coloneqq\sum_{I\subseteq\left\{ 1,\dots,n\right\} ,\left|I\right|=k}\bigcap_{i\in I}A_{i}$ +\end_inset + + +\end_layout + +\begin_layout Paragraph +Neskončne množice +\end_layout + +\begin_layout Standard +\begin_inset Formula $A$ +\end_inset + + in +\begin_inset Formula $B$ +\end_inset + + sta enakomočni: +\begin_inset Formula $A\sim B\Leftrightarrow\exists\text{bijekcija }f:A\to B$ +\end_inset + +. + +\begin_inset Formula $\sim$ +\end_inset + + je ekvivalenčna relacija. +\end_layout + +\begin_layout Standard +Ekvivalenčni razredi: +\begin_inset Formula $0,1,2,\dots,\aleph_{0},c$ +\end_inset + +. +\end_layout + +\begin_layout Standard +\begin_inset Formula $A$ +\end_inset + + je neskončna +\begin_inset Formula $\Leftrightarrow\exists B\subset A\ni:A\sim B$ +\end_inset + +, drugače je končna. +\end_layout + +\begin_layout Standard +\begin_inset Formula $A$ +\end_inset + + ima manjšo ali enako moč kot +\begin_inset Formula $B$ +\end_inset + + zapišemo: +\begin_inset Formula $A\leq B\Leftrightarrow\exists\text{injekcija }f:A\to B$ +\end_inset + +. + Označimo +\begin_inset Formula $A +#include +#include +#include +#include "naloga1.h" +char * zdruzi (char ** nizi, char * locilo) { + int ll = strlen(locilo); + int len = 1-ll; + char ** n = nizi; + while (*n) + len += strlen(*n++)+ll; + char * r = malloc(sizeof *r * (len+1)); + char * rorig = r; + while (*nizi) { + strcpy(r, *nizi); + r += strlen(*nizi); + nizi++; + if (*nizi) { + strcpy(r, locilo); + r += ll; + } + } + return rorig; +} +#ifndef test +int main () { + return 0; +} +#endif diff --git "a/\305\241ola/p2/dn/dn06-naloga2.c" "b/\305\241ola/p2/dn/dn06-naloga2.c" new file mode 100644 index 0000000..021930c --- /dev/null +++ "b/\305\241ola/p2/dn/dn06-naloga2.c" @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include "naloga2.h" +int ** ap2pp (int (*kazalec)[N], int izvornoStVrstic, int ciljnoStVrstic) { + int * ka = (int *) kazalec; + int ** r = malloc(ciljnoStVrstic*sizeof *r); + int outstolpcev = izvornoStVrstic*N/ciljnoStVrstic; + for (int i = 0; i < izvornoStVrstic*N; i++) { + int j = i/outstolpcev; + int k = i%outstolpcev; + if (!k) { + r[j] = malloc((outstolpcev+1)*sizeof *(r[j])); + r[j][outstolpcev] = 0; + } + r[j][k] = ka[i]; + } + return r; +} +int (*pp2ap(int ** kazalec, int izvornoStVrstic, int * ciljnoStVrstic))[N] { + int * r = NULL; + int rlen = 0; + for (int i = 0; i < izvornoStVrstic; i++) + for (int j = 0; kazalec[i][j]; j++) { + r = realloc(r, ++rlen*sizeof *r); + r[rlen-1] = kazalec[i][j]; + } + if (rlen % N != 0) { + r = realloc(r, (rlen/N+1)*N * sizeof *r); + while (rlen % N) + r[rlen++] = 0; + } + *ciljnoStVrstic = rlen/N; + return (int (*)[N]) r; +} +#ifndef test +int main () { + return 0; +} +#endif diff --git "a/\305\241ola/p2/dn/naloga.c" "b/\305\241ola/p2/dn/naloga.c" new file mode 100644 index 0000000..70e5cd6 --- /dev/null +++ "b/\305\241ola/p2/dn/naloga.c" @@ -0,0 +1,30 @@ +int steviloZnakov (char * niz, char znak) { + int r = 0; + while (*niz) { + if (*niz++ == znak) + r++; + return r; +} +#include +char * kopirajDoZnaka (char * niz, char znak) { + strchr(niz, znak)[0] = '\0'; + char * r = strdup(niz); + niz[strlen(niz)][0] = znak; + return r; +} +char ** razcleni (char * besedilo, char locilo, int * stOdsekov) { + char * p = besedilo; + char ** r = NULL; + *stOdsekov = 0; + while (1) { + if (*p == locilo || !*p) { + *p = '\0'; + r = realloc(r, ++*stOdsekov*sizeof *r); + r[*stOdsekov-1] = strdup(besedilo); + besedilo = p+1; + if (!*p) + return r; + } + p++; + } +} -- cgit v1.2.3