Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/feed-rss2.php on line 8
‘#mastery21’ Articles at Courses by Ken https://kenscourses.com/tc101winter2015 Facilitator of Learning Experiences Thu, 07 May 2015 05:42:06 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ #TC1014 #Mastery21 #Mastery22 https://kenscourses.com/tc101winter2015/2015/tc1014-mastery21-mastery22/ Thu, 07 May 2015 05:42:06 +0000 https://programminglearning.withknown.com/2015/tc1014-mastery21-mastery22

https://youtu.be/Gyr37CdLisU

1014 21 22

 

Continue reading ]]>

https://youtu.be/Gyr37CdLisU

1014 21 22

 

]]>
https://creativecommons.org/licenses/by/4.0/
Recursion https://kenscourses.com/tc101winter2015/2015/recursion/ Thu, 07 May 2015 04:48:00 +0000 https://jebg96.withknown.com/2015/recursion

21 1017

 

Aqui esta una explicacion de como funciona la recursion 

link: https://www.youtube.com/watch?v=jlTP2iU-NiE

Continue reading ]]>

21 1017

 

Aqui esta una explicacion de como funciona la recursion 

link: https://www.youtube.com/watch?v=jlTP2iU-NiE

]]>
https://creativecommons.org/licenses/by/4.0/
#Mastery21 https://kenscourses.com/tc101winter2015/2015/mastery21-11/ Thu, 07 May 2015 03:34:27 +0000 https://jcblog.withknown.com/2015/mastery21

I just made the 21 that was the use of recursion on repetitive algorithms it was a fun to show how they work here is the link of the video: http://youtu.be/QREKZUGVxxk?hd=1

Continue reading ]]>

I just made the 21 that was the use of recursion on repetitive algorithms it was a fun to show how they work here is the link of the video: http://youtu.be/QREKZUGVxxk?hd=1

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery21:: Use of recursion for repetitive algorithms https://kenscourses.com/tc101winter2015/2015/mastery21-use-of-recursion-for-repetitive-algorithms-5/ Thu, 07 May 2015 03:29:27 +0000 https://carolinarmtz.withknown.com/2015/mastery21-use-of-recursion-for-repetitive-algorithms

Una función es recursiva cuando se define en función de si misma, pero no todas la funciones pueden llamarse a si mismas. Deben estar diseñadas especialmente para que sean recursivas, de otro modo podrían conducir a bucles infinitos, o a que el programa termine inadecuadamente.

C++ permite la recursividad. Cada vez que se llama a una función, se crea un juego de variables locales, de este modo, si la función hace una llamada a si misma, se guardan sus variables y parámetros, usando la pila, y la nueva instancia de la función trabajará con su propia copia de las variables locales. Cuando esta segunda instancia de la función retorna, recupera las variables y los parámetros de la pila y continua la ejecución en el punto en que había sido llamada.

La mejor manera de explicar lo que es la recursividad en c++ es con la practica de la WSQ12....

1017

21

Continue reading ]]>

Una función es recursiva cuando se define en función de si misma, pero no todas la funciones pueden llamarse a si mismas. Deben estar diseñadas especialmente para que sean recursivas, de otro modo podrían conducir a bucles infinitos, o a que el programa termine inadecuadamente.

C++ permite la recursividad. Cada vez que se llama a una función, se crea un juego de variables locales, de este modo, si la función hace una llamada a si misma, se guardan sus variables y parámetros, usando la pila, y la nueva instancia de la función trabajará con su propia copia de las variables locales. Cuando esta segunda instancia de la función retorna, recupera las variables y los parámetros de la pila y continua la ejecución en el punto en que había sido llamada.

La mejor manera de explicar lo que es la recursividad en c++ es con la practica de la WSQ12….

1017

