Skip to content

Commit 37de7b4

Browse files
committed
added alternate method for pattern 6
1 parent 7400f89 commit 37de7b4

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Pattern Algorithms/06_PatternChallenge.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,35 @@ void printPattern_06(int input){
6666
cout<<endl;
6767
}
6868
}
69+
70+
//TODO
71+
/**********************************************************
72+
/* <some_function_name>
73+
/*
74+
/* @description : description here
75+
/* @param : Integer<variable> (Datatype<variable_name>)
76+
/* @return : datatype (int,float,double etc)
77+
/* @complexity : Big O notation. (O(n),O(n^2) etc)
78+
/* @explanation : Detailed description about what the algorithm does
79+
/* @author : <Your name> @<GitHub handle> (John Doe @johndoe)
80+
/**********************************************************/
81+
/*void print_pattern_alt_method(int num){
82+
// Algorithm content goes here.
83+
int maxDots = (2*num + 1) - 1;
84+
for(int i = 0; i < num; i++)
85+
{
86+
int hdots = 2*i - 1;
87+
for(int j = 0 ; j < maxDots ; j++)
88+
{
89+
if((num - i) < j && j < (num + i))
90+
{
91+
cout << "*";
92+
}
93+
else
94+
{
95+
cout << " ";
96+
}
97+
}
98+
cout << endl;
99+
}
100+
}*/

0 commit comments

Comments
 (0)