Median of Stream of Running Integers using STL.Median in a stream of integers (running integers). Longest Increasing Subsequence Size (N log N).Maximum size square sub-matrix with all 1s.Maximum size rectangle binary sub-matrix with all 1s.Print unique rows in a given Binary matrix.Rotate a matrix by 90 degree in clockwise direction without using any extra space.Rotate a matrix by 90 degree without using any extra space | Set 2.Inplace rotate square matrix by 90 degrees | Set 1.Print a given matrix in counter-clock wise spiral form.Mathematics | Eigen Values and Eigen Vectors.Mathematics | System of Linear Equations.Mathematics | L U Decomposition of a System of Linear Equations.Gaussian Elimination to Solve Linear Equations.Program for Gauss-Jordan Elimination Method.Program to find root of an equations using secant method.ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.I wrote a toy program which solves this problem, but not completely. Hello~~ A cubic polynomial has at least one real root while your solution may sometimes fail to find one. Scanf("%lf %lf %lf %lf") *addb, *addc, *addd, *addguess Printf("This program calculates the root of a cubic polynomial\n") #define a 1 /* The coefficient a, is always one, so is a defined constant */ĭouble b, c, d, n, x, xnew, guess, poly, primepoly /*this line declares variables */ĭouble *addb, *addc, *addd, *addn, *addx, *addxnew, *addguess In short, I am more than a little screwed, and will barter my firstborn for help. Hey, I am a novice to this, and now have to build a program to read sequentially, line by line, the coefficients of a cubic polynomial, and the initial guess, approximate the root and display the number of iterations it took for it to be correct to within 5e-6, or if it fails to converge, to add 10 to the estimate and try again, if it the fails, display a fail message and move to the next line of the input file, do it all again and again until it reaches the end of input file and quits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |