 We shall continue our discussion on some additional features of C++ programming language. Today and tomorrow we wish to cover functions and arrays, we will be introducing arrays tomorrow, but today we wish to look at functions. I will briefly review the last lecture primarily to repeat some of the instructions. On slide I could not show you yesterday and then we will talk about the need to segment our program into multiple modules so that programs are organized better and the code or instructions which we write are understandable more easily. It is in this context that we shall discuss functions. So first about yesterday's lecture a brief review, specifically we discussed aspects of conditional execution and iterative and repetitive execution of instructions. So we discussed the if, if else, these two clauses for conditional execution of statements and we discussed the ladder, if, l safe, l safe, etcetera, etcetera. We also discussed the for loop and the while loop to construct iterative instruction execution. We also discussed couple of programs which carry out important numerical computations. We discussed the Fibonacci numbers or the Hemchandran numbers as I prefer to call them and the Newton-Raphson method for finding out roots. We specifically took a simple quadratic and tried to solve the roots in an iterative fashion. We found out that we can get only one root by that method as we saw it yesterday. These are the few slides which I would like to repeat again. The evaluation approach, we have 10 percent marks for quizzes, 10 percent for the assignments. You have your first assignment which is actually called assignment 2 because it is associated with lab 2. Every lab will now have an associated assignment which you will have to finally submit within the week. Ideally, you should finish off the assignment there itself but some of the problems are indeed difficult. It is not expected that you should be able to solve all problems during that lab. But what is definitely expected is you try as much as you can plus you take the remaining thing back home and work on those exercises subsequently in any spare time you could upload your final assignment. All the assignments together will constitute a 10 percent weightage in this course. Then I said we will have a course project. Ideally there should be a group of four students. So either three or five students would be permitted as an exception only for one group in a batch. The groups must come from your lab batches. Mid semester exam which will be a written exam will be 20 percent weightage and the end semester exam will be 30 percent weightage. And as I described the minimum passing grade will be 40 percent. There are additional consulting support that we have been able to provide. There are teaching assistants specifically designated as consulting TAs. They will attend office on Monday and Tuesday in two batches from 1330 to 1730. That is four hours. There will be two sort of separate groups and another four hours on Tuesday. So in case you are free on any one of these afternoons you are free to use the lab and these TAs will be available to answer any queries that you have or solve your problems of not just the lectures, labs and programming problems but even other administrative problems. The additional hours for lab excess are available on both these days. I am additionally trying to get a slot on Thursday but I am not sure of that. I will confirm it with my head and the administration and you will find the announcement on the moodle and on the homepage. So with this we go over to the notion of separate functions. So there are occasions in a program where we are required to do very similar computations using different values. So let us assume that we have a very long program, 200 line program and we are calculating something at one place after some instructions against similar calculations have to be done perhaps using different values after some time again similar calculations have to be done. Now these calculations may involve a single statement, may involve 20 statements. So it looks very silly to have to repeat these 20 statements every time we have to carry out the similar calculation because they may occur at different points in the program. So we look forward to a mechanism by which we could sort of separate out this common block of code so to say. Incidentally code and instructions are considered synonymous. So when we say you have written instructions in a program or you have written a program you also say what is the code in your program so these are synonymous. So we would like to take this pack of instructions and put them separately as a separate entity and we should be able to say in our program at this time I want to evaluate that particular thing. So go over to that separate package do the calculations using the values which I supply and come back to that essentially is the notion of a function. For example in yesterday's problems that we saw the Newton-Raphson method we had to calculate fx and f dash x for different values of things. In that particular program these computations occurred at a single place within an iteration. But I am trying to generalize that if you have to do such calculations at different places it would be nice if the calculation of fx and f dash x could be separated out. In fact then you could write the main program to calculate the root by Newton-Raphson and if you have to do it with different functions you can simply replace the instructions for such separately written function and the same program will work. That is another advantage of having common functions. Fash functions in fact will ultimately become what we call library of functions. Just as library has a lot of books our library could have a lot of functions accumulated. As we shall see later people have already written a lot of useful functions which have been made part of C++ Dumbos Report Oil. Additionally in our programs we can write our own functions. So we shall see how we do that. This is what we were trying to do. So we started with some initial assumption of xi and we know this is the point A. Since this is the initial assumption we know the value of the coordinates xi,0. Then we said we will find out the function value and calculate the point B which is here. The coordinates of point B will be xi,y value which is this value and this is nothing but the value of the function. So xi, fxi will be this value we said. Then we said we will approximate the next iteration value of xi by using a tangent on this graph at point B and wherever this tangent intersects x axis we said that will be our new point for the next iteration. So we have to calculate the intercept on x axis which is C and we say that C is xi plus 1 comma 0. The issue was how do we calculate xi plus 1? Knowing xi how do we calculate xi plus 1? So knowing xi we can calculate the coordinates for B then we can calculate the slope of this line and then we can calculate the intercept. This was given by a function calculation of this type f dash xi is fxi upon xi minus xi plus 1 which implies that xi plus 1 is nothing but xi minus f of xi divided by f dash. So this simple formulation permits us to calculate the next iteration value. We go closer to the root and the calculation of this value requires us to evaluate this function at a point xi and its derivative at the point xi. And this we have to do repeatedly till we approach the root. Now we had written specific instructions to calculate this fx and fx f dash x assuming that the quadratic was simple x square minus k or some such thing. But imagine if in general I have a quadratic fx is equal to ax square plus bx plus c. I am just taking this as an example in actual practice it could be any complex function requiring a whole lot of computations also it does not matter. In this particular case f dash x will be 2 ax plus b. So what we are saying is it would be nice if we had separate blocks of instructions to calculate fx and calculate f dash x. A function in c plus plus is indeed such a separate block. What that function does is you imagine that function to be a separate entity. So whenever our Mr. Dumbo goes to that function it takes with it with himself some value in this case it will take the value of a, b, c and x for example. And that function will calculate the value of the function and Dumbo will collect it back. So we need a mechanism for Dumbo to leave whatever instructions he is executing to go to that function come back to the value. Again if you encounter that function Dumbo should again go back to that function and come back. How exactly are such functions written here is an example. So I have float my function let us just read these lines and then we will understand the meaning of these. The first line says float my function and in this parenthesis it has float a comma float b comma float c comma float x. Then the body of the function is written very much like you write int main except that in a function generally there will be no input output status. The input to that function will be the parameter values which Dumbo will carry and the output of that function will be a value which will be returned by that function to Mr. Dumbo. So you see the calculations how they are happening. You start by declaring a variable called value it is an arbitrary name my choice. Similarly this name is my choice that is why I said my function it could be abrakad meaningful name that you can give. All that I do here is value equal to a into x into x plus b into x plus c. Note that this is the function where does this fellow get the values for a, x, b, c, etc. These values will come to this function as to what kind of these values are is defined in this parenthesis by listing each and every parameter separately along with the type of value that the parameter represents. So some of the values will come and sit into these buckets ab, c, x and then these values will be used by Dumbo let us say is an assisted Dumbo for this function calculate this value. Note the statement return in bracket value do you recall return 0 as a mandatory statement that we have been writing in our programs. You will recall that our programs begin with int main actually that itself is a function that is called the main function and it returns an arbitrary value 0 we shall see what is the meaning of that. In this particular case the value return will be one which is computed here. I have written another function to calculate the derivative of the quadratic which I define as float my derivative float a float b float x note the derivative requires only these three parameters it will again I am defining a float value value equal to 2 a x plus b return value. Let us look at some possible confusion I am using value in this function definition I am also using value in this function definition is there any clash no if you imagine each function to be assigned to a separate assistant Dumbo then for that assistant Dumbo the definition of variables inside that function are localized to that Dumbo. So those definitions do not correspond to anything that we define in our main program they are local definitions. In short the assisted Dumbo will then create a compartment or a drawer called value we will know that floating point values are to be kept inside it it will calculate that value return that value and then you forget about that drawer and Dumbo everything. In short this value and this value are two completely different variable names they are in different spaces you remember namespace using namespace std that was the major namespace for Dumbo in exactly the same way there are local namespaces for assistant Dumbo which we create. Now if we write these two functions we must know how to invoke these how do we use these functions in our main program. So these functions are understood there is a keyword called float what does this float say why I am saying float why not in this represents the value which is returned by this function the type of value. If we say int it will return an integer value if we say float it will return a floating point value. So whatever type of value you want to return that type is mentioned here as the first one. This is followed by the name of the function which is your choice and this is followed by one or more parameters which will come to this function from somewhere using those parameters and any other internal things that the function may desire. Please note that we have said there should be no input output statement inside a function normally but there is no bar on it. I can read any values I can read from files as we shall see later I can do whatever I want because that function is the full flash program it is a C++ program but it is self contained after executing this function the value return will be whatever I write inside the bracket. This bracket need not contain a variable name it can contain a constant value as we saw earlier in the main program return 0 it can also contain an expression. In fact it is entirely possible not to say float value not to say value equal to this but to simply say return in bracket a into x into x plus b into x plus c bracket close because that becomes the expression which will be evaluated by this function and the resulting value will be return. So you can simplify I am writing this to elaborate that normally function should be written in this style. This is a simple case where you have a single statement but ordinarily you could have 10, 20, 30 statements instructions comprising a function. So is it clear this is another function which is written exactly similarly it is called my derivative. So you are clear on the definition of these two functions now we shall see how we could use these first of all some rules suppose I say int my function float something something this int will define the type of the value that will be written. So obviously for numerical computations of the values of function and derivative I would like to use floating point value that is why in the actual definition I have used the keyword float not int. So float my function this will be followed by int x float y double c whatever whatever any number of parameters these are the values which will come into the function. So after the keyword int or float the next is the name of the function which we choose entirely is our choice this is followed by one or more parameters whose values will come from the calling instruction and note the return statement this is what value is to be sent back. So inside the parenthesis after return you write the value which will go back again I will repeat that value let us go back to the previous slide this value could be either a constant 0, 1, 7.28 or it could be a variable in general it can be any expression that expression will be evaluated whatever is the return value whatever is the calculated value that will become the return value. So let us go to the next slide and see this function in the context of our Dumbo model as far as we are concerned our computer is a Dumbo but we have been calling him c plus plus Dumbo in actual practice if we want to abstract the computer by a model comprising a Dumbo then we must imagine several assistant Dumbo. In fact when we say see in and see out instructing Dumbo to get some values put some values out we are actually saying in an abstract fashion as if the c plus plus Dumbo has an assistant Dumbo which does input output in exactly the same fashion we can imagine that every function is a separate assistant Dumbo. So the way things operate is that any time a function is invoked within an instruction which c plus plus Dumbo is executing we shall see how the function can be invoked we have not yet seen that but apparently there is a mechanism that in my main program I should be able to say something which will tell Dumbo that I do not have to compute this but this is a function invocation so I have to go to this assistant Dumbo. So whenever this invocation happens Dumbo will collect the parameters which are listed in that invocation and go over to the assistant Dumbo giving him the parameter it is the separate assistant Dumbo then who calculates the function value and returns the final value to Dumbo once Dumbo gets back the final value he carries on using that return value from wherever he left exactly at that point he comes back. So let us look at the invocation of these functions within a program is function is invoked simply by using the function name with appropriate parameters within any expression this should be underlined within any expression. So wherever I can write an expression any complex expression just as I write 3.75 multiplied by z divided by q whatever whatever in that expression an element of that expression could be a function invocation please note that a function really stands for a single value which will be written by that assistant Dumbo since a value can participate in the evaluation of an expression wherever a value can be given instead of that a function reference can be made. In the Newton Raphson method where some value x i and we calculate the next value using this formula x i plus 1 is x i minus f of x i divided by f dash x i we saw that briefly once again. So suppose our function was f x is equal to a x square plus b x plus c you will realize that the two functions that we have written precisely calculate f x which is a x square plus b x plus c and f dash x the corresponding derivative. So my function and my derivative are the two functions or two assistant numbers which we have written which can be used to do this calculation using this function how will I write my program let us look at one variation of that program which actually carried out 10 iterations arbitrarily starting with an initial value of 1.0 and going to successive values of x using the function and its derivative. So here is the Newton Raphson using function calls we have include IO stream using namespace std int main bracket close bracket open bracket close what I would like to emphasize here is now perhaps we understand to some extent the meaning of this line this line which says int main bracket open bracket close. It tells us that this is also probably some kind of a function it is called main because that appears to be the main function which our c plus plus dumbo will execute it is expected to return a value of the type int and it does not have any parameters. Now if mister dumbo c plus plus dumbo is going to execute this as our main program whom does he return the value to assistant dumbo will return values to mister dumbo mister dumbo returns to whom actually mister dumbo returns these values to what we call an operating system which originally gives mister dumbo the task of executing our program we shall see that in due course of time but it is adequate to say at this stage that the main program itself is a function without any parameters. It may in fact either have a return value or may not have any return value if there is no return value to the main function you write the word v o i d void void means the function does not return any value it is just a function executed just come back and tell me whether you are done or not anyway let us go back to our task. So, this is the main program all of you are familiar with this here I have defined x a b c as floating point variables also value root I am saying c out enter values of a b c and then I input a b and c and I start with an initial guess of 1.0 this is the initial guess for x. Now I say for int i equal to 0 this is semicolon i less than 10 semicolon i plus plus what does this for instruction do it sets up an iteration which will be executed 10 times initially for i equal to 0 then for i equal to 1 then for i equal to 2 etcetera up to and including i equal to 9 and i becomes 10 I will get out of this and what am I doing in this iteration I am merely calculating the next value of x using the previous value of x note the notion of increment there exists a value of x initial guess 1.0 I will probably get 1.8 or 0.5 whatever it is depending upon the nature of the function this value is to be obtained not by evaluating directly the formula that I give here, but by invoking first my function and then invoking another function my derivative. So remember what our Dumbo will do our Dumbo now starts executing this loop for the first time it comes in with i equal to 0 it has a value x which is 1.0 it starts evaluating this expression it notices x it replaces it by 1.0 then it says minus sign now it has to find out what is to be subtracted then it finds out oh what is to be subtracted is not known so I have to go to assistant Dumbo who is called my function and I have to carry the values of a b c and x with me notice that all these values have been initialized already so they are available Dumbo will actually carry these values go to my function my function will calculate that a x square plus b x plus c and then it will come back with what with a single value. So please remember any reference to a function will always come back with a single value it is that value which Dumbo will replace for my function reference. So let us say that value is whatever 7.8 something the matter does not end here Dumbo cannot subtract 7.8 from x because it notices a division symbol and notice the precedence multiplication and division has to be done before addition and subtraction. So it knows that the 7.8 value that it has got has to be divided by something else and then the final result has to be subtracted from x. But what is that something else Dumbo again encounters another function this time he says my derivative it goes to another assistant Dumbo called my derivative this time carrying only three values a b and x because they are sufficient and with these values it goes it calculates and the value is returned I calculate all this iteratively x will keep going closer to the root and at the end of the iteration after 10 iterations say when I come out I will have one value of x which should be the root. Notionally I am assigning it to root and then printing out the root. In fact that brings us to an important point the names of the variables that you choose in your program should always be meaningful should never have arbitrary names like a 1, a 2, a 3, a 4 etcetera etcetera. The names of the programs that you write which you store in some files called c dot c p p the names also should be meaningful they should not be p 1, p 2, p 3 you will observe that in the lab exercises we have programs which are called prototype dot c p p etcetera. So something of that sort you should use in any naming convention these are the invocation rules if I have written here the expression for my benefit and once again I repeat when Dumbo encounters my function while evaluating this expression it suspense execution of the program at this stage that program execution stops no instruction is executed in that program goes over to the defined function with the available values of the parameters a b c and x in this case that assistant Dumbo of the function will calculate the value executing the instructions given in that point. Please note again in our functions here there are simple instructions but they could be 20, 30, 100, 2000 instruction does not matter it is an assistant Dumbo separate but all of that must result in a single value which is brought back later on we shall see that if I want to write procedures which will return back not one value but many values how can I handle that because the notion is same that of a function well we shall see that when we extend the notion of function to return multiple value obviously that cannot be done through a return statement there must be some other mechanism we shall see those later as of now the return statement will get the value which is calculated by that function and then when Dumbo returns back to the main program he replaces the reference to the function by the return value this entire reference my function a b c x is written by a replace by a single value 3.2 4.8 whatever whatever and then same thing happens again for this this is also replaced by a single value and finally the whole expression is calculated resulting in a new value of x so is this notion clear now I wanted to use some time to explain to you because I saw some people were still having problems with the instructions that you are required to give while working in your labs I also wanted to do this exercise of finding out roots of a quadratic to a completely different means because all of you will know the standard way of calculating the two roots of a quadratic equation all of you are familiar with that so let us start with that approach we will ditch the Newton Raphson method in the lab of course you have to use Newton Raphson method to find out the three roots of a cubic etcetera but here if I have a quadratic of this form what are the two roots assume that this quadratic has two real roots which means what ultimately this should be of the form x minus r 1 multiplied by x minus r 2 equal to 0 you agree if I have two roots r 1 and r 2 this is how I will write the equation and essentially I want to find out the values of r 1 and r 2 given the values of a b and c so what is the formula to calculate these roots minus b plus minus so you are awake now why do I require Newton Raphson method to calculate this can I not calculate this using my if ladder can I not calculate b square minus 4 ac how will I calculate its square root do I use Newton Raphson method I can but there may be a better way of doing that and if I can calculate the square root easily then I can calculate the entire expression calculate r 1 and calculate r 2 so let us write a program to do that you are all familiar with this basic form of equation I will start directly by saying so what are the variables which I will require I will require of course a b c which are the three parameters and then I will require r 1 r 2 I suppose this should be good enough but since I have to calculate the square root of b square minus 4 ac and since there is a mathematical name for that entity what is it called discriminant so let us just call it b i s c r for short discriminant what should I get in as values of course you should write the necessary c out by saying give me the values of a b c etcetera we take that for granted you got the values in now I should calculate the discriminant first what I have calculated b square minus 4 ac how do I calculate the square root right now we do not know it the only way to calculate the square root is using Newton Raphson method so assume that I have written a function called my square root now you know how to write a function so I can write my square root which will do the exact Newton Raphson method for calculating the square root and you get me the value back so I call it my s q r t please note that my s q r t does not exist unless I write float function my s q r t float a float b float c and then calculate this value using these value I calculate the square root and return back with that square root once I have the square root I have to calculate two different roots please note that in c plus plus there is nothing like an algebraic notation which says minus b plus minus you cannot say plus minus it does not no expression calculates two values simultaneous you cannot say r 1 comma r 2 equal to this every value has to be calculated independently and therefore we shall write two statements r 1 what will be r 1 equal to minus b plus discriminant divided by two multiplied by a do you agree this is the correct statement and what will be r 2 minus b minus discriminant divided by suppose I write this will it be alright please note the difference between this statement and this statement here I have put 2 star a parenthesis here I have not put parenthesis please note what will happen if I do not put the parenthesis if I do not put the parenthesis the precedence of c plus plus says that division and multiplication are at the same level and whenever operators at the same level are encountered they are executed from left to right so dumbo will calculate this divided by two and multiply the result by a which is not what is desired that is why whenever in doubt always put parenthesis and then of course I can say c out good program would you say there are some problems here the problem is that when I go to this my square root function b square minus 4 ac may turn out to be 0 may turn out to be minus 27.4 how do you define square root of minus 27.4 any idea sorry well whenever you have a value which is negative for b square minus 4 ac it should be obvious that the quadratic does not have real roots you then deal with complex numbers you say that in that situation the roots are complex conjugate roots however we are writing a program to find two real roots of the equation so if b square minus 4 ac turns out to be negative then we should humbly say that sorry the equation that you have given me does not have two real roots because I do not know how to handle complex numbers however if the discriminant is positive that is b square minus 4 ac is positive I can calculate its square root and get to the value so you agree that I should do some checking before going to my sqrt which is a function which I have written separately because that my sqrt assistant numbo will get completely confused he will get b square minus 4 ac as minus 27.4 and then it will apply Newton Raphson what will happen to Newton Raphson any idea both Newton and Raphson will cry up there in events the system will not work as simple as that so therefore we should be careful in giving our assistant numbo only that task which the assistant numbo can meaningfully do that is our responsibility otherwise we will get meaningless gibberish from the numbo so that is one issue that we need to tackle what if discriminant is negative or what if this value is negative there is another problem after all I am giving values of three coefficients a b and c these values could be absolutely any arbitrary value that is why we said b square minus 4 ac could be negative what if I give a equal to rho well in actual practice in an equation a x square plus b x plus c equal to 0 if a is 0 then the equation simply reduces to b x plus c equal to 0 and there is a single root which is x is equal to minus c by b there is no quadratic if a is 0 there is no quadratic however this nice city we understand because we understand algebra numbo to the algebra numbo knows computation so if we give a value 0 to our mister numbo he will faithfully calculate all of this b square minus 4 ac will simply reduce to b square whose square root will be b that is fine however when numbo tries to calculate this it will multiply 2 by a which is 0 and then it has something on the left hand side it will try to divide it by 0 how do you divide any quantity by 0 what is the numerical value that you get any idea yes what is any x divided by 0 what is the value ah but infinity is not a value it is a concept numbo cannot handle such conceptual entity in short if you ask numbo to divide anything by 0 it will get it will shout back at you it can literally shout but it will give you some error message which means my program will bomb in spite of the fact that equation is a legitimate equation only thing it is not a quadratic but it is a single order equation should I therefore intelligently not examine the values of a b and c first if a is equal to 0 I should say not a quadratic root which is this if a is non-zero then should I not examine b square minus 4 ac and if that is negative I should say quadratic but with complex conjugate roots I cannot solve this only if all other things are satisfied then should I go with this procedure is that not correct if I have to do that then I have to use if statements in my program we will put an additional squiggle in the modified program that we shall now write for calculating the roots of a quadratic we will make this program long enough to include some interesting features as well I will start this is a new statement has include c math what is c math c math is a collection of mathematical functions which our numbo has access to in fact this c math library as is known it comes from the legacy c language you can also write this as include dot h dot h stands for a header file we shall discuss that later but this is the standard invoke if you write this then the complete mathematical mathematical function calculation facility becomes available to you our c plus plus numbo can suddenly calculate square root logarithm e to the power something sine, cos, tangent everything just like we have been trying to write functions many people have written functions earlier and some of these have become standard functions which are available to every c plus plus numbo so by simply saying include c math we do not know how to write functions to calculate sine, cosine, log, exponential, square root whatever they are n number of functions and in fact if you look at the mathematical library there is documentation available both online and outside you will know series of functions which are already pre return for us by some people and are made part of the c plus plus language. So the functions are not part of the c plus plus instruction language they are part of the library functions which have been made available consequently I do not have to write a function called my square root I can simply use square root sqrt which is a standard function available with math library so I can use that and proceed ahead. We come across the first condition we have read in the values of a, b and c here and now as we imagine we are going to examine first whether a is 0 if a is 0 then what is the meaning there is a single root it is not a quadratic so we will say what is the single root value actually I can insert a statement here if I want I can actually say r1 is equal to minus c by b and then simply put here r1 that may look better because I have the nomenclature of the root notice that I have started this if here this if ends here if a is equal to 0 this is what I should do else if so I will continue on the next page else if b square minus 4 ac is less than 0 what do I say you look at the if else if ladder I am using if a was 0 I calculated a single root else if b square minus 4 ac is less than 0 I simply announce complex roots else what do I do now I can revert back to my earlier computation discriminant is equal to this time I will write s q r t notice that s q r t is a standard c library function so I do not have to write this function now c plus plus dumbo does the necessary thing by going to a predefined assistant dumbo who knows how to calculate square root and we know that this assistant dumbo can correctly calculate the square root because b square minus 4 ac is not negative so we will just put the same expression here and then we will follow so is this clear how will you calculate roots of a quadratic please note that the if statement which permits you conditional execution and the iterative structures using for and why are the two most important structures available to us for giving instructions to dumbo these are called control structures because using these we control the way dumbo executes instructions ordinarily dumbo will execute instructions sequentially using these structures using these control structures you can tell dumbo to either conditionally execute this give this etcetera or to repeatedly execute something as an added attraction when we can provide assistant dumbo in the form of functions that we write or in the form of functions that people have already written which are part of the c plus plus report I then our ability to do extremely complex computations increases very rapidly but we shall see that this is good but not good enough there are many other things that we need to do for example we still do not know how to handle character strength suppose names are given names of students and I want to arrange them in alphabetical order how do I do that suppose an address is given how do I break that address into street name pin code etcetera etcetera we do not know that suppose 200 values are given in a matrix one dimensional matrix and I have to calculate some average or something how do I take this value can I define a 1 a 2 a 3 a 200 variables suppose there are 1 million values which I have to actually suppose I have to handle a two dimensional matrix and calculate its inverse obviously I will need some additional structures made available to Mr. Dumbo by which Dumbo can store these values the storage of such multiple values such as multi dimensional matrices or a single dimensional array of million values etcetera is available through a data structure called array that is what we shall discuss tomorrow subsequently in the class we shall discuss more complex structures which are called link place trees and so on which will facilitate our ability to write very good program for solving complex problem we will meet tomorrow again thank you.