-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecursion.html
More file actions
54 lines (52 loc) · 3.23 KB
/
recursion.html
File metadata and controls
54 lines (52 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Portfolio</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav>
<div class = "logo">
<a href="#"><img src="Assets\logo.jpg" alt="Assets\logo.png" style="width:30px;height:30px;margin-left:15px;margin-top:5px;margin-right: 0px;"></a>
</div>
<p style="margin-left: 60px;position: absolute; color: white">Glen Lin ICS4UO Portfolio</p>
<ul>
<li><button onclick="window.location.href='index.html'">Home</button></li>
<li><button onclick="window.location.href='about-me.html'">About</button></li>
<li><button onclick="window.location.href='projects.html'">Projects</button></li>
<li style="color: white;">
<div class="dropdown">
<button class="dropbtn">Tutorials
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a onclick="window.location.href='OOP.html'">OOP</a>
<a onclick="window.location.href='array.html'">Array and Arraylists</a>
<a onclick="window.location.href='sorting.html'">Sorting and Searching</a>
<a onclick="window.location.href='recursion.html'">Recursion</a>
</div>
</div>
</li>
</ul>
</nav>
</header>
<main>
<img src="Assets\summer.jpg" alt="background-image.png" style="width:100%;height: 300px;overflow: hidden;filter: brightness(30%);overflow: hidden;">
<div class="centeredabout">Recurison</div>
<h1 style = "margin-top: 100px; margin-left: 100px; margin-bottom: 30px;">What is it?</h2>
<p style = "margin-left: 100px; margin-right: 100px; margin-bottom: 15px;">Recursion is when you call the method inside of the same method. For example, if you have a multiplying array, you can call the multiply method again inside of it. In order to determine which iteration of the method is being run, you can think of the list of methods as a stack. When a method is called, that instance is added to the top of the stack. The program runs whatever method is at the top of the stack. In order to perform recursion, 2 things are needed:</p>
<p style = "margin-left: 100px; margin-right: 100px; margin-bottom: 15px;">A recursion step: this is where the method calls itself again.</p>
<p style = "margin-left: 100px; margin-right: 100px; margin-bottom: 15px;">A base case: this is where the recursion ends so it doesn’t cause an infinite loop.</p>
<p style = "margin-left: 100px; margin-right: 100px; margin-bottom: 15px;">Here is an example:</p>
<img style = "margin-left: 150px; margin-top: 80px; margin-bottom: 50px;"src = "https://cdn.discordapp.com/attachments/1048076355331440720/1112795860875628584/image.png">
<h1 style = "margin-left: 100px; margin-bottom: 30px; margin-top: 150px">Sources</h2>
<a href="https://www.geeksforgeeks.org/recursive-functions/" style = "margin-left: 100px; margin-right: 100px; margin-bottom: 15px;">- https://www.geeksforgeeks.org/recursive-functions/</a>
</main>
<footer>
<p class="footer-text">Contact: glenlin7813@gmail.com, Eogito#0732</p>
</footer>
</body>
</html>