- 5(4)๋ช
์ด 1 team์ผ๋ก ์์
- ์กฐ์ฅ(1) , ์กฐ์(๋๋จธ์ง)
- ๊ฐ์กฐ์ ๋ํ์ฌ ์กฐ์ฅ์ด maintainer์ธ repository DevSetN๋ถ์ฌ
- DevSet2, DevSet2, โฆ DevSet9
- DevSet1 repository ์ guide ๋ฑ ๊ด๋ จ ๋ด์ฉ posting
- Repository DevSetN ์ ์กฐ์ฅ(maintainer)๋ง push ํ ์ ์์
- ์กฐ์์ maintainer์๊ฒ PR์ ํตํ์ฌ push ๊ฐ๋ฅ
- ๊ฐ repository์๋ ๋ค์์ file ๋ค์ด ์์ฑ๋์ด์ผ ํจ
- README. md : ๊ณผ์ ์งํ์ ๋ํ ์ค๋ช , ์ญํ ๋ถ๋ด ๋ฑ๋ฑ
- FINAL.md : ๊ณผ์ ๊ฒฐ๊ณผ ๋ถ์์ ๋ํ ๋ด์ฉ ๊ธฐ๋ก(์งํ๊ณผ์ ํฌํจ) +Source files
- Works to do
- Implementation of each code
- Unit test for implementations
- Periodic(or continuous) build and smoke test
- Performance tuning
- Due to June 21st
- Unit test for implementations
- Implementation of each code
- ์ํ๋ฐฉ๋ฒ์ ์กฐ๋ณ๋ก ํ์๋ฅผ ํตํ์ฌ ๊ฒฐ์ ํ์ฌ ์คํ
- ๋ชจ๋ ์กฐ์์ด ์๋ ๊ฐ ๋ถ๋ฌธ์ ์ญํ ์ด ์ ์๋๊ณ ์คํ๋์ด์ผ ํจ
- Implementation of code(unit test๋ฅผ ํฌํจํ์ฌ)
- Performance ์ธก์ ์ ํตํ ๋ถ์ ๋ฐ ๊ฐ์
- ๋ชจ๋ ์กฐ์์ด ์๋ ๊ฐ ๋ถ๋ฌธ์ ์ญํ ์ด ์ ์๋๊ณ ์คํ๋์ด์ผ ํจ
- A sorted sequence of m random integers in [0, maxval), without duplicates
- SET implementation of โmaxvalโ elements
- Same interfaces with different implementation of 5 data structures
- Arrays
- Simple lists
- Binary search tree(list)
- Bit vectors
- Bins (buckets)
- Experiments 5 implementation with proper โmaxvalโ and โmโ values
- Time complexity โ elapsed time to create m-elements set
- Space complexity โ spaces required to create same set
- Refine implementation to get reasonable performance result
- Performance rank in terms of TIME and SPACE
-
IntSet as set of integers
- IntSetxxx: xxx as a qualifier
- IntSetArr, IntSetList, IntSetBST, IntSetBitVec, IntSetBins
-
intSetImp(int maxelems, int maxval)
- initializes the set to empty
- maxelems: maximum number of elements
- maxval: maximum value of any element
-
insert(int element)
- adds a new integer to the set, if it is not already present
-
size()
- tells the current number of elements
-
report(int *v)
- returns elements in sorted order
- An example code to generate a sorted set of random integers
void gensets(int m, int maxval)
{ int *v = new int[m];
IntSetImp S(m, maxval);
while (S.size() < m)
S.insert(bigrand() % maxval);
S.report(v);
for (int i = 0; i < m; i++)
cout << v[i] << "\n";
}
-
maxval = n = ใ10ใ^8 , ใ10ใ^6
-
maxelements: m = n/100, n/50, n/25
-
Set generation experiments measured for 5 cases excluding i/o
- Time elapsed
- initialize / insert / report / Total
- Total space required
- for SET implementation
- Time elapsed
-
Improve performance
- Implementation and measure
- Performance upgrade iterations
class IntSetBitVec {
private:
enum { BITSPERWORD = 32, SHIFT = 5, MASK = 0x1F };
int n, hi, *x;
void set(int i) { x[i>>SHIFT] |= (1<<(i & MASK)); }
void clr(int i) { x[i>>SHIFT] &= ~(1<<(i & MASK)); }
int test(int i) { return x[i>>SHIFT] & (i<<(i & MASK)); }
public:
IntSetBitVec(maxelements, maxval)
{ hi = maxval;
x = new int[1 + hi/BITSPERWORD];
for (int i = 0; i < hi; i++)
clr(i);
n = 0;
}
int size() { return n; }
void insert(t)
{ if (test(t))
return;
set(t);
n++;
}
void report(int *v)
{ j = 0
for (int i = 0; i < hi; i++)
if test(i)
v[j++] = i
}
};