![]() |
.. (לתיקייה המכילה) | |
Add_Student 1234 2
Add_Student 1234 3
Is it the same student?
Should I keep one copy in the memory of student 1234.
or
I can keep 2 copies in the memory One for Student 1234 in course 2 and one for Student 1234 in course 3
|
second option. You should keep for each course its students. BUT you can't keep the same student twice in the same course!! |
1. Can we do init in O(L) when L is the number of lecturers ?
2. It is impossible to implement Factor & Average in O(log S) because we must
check s_high - s_low students => it must work in Theta(s_high - s_low).
3. Can Add_course work in O(log C) when C is the number of courses that were
inserted since the begining ?
|
1. No. do as written in the Ex. 2. Its your job to solve it. 3. No. C means the current courses in the system. |
1. Are the lecturers enumerated 1,2,3, same as courses? or do they have some other kind of Id?
2. Is it possible to give two factors to the same group of students in the same course one after the other?
3. Tuesday is student day and this Monday is Tuesday. Are you going to give your reception hours on Monday?
|
1. you get the lecturer id in the input. (int) 2. Yes! 3. No reception hour on monday. but yes on Tuesday. |
Delete Lecturer
|
Delete lecturer is in O(1). i just fixed you can download the homework again. Sorry. |
1)Can we assume that every student at every course
will get factor one time maximum ?
2)Is "lecturers_num" of Init() is really limit of
possible number of lecturers in the system?
3)Can we assume that fumction "calloc()"
initializes the memory with O(1) ?
|
1) No!! 2) Yes. 3) Yes. |
are the lecturer id's are from the range [1-lectureresnum]
or it can be any number?
|
No. i didnt state in the homework that it is in this range. |
Add_Course Mevneem
Add_Course Mavo
Add_Course Hashmal
Delete_Course Mavo
Add_Course Logica
What is the id of each course after these commands?
Should I change the id of each course because the Delete_Course command
(Replace Hashmal id from 3 to 2)
Should I give Logica the id 2, 3 or can I give Logica the id 4?
Thank You
Sagi
|
Add_Course Mevneen // you give meveem 1 Add_Course Mavo // you give mavo 2 Add_Course Hashmal // you give hashmal 3 Delete_Course Mavo // 2 is freed. Add_Course Logica // 2 is the minimum number that is free. So you give it to Logica! Simply read the example given the the EX. |
1) dry part is 50% of the grade and wet part is 50% of the grade
right?
2) Add_Lecturer 12 1
Add_Student 1234 1 100
Add_Student 1235 1 80
Factor 12 1233 1236 p 5
the average in the range 1233-1236 will be (105+84)/2
Delete_Student 1234 1
the average in the range 1233-1236 will be 84
is it correct ?
|
1. Yes. 2. Yes. |
1. Is the number of courses in the system , smaller than the num. of lecturerers
(it has significant meaning on our choice of structures for impl.)
2. Can we assume that the time complexity's of Search in Binary search tree,
is O(log n) in averege?
|
1. No... read the homework so you know why. 2. No. Important hint : think well before you start implementing the Data structures. Use data structures in smart ways to get full points. |
if i run factor on students 1...5 and then i add another student with id 3.
will the student with id 3 get the factors that was previously added?
| No. |
Using binary search trees.
|
Well i was asked before if you are alowed to use binary search trees. (NOT AVL or B+ or anything that was proved to be exactly O(logn) ) Many of you seemed very angry on my answer. so for those who want to use binary search trees there are good news. if you prove for me in the dry part that the complexity of insert and delete is O(log n). then i accept your answer BUT.. before you work hard on the proof please pay attention to two notes: 1. The insert order is not random! 2. try to perform a chain of insert and delete on a small paper and see what happens. |
I hope that i make it clear now , for the last time.
Some of you still ask me about binary trees.
|
You can assume that : students Ids are possitive and random . You can use binary trees for the students (without proof) if you think it will help you. But My advice to you .. Think again about the WHOLE Ex... You can do better. |