21

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery21 https://kenscourses.com/tc101winter2015/2015/mastery21-13/ Thu, 07 May 2015 03:18:00 +0000 http://kenscourses.com/tc101winter2015/?guid=ad199278c774b5311865d0d4ac5ace5e Continue reading ]]> Mastery21
here is the video http://youtu.be/1NxCAOQzkzM

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery21 https://kenscourses.com/tc101winter2015/2015/mastery21-12/ Thu, 07 May 2015 03:18:00 +0000 http://kenscourses.com/tc101winter2015/?guid=ad199278c774b5311865d0d4ac5ace5e Continue reading ]]> Mastery21
here is the video http://youtu.be/1NxCAOQzkzM

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery21 https://kenscourses.com/tc101winter2015/2015/mastery21-10/ Thu, 07 May 2015 03:18:00 +0000 http://kenscourses.com/tc101winter2015/?guid=ad199278c774b5311865d0d4ac5ace5e Continue reading ]]> Mastery21
here is the video http://youtu.be/1NxCAOQzkzM

]]>
https://creativecommons.org/licenses/by/4.0/
#mastery21 #TC1017 https://kenscourses.com/tc101winter2015/2015/mastery21-tc1017-3/ Thu, 07 May 2015 02:59:49 +0000 https://mitzihernandez.withknown.com/2015/mastery21-tc1017

21 1017

 

Use of recursion for repetitive algorithms

What is recursion? The simple answer is, it’s when a function calls itself. But how does this happen? Why would this happen, and what are its uses?


When we talk about recursion, we are really talking about creating a loop.
Let’s start by looking at a basic loop.

#a0a0a0; mso-fareast-language: ES-MX;">1
2
3

#C0C0D0 1.0pt; mso-border-alt: solid 0C0D0 .75pt; background: #EFEFFF; padding: .75pt .75pt .75pt .75pt;" valign="top">

for(int i=0;  i

     cout "The number is: "

}

 



For those who don’t yet know, this basic loop displays the sentence, "The number is: " followed by the value of ‘i’.
Like this.

#E7E7E7; padding: .75pt .75pt .75pt .75pt;" valign="top">

 

The number is: 0

The number is: 1

The number is: 2

The number is: 3

The number is: 4

The number is: 5

The number is: 6

The number is: 7

The number is: 8

The number is: 9


Inside the ‘for loop’ declaration we have the integer variable ‘i’ and have its starting value of 0. So the first time the sentence is displayed it reads, "The number is: 0". The part of the ‘for loop’ declaration that is ‘i++’ tells the program that each time the loop repeats, the value of ‘i’ should be increased by 1. So, the next time the sentence is displayed it reads, "The number is: 1".
This cycle will continue to repeat for as long as the value of ‘i’ is less than 10. The last sentence displayed would read, "The number is: 9". As you can see the basic ‘for loop’ has three parts to its declaration, a starting value, what must remain true in order to continue repeating, and a modifying expression. Everything that is contained within the {braces} is what the program performs. Cout stands for console out, and prints words or characters to the screen.
So what does this have to do with recursion? Remember recursion is a loop. What if I did not want to just print a message to the screen? A loop can be used to perform other tasks as well.

In the following code is the same loop as above only now it is being used to call a function.

#a0a0a0; mso-fareast-language: ES-MX;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

#C0C0D0 1.0pt; mso-border-alt: solid 0C0D0 .75pt; background: #EFEFFF; padding: .75pt .75pt .75pt .75pt;" valign="top">

using namespace std;

 

void numberFunction(int i) {

  cout "The number is: "

}

 

int main() {

 

for(int i=0; i

  numberFunction(i);

}

 

return 0;

}

Edit & Run



I have declared a void function, which means it returns nothing, and takes a parameter of ‘int i’. The function is named ‘numberFunction’ and as you can see, all it does is display the sentence, "The number is: " followed by the current value of ‘i’. The function is called into use by the ‘for loop’, which continually calls the function as long as the value of ‘i’ is less than 10.

