Re: Help displaying Uppercase to lowercase Programming Software Development by sbesch ShiftLeft already answered why adding or subtracting 32 won't work. … Re: help so confused Programming Software Development by David W @ShiftLeft, I think the OP stated ... > average; // ... display in decimal … Class Template Problem - Constructor Issues - Please help Programming Software Development by doublediamond … *data; int size; int capacity; void grow(); void shiftRight(); void shiftLeft(); }; [/code] I think I understand how to do it, and…; i > 0; i--) { data[i] = data[i - 1]; } } void shiftLeft() { size--; for(int i = 0; i < size; i++) { data… Re: Class Template Problem - Constructor Issues - Please help Programming Software Development by doublediamond …; int size; int capacity; void grow(); void shiftRight(); void shiftLeft(); }; template <class T> myVector<T>::…n) throw(BADINDEX) { if(size > 0) { n = data[0]; shiftLeft(); } else { throw BADINDEX(); } return *this; } template <class T&… Re: Multiplying Polynomials Programming Software Development by Gribouillis … So in the expression [icode]addPoly(mulPoly(shiftRight(lst1), shiftLeft(lst2)), scalePoly(constCoef(lst1), lst2))[/icode], the first shiftRight…if isZeroPoly(lst1): return [] else: return addPoly( mulPoly(shiftRight(lst1), shiftLeft(lst2)), scalePoly(constCoef(lst1), lst2) ) P = [1, 2, … Re: Multiplying Polynomials Programming Software Development by JJHT7439 …So in the expression [icode]addPoly(mulPoly(shiftRight(lst1), shiftLeft(lst2)), scalePoly(constCoef(lst1), lst2))[/icode], the first …if isZeroPoly(lst1): return [] else: return addPoly( mulPoly(shiftRight(lst1), shiftLeft(lst2)), scalePoly(constCoef(lst1), lst2) ) P = [1, 2,… Multiplying Polynomials Programming Software Development by JJHT7439 … p2 = (anx^n + ... + a1) * (p2 * x) + a0 * p2 = shiftRight(p1) * shiftLeft(p2) + constCoef(p1) * p2 (Explains that if you keep shifting… left ([2,3,4] => [0,2,3,4]) def shiftLeft(lst): newlst = [] newlst.append(0) for x in range(0… Re: Multiplying Polynomials Programming Software Development by Gribouillis Why don't you try the algorithm explained above ? I would write [code=python] def mulPoly(lst1, lst2): if isZeroPoly(lst1): return [] else: return addPoly( mulPoly(shiftRight(lst1), shiftLeft(lst2), scalePoly(constCoef(lst1), lst2) ) [/code] Re: Multiplying Polynomials Programming Software Development by JJHT7439 …): if isZeroPoly(lst1): return [] else: return addPoly( mulPoly(shiftRight(lst1), shiftLeft(lst2), scalePoly(constCoef(lst1), lst2) ) [/code][/QUOTE] I did try… Re: problem with my c++ algorithm assginment Programming Software Development by shamila08 … arr[i] = arr[j]; arr[j] = t; } void shiftleft(int *arr, int start, int SIZE) { int tmp = arr[… swap(arr, i, j); starterequiv(arr, i, SIZE); count++ ; } shiftleft(arr,i,SIZE); } } } void initiate(int *arr, int SIZE) {… Re: Program does not declare win or lose Programming Software Development by pacman326@gmail … how to put line #s, I couldnt find it. :( My shiftLeft function does not work, for some reason, the last statement… Re: how to eliminate number Programming Software Development by shamila08 …;n; ++j) { shift(x, i, j); equiv(x, i, n); } shiftleft(x, i, n); } }} [/code] sorry i 'm not familiar about… Re: problem with my c++ algorithm assginment Programming Software Development by shamila08 …; j++) { swap(arr, i, j); starterequiv(arr, i, SIZE); count++ ; } shiftleft(arr,i,SIZE); } if (count == 4) exit(0); } my output… Re: DBMS - Database Management System Programming Computer Science by london-G Thanks Shiftleft for the clear explanation! Makes sense now. Thanks guys! Re: Write a program to check the password is too strong or strong or weak Programming Software Development by hadisur_rahman i can not get correct answer yet>>>> ##ShiftLeft Re: Class Template Problem - Constructor Issues - Please help Programming Software Development by Narue If you define a member function for a template class outside of the class definition, you need to recreate the template parameters: [code=cplusplus] template <typename T> myVector<T>::myVector() { size = 0; capacity = 10; data = new T [capacity]; } template <typename T> myVector<T>::~myVector() {… Re: Class Template Problem - Constructor Issues - Please help Programming Software Development by Laiq Ahmed what it actually does. Let me tell you what it actually does, and what it should do first what it does [code] template <class T> void myVector<T>::grow(){ while(size >= capacity) { T* temp; temp = data; capacity *= 2; data = new T[capacity];… Re: Class Template Problem - Constructor Issues - Please help Programming Software Development by doublediamond Yeah, I found that last night, thanks. temp is a pointer, not an object, so I just needed to change temp.data[i] to temp [i] and it worked. I have some sort of small logic error with popback and popfront, but everything else works fine. Thanks for your help. Re: Class Template Problem - Constructor Issues - Please help Programming Software Development by doublediamond Figured out my last logic error. Solved. Thanks! Re: Multiplying Polynomials Programming Software Development by TrustyTony For me looks like line 4 should be [B]while[/B] not if, from the comment, so it can remove more than one trailing zero. Re: Multiplying Polynomials Programming Software Development by Gribouillis [QUOTE=tonyjv;1365937]For me looks like line 4 should be [B]while[/B] not if, from the comment, so it can remove more than one trailing zero.[/QUOTE] Yes, there are many possible improvements. For example isZeroPoly could be the one liner [icode]return not lst[/icode]