Skip to content

Commit 5fa6e9a

Browse files
TeenBiscuitsFerLS
andcommitted
fix: code examples
Co-Authored-By: Fernando Álvarez <114153352+FerLS@users.noreply.github.com>
1 parent ad9eb4e commit 5fa6e9a

File tree

3 files changed

+165
-19
lines changed

3 files changed

+165
-19
lines changed

src/content/docs/prodos/apuntes/T4-T5-Colas-y-Pilas.mdx

Lines changed: 90 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ createEmptyQueue \rightarrow Queue
7474
<summary>Mostrar implementación</summary>
7575

7676
```c title="createEmptyQueue.c"
77-
// Ver archivo: ./Ejemplos/Tema_4/createEmptyQueue.c
77+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
78+
//
79+
// SPDX-License-Identifier: GPL-3.0-only
80+
81+
void createEmptyQueue(tQueue *cola){
82+
83+
cola->front = QNULL;
84+
cola->rear = QNULL;
85+
86+
}
7887
```
7988
</details>
8089
@@ -94,7 +103,36 @@ enqueue (Item, Queue) \rightarrow Queue, bool
94103
<summary>Mostrar implementación</summary>
95104

96105
```c title="enqueue.c"
97-
// Ver archivo: ./Ejemplos/Tema_4/enqueue.c
106+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
107+
//
108+
// SPDX-License-Identifier: GPL-3.0-only
109+
110+
bool enqueue(tItemQ item,tQueue *cola){
111+
112+
tPosQ aux;
113+
114+
if(!createNode(&aux)){
115+
116+
return false;
117+
}
118+
else{
119+
120+
aux->data=item;
121+
aux->next=QNULL;
122+
123+
if(cola->front == QNULL){
124+
cola->front = aux;
125+
126+
}
127+
else{
128+
cola->rear->next = aux;
129+
}
130+
cola->rear = aux;
131+
132+
return true;
133+
}
134+
135+
}
98136
```
99137
</details>
100138
@@ -115,7 +153,22 @@ dequeue(Queue) \rightarrow Queue
115153
<summary>Mostrar implementación</summary>
116154

117155
```c title="dequeue.c"
118-
// Ver archivo: ./Ejemplos/Tema_4/dequeue.c
156+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
157+
//
158+
// SPDX-License-Identifier: GPL-3.0-only
159+
160+
void dequeue(tQueue *cola){
161+
162+
tPosQ aux;
163+
aux = cola->front;
164+
cola->front = aux->next;
165+
if(cola->front == QNULL){
166+
167+
cola->rear = QNULL;
168+
}
169+
free(aux);
170+
171+
}
119172
```
120173
</details>
121174
@@ -136,7 +189,14 @@ front(Queue) \rightarrow Item
136189
<summary>Mostrar implementación</summary>
137190

138191
```c title="front.c"
139-
// Ver archivo: ./Ejemplos/Tema_4/front.c
192+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
193+
//
194+
// SPDX-License-Identifier: GPL-3.0-only
195+
196+
tItemQ front(tQueue cola){
197+
198+
return cola.front->data;
199+
}
140200
```
141201
</details>
142202
@@ -154,7 +214,15 @@ isEmptyQueue(Queue) \rightarrow bool
154214
<summary>Mostrar implementación</summary>
155215

156216
```c title="isEmptyQueue.c"
157-
// Ver archivo: ./Ejemplos/Tema_4/isEmptyQueue.c
217+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
218+
//
219+
// SPDX-License-Identifier: GPL-3.0-only
220+
221+
bool isEmptyQueue(tQueue cola){
222+
223+
return(cola.front == QNULL);
224+
225+
}
158226
```
159227
</details>
160228
@@ -241,7 +309,8 @@ createEmptyStack \rightarrow Stack
241309
<summary>Mostrar implementación</summary>
242310

243311
```c title="createEmptyStack.c"
244-
// Ver archivo: ./Ejemplos/Tema_5/createEmptyStack.c
312+
// EN CONSTRUCCIÓN
313+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
245314
```
246315
</details>
247316

@@ -261,7 +330,8 @@ push (Item, Stack) \rightarrow Stack, bool
261330
<summary>Mostrar implementación</summary>
262331

263332
```c title="push.c"
264-
// Ver archivo: ./Ejemplos/Tema_5/push.c
333+
// EN CONSTRUCCIÓN
334+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
265335
```
266336
</details>
267337

@@ -282,7 +352,8 @@ pop(Stack) \rightarrow Stack
282352
<summary>Mostrar implementación</summary>
283353

284354
```c title="pop.c"
285-
// Ver archivo: ./Ejemplos/Tema_5/pop.c
355+
// EN CONSTRUCCIÓN
356+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
286357
```
287358
</details>
288359

@@ -303,7 +374,8 @@ peek(Stack) \rightarrow Item
303374
<summary>Mostrar implementación</summary>
304375

305376
```c title="peek.c"
306-
// Ver archivo: ./Ejemplos/Tema_5/peek.c
377+
// EN CONSTRUCCIÓN
378+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
307379
```
308380
</details>
309381

@@ -321,7 +393,8 @@ isEmptyStack(Stack) \rightarrow bool
321393
<summary>Mostrar implementación</summary>
322394

323395
```c title="isEmptyStack.c"
324-
// Ver archivo: ./Ejemplos/Tema_5/isEmptyStack.c
396+
// EN CONSTRUCCIÓN
397+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
325398
```
326399
</details>
327400

