Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Endorsement
Ranked #858
Ranked #2K
~10.9K People Reached
About Me

Self-taught programmer.

Interests
Algorithmic Problem Solving, Problem Solving, Techs, Programming, Graphics and etc.

13 Posted Topics

Member Avatar for vishalonne

You can use modular arithmetic to make a variable to take values between 0 - (n-1) when it's incremented by 2, or you can take advantage of odd-even steps of the row number, just start the col iterator(j) from 0 when the row number is even and from 1 when …

Member Avatar for DIVYANSHI MANGAL
0
1K
Member Avatar for 03330
Member Avatar for bCubed
Re: Help

The deck has 52 elements, so the elements will be indexed from 0-51, but in the loop it indexes 52. replacing aaa<=nSize with aaa<nSize will solve it. Also in the random index generating statement (line 28), (nHigh-nLow+1)is 53, so when using mod (%) with it has the possibility of generating …

Member Avatar for bCubed
0
208
Member Avatar for faysal.ishtiaq

Hope this helps. #include "stdafx.h" int strlen(char str[]); int toint(char); char tochar(int); int main() { int i=0,len1,len2,max,min,j=0,k=0,l=0; int carry = 0 ; char num1[30],num2[30],ans[50]; gets_s(num1); gets_s(num2); len1=strlen(num1); len2=strlen(num2); if(len1>len2) { max=len1; min=len2; } else { max=len2; min=len1; } while(num1[i]!='\0') i++; j=max-1; while(j>=0) { num1[j]=num1[i-1]; i--; if(i<0) num1[j]=48; j--; } while(num2[k]!='\0') …

Member Avatar for ken_taiken
0
139
Member Avatar for ariel930

You can modify and use DFS. For every node you can check if the depth of the two subtrees coming under it is equal or not.

Member Avatar for yde
0
874
Member Avatar for MachDelta

I have fixed your code. You don't have to return anything as phorce said already ,and why didn't you check for boundaries for the iterator 'j' like you did for 'i' in the partition function's for loops. And there is a trivial case where the partition function would go wrong, …

Member Avatar for ken_taiken
0
229
Member Avatar for letterG

This will do it. //Hanlding the operator part. else { if(start==NULL) push(*p); else { node *temp = start; while(temp) { q = temp->mdas.c_str(); temp = temp->nxt; if(prec(*q)>prec(*p)) postf.push_back(pop(*q)); else break; } push(*p); }

Member Avatar for letterG
0
4K
Member Avatar for 78jimm
Member Avatar for sapure

An obvious way to get a touch on problem solving is to practice. I had that kind of problem too, the ways in which I solve problems were inconsistent. But when I solved more and more problems I developed a consistent way of solving problems. So now whenever I get …

Member Avatar for sapure
0
181
Member Avatar for jalpesh_007

You can use it to print the elements of an array in ascending or descending order. Maintain a boolean list of size q to mark off the position of the largest (or smallest) element obtained from the inner loop, ignore it in the next turn if the position is marked.

Member Avatar for jalpesh_007
0
185
Member Avatar for ja3n

I think adding extra attributes to hold the parent's or ancestor's position in a cell will help. Every time before you add adjacent cells to the queue, set the values for the parent's co-ordinates of each valid adjacent node to that of the current cell's co-ordinates. If there's a solution, …

Member Avatar for ja3n
0
3K
Member Avatar for aman55

Check the reading part again, the way you are reading the elements is wrong.

Member Avatar for alaa sam
0
176
Member Avatar for trd360

In the loop, according the given instructions, you can check if the element of the array at the current index is odd or not. If it's odd multiply it by 3 else don't and add it to stepsTotal. And when adjusting to the closest multiple of 10 >= stepsTotal, simply …

Member Avatar for ken_taiken
0
356

The End.