This document provides an overview of recursion, including recursive algorithms, functions, data types, and order of execution. Recursion is defined as a function calling itself, either directly or indirectly. Recursive algorithms break down a problem into smaller instances of the same problem until a base case is reached. Examples of recursive functions and data types are provided, such as factorial functions and linked lists. The order of execution for recursive functions is described, with code placed before the recursive call executing once per recursion level.
In every programming languages recursion is widely used, its very useful for programmer for designing a code.All detail information provided by this slide please go and throw that.
In every programming languages recursion is widely used, its very useful for programmer for designing a code.All detail information provided by this slide please go and throw that.
This presentation explains and solves problems such as Factorial, Fibonacci, Greatest Common Divisor, Binary Search, and Traversing Directory and Sub-Directories in both recursion and iteration.
In summary, there are similarities between recursion and iteration. Hence, any problems that can be solved with iterations can be solved with recursions and vice versa.
Database structure Structures Link list and trees and Recurison complete Adnan abid
Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete
Introduction to datastructure and algorithmPratik Mota
Introduction to data structure and algorithm
-Basics of Data Structure and Algorithm
-Practical Examples of where Data Structure Algorithms is used
-Asymptotic Notations [ O(n), o(n), θ(n), Ω(n), ω(n) ]
-Calculation of Time and Space Complexity
-GNU gprof basic
This presentation explains and solves problems such as Factorial, Fibonacci, Greatest Common Divisor, Binary Search, and Traversing Directory and Sub-Directories in both recursion and iteration.
In summary, there are similarities between recursion and iteration. Hence, any problems that can be solved with iterations can be solved with recursions and vice versa.
Database structure Structures Link list and trees and Recurison complete Adnan abid
Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete
Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete Database structure Structures Link list and trees and Recurison complete
Introduction to datastructure and algorithmPratik Mota
Introduction to data structure and algorithm
-Basics of Data Structure and Algorithm
-Practical Examples of where Data Structure Algorithms is used
-Asymptotic Notations [ O(n), o(n), θ(n), Ω(n), ω(n) ]
-Calculation of Time and Space Complexity
-GNU gprof basic
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
Recursion vs. Iteration: Code Efficiency & Structurecogaxor346
This presentation delves into the Recursion vs. Iteration debate, highlighting their operational disparities. Recursion, though elegant, demands caution to prevent system crashes due to infinite loops. While it offers compact code, it suffers from slower execution and increased memory usage. Conversely, iteration, driven by repetition structures, boasts faster performance and lesser memory consumption. Examples illustrate the essence and application of recursion, emphasizing the need for terminating conditions. Additionally, the presentation touches upon modular programming principles and introduces lambda functions and the pass statement, elucidating their roles in code structure and execution control.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
2. CONTENTS
RECURSION
RECURSIVE ALGORITHMAS
RECURSIVE TYPES
RECURSIVE FUNCTIONS
RECURSIVE DATATYPES
ORDER OF EXECUTION
EXAMPLE
3. RECURSION
What is recursion?
It’s when a function calls itself.
how does this happen?
When we talk about recursion, we are really talking about creating a loop.
Let’s start by looking at a basic loop.
for(int i=0; i<10;i++)
{
cout<<“the number is:”<<i<< end1;
}
Output:
the number is :0
the number is:1
the number is:2
the number is:3
4. RECURSIVE ALGORITHM
Implementation and use of Recursive Algorithms:
space for all local, automatic (not static) variables
space for all formal parameters
the return address
any other system information about the function or the function that called it.
The function must have a selection construct which caters for the base case
The recursive call must deal with a simpler/smaller version of the data
Recursion uses selection construct and achieves repetition through repeated function
calls.
Recursion has a base case.
Any problem that can be solved recursively can be solved iteratively.
5. RECURSIVE ALGORITHM
A recursive algorithm is an algorithm which calls itself with "smaller or simpler"
input values, and which obtains the result for the current input by applying simple
operations to the returned value for the smaller input.
Example 1: Algorithm for finding the k-th even natural number
Algorithm 1: Even(positive integer k)
Input: k , a positive integer
Output: k-th even natural number (the first even being 0)
if k = 1,
then return 0;
else
return Even(k-1) + 2 .
6. RECURSIVE TYPES
Single recursion:
Recursion that only contains a single self-reference is
known as single recursion.
Example: Factorial function.
Multiple recursion:
Recursion that contains multiple self-references is known as
multiple recursion.
Ex: Fibonacci sequence
Direct recursion:
In which a function calls itself.
Ex: ƒ calls ƒ i.e. direct recursion
Indirect recursion:
Indirect recursion occurs when a function is called not by
itself but by another function that it called (either directly or
indirectly).
Ex: ƒ calls g, which calls ƒ
7. RECURSIVE TYPES
Anonymous recursion:
Recursion is usually done by explicitly calling a function by name.
However, recursion can also be done via implicitly calling a function based on
the current context, which is particularly useful for anonymous function and
is known as anonymous recursion.
Structural Recursion:
Functions that consume structured data, typically decompose their
arguments into their immediate structural components and then process
those components. If one of the immediate components belongs to the same
class of data as the input, the function is recursive.
EX: Factorial.
Generative Recursion:
Many well-known recursive algorithms generate an entirely new
piece of data from the given data and recur on it.
Ex: GCD, Binary Search
8. RECURSIVE FUNCTION
RECURSION FUNCTION:
Recursion is often seen as an efficient method of programming since it
requires the least amount of code to perform the necessary functions. However,
recursion must be incorporated carefully, since it can lead to an infinite loop if no
condition is met that will terminate the function.
MATHMATICAL FUNCTION:
In mathematics we often define a function in terms of itself.
For example: The factorial function f(n)=n!, for n is an integer, is defined as follows;
ƒ(n)={1 n≤1
{ n ƒ(n-1) n>1
9. TAIL RECURSIVE: In a tail-recursive function, none of the recursive call do
additional work after the recursive call is complete (additional work includes
printing, etc), except to return the value of the recursive call.
return rec_func( x, y ) ; // no work after recursive call, just return the
value of call
MUTUALLY RECURSIVE: For example, function f() can call function g() and
function g() can call function f(). This is still considered recursion because a
function can eventually call itself. In this case, f() indirectly calls itself.
RECURSIVE FUNCTIONS
11. RECURSIVE DATA TYPES
Inductively defined data:
An inductively defined recursive data definition is one that
specifies how to construct instances of the data.
Ex: linked list.
Co-inductively defined data type:
A co-inductive data definition is one that specifies the operations
that may be performed on a piece of data.
A co-inductive definition of infinite streams of strings
Ex: A stream of strings is an object s such that head(s) is a string,
and tail(s) is a stream of strings.
12. ORDER OF EXECUTION
In the simple case of a function calling itself only once, instructions placed before the
recursive call are executed once per recursion before any of the instructions placed
after the recursive call. The latter are executed repeatedly after the maximum
recursion has been reached.
Function 1
void recursiveFunction(int num)
{
printf("%dn", num);
if (num < 4)
recursiveFunction(num + 1);
}
13. ORDER OF EXECUTION
Function 2 with swapped lines:
void recursiveFunction(int num) {
if (num < 4)
recursiveFunction(num + 1);
printf("%dn", num);
}
14. SYSTEM STACK OF RECURSION
OBJECT HEAP
UNUSED
MEMORY
CALL STACK
STATIC VARS
BYTECODES
OS / JVM
Method n
Activation on Record
. . . .
Method 3
Activation on Record
Method 2
Activation on Record
Method 1
Activation on Record
LOCAL VARS
PARAMETERS
RETURN ADDRESS
(PC Values)
PREVIOUS BASE
POINTER
RETURN VALUE
BASE POINTER
PROGRAM COUNTER