DATA STRUCTURE - RECURSION BASICS Some computer programming languages allows a module or function to call itself This technique is known as recursion
We will take only a superficial look at recursion in this course since it provides a very neat way to represent certain useful numerical functions and data
What is the data structures used to perform recursion? Ans: Stack Because of its LIFO (Last In First Out) property it remembers its 'caller' so knows whom to
performed, using as few resources, both execution time and memory space, Some of the more commonly used data structures include lists, arrays, stacks,
What is the data structures used to perform recursion? Stack Because of its LIFO (Last In First Out) property it remembers its 'caller' so knows whom to return
memory needed to store data and the kind of data that will be stored in that memory location What is the data structures used to perform recursion?
DATA STRUCTURE - RECURSION BASICS Many programming languages implement recursion by means of stacks Generally, whenever a One may argue that why to use recursion as the same task can be done with iteration The first
Data Structures and Algorithms CS-206 Recursion Mathematicians often use recursive definitions • These lead very naturally to recursive of processing recursion • Without the terminating condition, the recursive function may run forever
Recursion is an important technique in the study of data structures and algo- rithms We will trative examples of the use of recursion, providing a Java implementation for each steps are performed by recursively calling drawInterval(L−1)
The goal of a queue data structure, is to store items in such a way by recursion, using function/method calls 6 For such data structures, it is natural to use