Skip to content

Commit bbaab9c

Browse files
committed
update
1 parent d072272 commit bbaab9c

21 files changed

+81
-16
lines changed

.vs/Fun Practice/v14/.suo

2 KB
Binary file not shown.

81_MovingMedian.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// For this challenge you will calculate the median in an array within a sliding window.
2+
/*
3+
have the function MovingMedian(arr) read the array of numbers stored in arr which will contain a sliding window size, N, as the first element in the array and the rest will be a list of numbers. Your program should return the Moving Median for each element based on the element and its N-1 predecessors, where N is the sliding window size. The final output should be a string with the moving median corresponding to each entry in the original array separated by commas.
4+
5+
Note that for the first few elements (until the window size is reached), the median is computed on a smaller number of entries. For example: if arr is [3, 1, 3, 5, 10, 6, 4, 3, 1] then your program should output "1,2,3,5,6,6,4,3"
6+
*/
7+
8+
#include <iostream>
9+
#include <string>
10+
using namespace std;
11+
12+
int MovingMedian(int arr[], int size)
13+
{
14+
15+
}
16+
17+
int main()
18+
{
19+
int A[] = { 3, 1, 3, 5, 10, 6, 4, 3, 1 };
20+
int A[] = { 5, 2, 4, 6 };
21+
int A[] = { 3, 0, 0, -2, 0, 2, 0, -2 };
22+
23+
cout << MovingMedian(A, sizeof(A) / sizeof(A[0])) << endl; // 1,2,3,5,6,6,4,3
24+
cout << MovingMedian(B, sizeof(B) / sizeof(B[0])) << endl; // 2,3,4
25+
cout << MovingMedian(C, sizeof(C) / sizeof(C[0])) << endl; // 0,0,0,0,0,0,0
26+
return 0;
27+
28+
}

Debug/80_StarRating.obj

200 KB
Binary file not shown.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\vc120.pdb
2+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\vc120.idb
3+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code37.obj
4+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code45.obj
5+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\test.obj
6+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code55.obj
7+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code50.obj
8+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code56.obj
9+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code58.obj
10+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code57.obj
11+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\code59.obj
12+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\6_longestword.obj
13+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\60_closestenemy.obj
14+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\61_largestfour.obj
15+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\62_questionmarks.obj
16+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\63_camelcase.obj
17+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\64_summultiplier.obj
18+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\65_stringmerge.obj
19+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\66_simpleevens.obj
20+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\67_onedecremented.obj
21+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\68_distinctcharacters.obj
22+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\69_snakecase.obj
23+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\70_elementmerger.obj
24+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\71_asciiconversion.obj
25+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\72_gcf.obj
26+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\74_serialnumber.obj
27+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\75_stringperiods.obj
28+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\73_closestenemy2.obj
29+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\76_numberstream.obj
30+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\77_palindromeswapper.obj
31+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\78_removebrackets.obj
32+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\79_commandline.obj
33+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\fun practice\debug\80_starrating.obj
34+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\debug\fun practice.ilk
35+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\debug\fun practice.exe
36+
c:\users\gutty333\documents\visual studio 2013\projects\fun practice\debug\fun practice.pdb
37+
c:\users\carlo\documents\github\fun-practice\debug\vc120.idb
38+
c:\users\carlo\documents\github\fun-practice\debug\fun practice.exe
39+
c:\users\carlo\documents\github\fun-practice\debug\fun practice.tlog\cl.command.1.tlog
40+
c:\users\carlo\documents\github\fun-practice\debug\fun practice.tlog\cl.read.1.tlog
41+
c:\users\carlo\documents\github\fun-practice\debug\fun practice.tlog\cl.write.1.tlog
42+
c:\users\carlo\documents\github\fun-practice\debug\fun practice.tlog\link.command.1.tlog
43+
c:\users\carlo\documents\github\fun-practice\debug\fun practice.tlog\link.read.1.tlog
44+
c:\users\carlo\documents\github\fun-practice\debug\fun practice.tlog\link.write.1.tlog

Debug/Fun Practice.exe

-38.5 KB
Binary file not shown.

Debug/Fun Practice.ilk

510 KB
Binary file not shown.

Debug/Fun Practice.log

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
Build started 11/14/2017 4:45:06 PM.
2-
1>Project "C:\Users\gutty333\Documents\Visual Studio 2013\Projects\Fun Practice\Fun Practice\Fun Practice.vcxproj" on node 2 (Build target(s)).
3-
1>ClCompile:
4-
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _LIB /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt 80_StarRating.cpp
5-
80_StarRating.cpp
6-
Link:
7-
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\gutty333\Documents\Visual Studio 2013\Projects\Fun Practice\Debug\Fun Practice.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:\Users\gutty333\Documents\Visual Studio 2013\Projects\Fun Practice\Debug\Fun Practice.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\gutty333\Documents\Visual Studio 2013\Projects\Fun Practice\Debug\Fun Practice.lib" /MACHINE:X86 Debug\80_StarRating.obj
8-
Fun Practice.vcxproj -> C:\Users\gutty333\Documents\Visual Studio 2013\Projects\Fun Practice\Debug\Fun Practice.exe
9-
1>Done Building Project "C:\Users\gutty333\Documents\Visual Studio 2013\Projects\Fun Practice\Fun Practice\Fun Practice.vcxproj" (Build target(s)).
10-
11-
Build succeeded.
12-
13-
Time Elapsed 00:00:00.98
1+
 80_StarRating.cpp
2+
Fun Practice.vcxproj -> C:\Users\carlo\Documents\GitHub\Fun-Practice\Debug\Fun Practice.exe

Debug/Fun Practice.pdb

948 KB
Binary file not shown.
-365 KB
Binary file not shown.
-26.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)