@@ -369,6 +442,13 @@ flowchart TB
369442

370443
<ShowcaseProfile
371444
entries={[
445+
{
446+
name: 'Fernando Álvarez',
447+
picture: 'https://avatars.githubusercontent.com/u/114153352?v=4',
448+
href: 'https://github.com/FerLS',
449+
description:
450+
"Código - © 2023",
451+
},
372452
{
373453
name: 'Pablo Portas López',
374454
picture: 'https://avatars.githubusercontent.com/u/81629707?v=4',

src/content/docs/prodos/apuntes/T6-Arboles.mdx

Lines changed: 69 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,15 @@ flowchart LR
114114
<summary>Mostrar implementación</summary>
115115

116116
```c title="createEmptyTree.c"
117-
// Ver archivo: ./Ejemplos/Tema_6/createEmptyTree.c
117+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
118+
//
119+
// SPDX-License-Identifier: GPL-3.0-only
120+
121+
void createEmptyTree(tBinTree *T){
122+
123+
*T = TNULL;
124+
125+
}
118126
```
119127
</details>
120128
@@ -162,7 +170,23 @@ flowchart TB
162170
<summary>Mostrar implementación</summary>
163171

164172
```c title="buildTree.c"
165-
// Ver archivo: ./Ejemplos/Tema_6/buildTree.c
173+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
174+
//
175+
// SPDX-License-Identifier: GPL-3.0-only
176+
177+
bool BuildTree(tBinTree LT,tItemT itemT,tBinTree RT,tBinTree *T){
178+
179+
if(createNode(T)){
180+
181+
(*T)->data=itemT;
182+
(*T)->left=LT;
183+
(*T)->right=RT;
184+
return true;
185+
}
186+
else return false;
187+
188+
189+
}
166190
```
167191
</details>
168192
@@ -191,7 +215,15 @@ flowchart TB
191215
<summary>Mostrar implementación</summary>
192216

193217
```c title="leftChild.c"
194-
// Ver archivo: ./Ejemplos/Tema_6/leftChild.c
218+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
219+
//
220+
// SPDX-License-Identifier: GPL-3.0-only
221+
222+
tBinTree LeftChild(tBinTree T){
223+
224+
return T->left;
225+
226+
}
195227
```
196228
</details>
197229
@@ -218,7 +250,15 @@ flowchart TB
218250
<summary>Mostrar implementación</summary>
219251

220252
```c title="rightChild.c"
221-
// Ver archivo: ./Ejemplos/Tema_6/rightChild.c
253+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
254+
//
255+
// SPDX-License-Identifier: GPL-3.0-only
256+
257+
tBinTree RightChild(tBinTree T){
258+
259+
return T->right
260+
261+
}
222262
```
223263
</details>
224264
@@ -246,7 +286,15 @@ flowchart TB
246286
<summary>Mostrar implementación</summary>
247287

248288
```c title="root.c"
249-
// Ver archivo: ./Ejemplos/Tema_6/root.c
289+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
290+
//
291+
// SPDX-License-Identifier: GPL-3.0-only
292+
293+
tItemT Root(tBinTree T){
294+
295+
return T->data;
296+
297+
}
250298
```
251299
</details>
252300
@@ -274,7 +322,15 @@ flowchart TB
274322
<summary>Mostrar implementación</summary>
275323

276324
```c title="isEmptyTree.c"
277-
// Ver archivo: ./Ejemplos/Tema_6/isEmptyTree.c
325+
// SPDX-FileCopyrightText: 2023 Fernando Álvarez
326+
//
327+
// SPDX-License-Identifier: GPL-3.0-only
328+
329+
bool isEmptyTree(tBinTree T){
330+
331+
return (T==TNULL);
332+
333+
}
278334
```
279335
</details>
280336
@@ -402,6 +458,13 @@ flowchart TB
402458

403459
<ShowcaseProfile
404460
entries={[
461+
{
462+
name: 'Fernando Álvarez',
463+
picture: 'https://avatars.githubusercontent.com/u/114153352?v=4',
464+
href: 'https://github.com/FerLS',
465+
description:
466+
"Código - © 2023",
467+
},
405468
{
406469
name: 'Pablo Portas López',
407470
picture: 'https://avatars.githubusercontent.com/u/81629707?v=4',

src/content/docs/prodos/apuntes/T7-T8-Arboles-Binarios-de-Busqueda.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ flowchart TB
109109
<summary>Mostrar implementación</summary>
110110

111111
```c title="insertKey.c"
112-
// Ver archivo: ./Ejemplos/Tema_7/insertKey.c
112+
// EN CONSTRUCCIÓN
113+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
113114
```
114115
</details>
115116

@@ -166,7 +167,8 @@ flowchart TB
166167
<summary>Mostrar implementación</summary>
167168

168169
```c title="findKey.c"
169-
// Ver archivo: ./Ejemplos/Tema_7/findKey.c
170+
// EN CONSTRUCCIÓN
171+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
170172
```
171173
</details>
172174

@@ -243,7 +245,8 @@ flowchart TB
243245
<summary>Mostrar implementación</summary>
244246

245247
```c title="removeKey.c"
246-
// Ver archivo: ./Ejemplos/Tema_7/removeKey.c
248+
// EN CONSTRUCCIÓN
249+
// COLABORA https://github.com/TeenBiscuits/Pasame-Codigo
247250
```
248251
</details>
249252

0 commit comments

Comments
 (0)