Now with recursion, we won’t need to use a ‘for loop’ because we will set it up so that our function calls itself. Let’s recreate this same program one more time, only this time we will do it without a ‘for loop’.
We will use a recursion loop instead, like this.

#a0a0a0; mso-fareast-language: ES-MX;">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#C0C0D0 1.0pt; mso-border-alt: solid 0C0D0 .75pt; background: #EFEFFF; padding: .75pt .75pt .75pt .75pt;" valign="top">

using namespace std;

 

void numberFunction(int i) {

  cout "The number is: "

  i++;

  if(i

    numberFunction(i);

  }

}

 

int main() {

 

int i = 0;

numberFunction(i);

 

return 0;

}

Edit & Run

 



We did it! We used recursion! You can see the call to ‘numberFunction’ is made only once in the main part of the program but it keeps getting called again and again from within the function itself, for as long as ‘i’ is less than 10.

Continue reading ]]>

21 1017

 

Use of recursion for repetitive algorithms

What is recursion? The simple answer is, it’s when a function calls itself. But how does this happen? Why would this happen, and what are its uses?


When we talk about recursion, we are really talking about creating a loop.
Let’s start by looking at a basic loop.

 

For those who don’t yet know, this basic loop displays the sentence, “The number is: ” followed by the value of ‘i’. Like this.


Inside the ‘for loop’ declaration we have the integer variable ‘i’ and have its starting value of 0. So the first time the sentence is displayed it reads, “The number is: 0”. The part of the ‘for loop’ declaration that is ‘i++’ tells the program that each time the loop repeats, the value of ‘i’ should be increased by 1. So, the next time the sentence is displayed it reads, “The number is: 1”.
This cycle will continue to repeat for as long as the value of ‘i’ is less than 10. The last sentence displayed would read, “The number is: 9”. As you can see the basic ‘for loop’ has three parts to its declaration, a starting value, what must remain true in order to continue repeating, and a modifying expression. Everything that is contained within the {braces} is what the program performs. Cout stands for console out, and prints words or characters to the screen.
So what does this have to do with recursion? Remember recursion is a loop. What if I did not want to just print a message to the screen? A loop can be used to perform other tasks as well.

In the following code is the same loop as above only now it is being used to call a function.

Edit & Run

I have declared a void function, which means it returns nothing, and takes a parameter of ‘int i’. The function is named ‘numberFunction’ and as you can see, all it does is display the sentence, “The number is: ” followed by the current value of ‘i’. The function is called into use by the ‘for loop’, which continually calls the function as long as the value of ‘i’ is less than 10.

Now with recursion, we won’t need to use a ‘for loop’ because we will set it up so that our function calls itself. Let’s recreate this same program one more time, only this time we will do it without a ‘for loop’. We will use a recursion loop instead, like this.

Edit & Run

 

We did it! We used recursion! You can see the call to ‘numberFunction’ is made only once in the main part of the program but it keeps getting called again and again from within the function itself, for as long as ‘i’ is less than 10.

]]>
https://creativecommons.org/licenses/by/4.0/
#Mastery21 #TC1017 https://www.youtube.com/watch?v=0mzXdyC5usk https://kenscourses.com/tc101winter2015/2015/mastery21-tc1017-httpswww-youtube-comwatchv0mzxdyc5usk/ Thu, 07 May 2015 01:35:46 +0000 https://auralgo.withknown.com/2015/mastery21-tc1017-watchv0mzxdyc5usk Continue reading ]]>

21 1017 https://www.youtube.com/watch?v=0mzXdyC5usk

]]>
https://creativecommons.org/licenses/by/4.0/
#Mastery21 https://kenscourses.com/tc101winter2015/2015/mastery21-9/ Thu, 07 May 2015 00:23:20 +0000 https://monse31.withknown.com/2015/mastery21 Continue reading ]]>

This is my Mastery 21

https://www.dropbox.com/s/5xlw03isk4dpk4p/mastery21.mp4?dl=0

1017 21

]]>
https://creativecommons.org/licenses/by/4.0/