讲解strong hints、讲解c/c++,Python编程语言、辅导Notepad++留学生、讲解Java/c++
- 首页 >> Web Hi,
Some of the decisions that I made for this assignment to make it more relevant and interesting are causing unexpected difficulties for some students. And some of the statements that I made in the assignment spec to avoid this, have only made it worse. :(So I need to clarify some things and I think the easiest way to do that is to give some very strong hints about the easiest way to implement the data structures that will give full marks.
So first of all, I was quite clear that you do NOT need to make every operation efficient - so you do NOT need to store bidirectional references.
That means that you have two basic choices; either every loyalty program stores the customers that are subscribed to it, or every customer stores the loyalty programs they are subscribed to. To meet the big O requirements this needs to be either a linked list with each node containing a BST,or a BST with each node containing a linked list - I will leave it to you to work out which one gives the correct big O (especially for operations 4 and 5).
To get full marks you do NOT need any other data structures. You *may* include other data structure that *improve* the big O for some operations, but this will not get you extra marks and will make your program more difficult to write. So only do this if you are bored. ;)
There is one line in particular in the spec that has made several people think they need more:
Unsubscribe: This function will prompt the user for a customer id and loyalty program name. The function will then remove this subscription but will notremove customers or loyalty programs from the database, even if they have no subscriptions.
The bit about not removing customers or loyalty programs was only included to make your life easier, not harder. But I should probably have written that: "The function will then remove this subscription but it is not necessary to remove customers or loyalty programs from the database, even if they have no subscriptions". In other words, you do not need to add code to check to see if a customer or loyalty program has no subscriptions. Whether that customer or loyalty program remains in the database does not matter either way.
Finally, there is one other thing that has been causing difficulty: line endings. This means that each line of your input file ends up with two line endings: \n and\r. You can see this in Notepad++ if you change the view options. There are several ways you can deal with this, but probably the easiest is to edit your file in Notepad++ so that it only includes \n line endings - and then do NOT import the file into your VS project, just copy it into the same directory as your code.
Thank you to all of those people who have started the assignment early and helped find these problems.
Some of the decisions that I made for this assignment to make it more relevant and interesting are causing unexpected difficulties for some students. And some of the statements that I made in the assignment spec to avoid this, have only made it worse. :(So I need to clarify some things and I think the easiest way to do that is to give some very strong hints about the easiest way to implement the data structures that will give full marks.
So first of all, I was quite clear that you do NOT need to make every operation efficient - so you do NOT need to store bidirectional references.
That means that you have two basic choices; either every loyalty program stores the customers that are subscribed to it, or every customer stores the loyalty programs they are subscribed to. To meet the big O requirements this needs to be either a linked list with each node containing a BST,or a BST with each node containing a linked list - I will leave it to you to work out which one gives the correct big O (especially for operations 4 and 5).
To get full marks you do NOT need any other data structures. You *may* include other data structure that *improve* the big O for some operations, but this will not get you extra marks and will make your program more difficult to write. So only do this if you are bored. ;)
There is one line in particular in the spec that has made several people think they need more:
Unsubscribe: This function will prompt the user for a customer id and loyalty program name. The function will then remove this subscription but will notremove customers or loyalty programs from the database, even if they have no subscriptions.
The bit about not removing customers or loyalty programs was only included to make your life easier, not harder. But I should probably have written that: "The function will then remove this subscription but it is not necessary to remove customers or loyalty programs from the database, even if they have no subscriptions". In other words, you do not need to add code to check to see if a customer or loyalty program has no subscriptions. Whether that customer or loyalty program remains in the database does not matter either way.
Finally, there is one other thing that has been causing difficulty: line endings. This means that each line of your input file ends up with two line endings: \n and\r. You can see this in Notepad++ if you change the view options. There are several ways you can deal with this, but probably the easiest is to edit your file in Notepad++ so that it only includes \n line endings - and then do NOT import the file into your VS project, just copy it into the same directory as your code.
Thank you to all of those people who have started the assignment early and helped find these problems.