Thanks for the lab sir, this one was a lot more challenging than the last few. I felt I learned a lot more about Linked Lists from this lab than I did about GUI or Recursion from the last two labs. With that being said, is there any possibility of assigning some "Exam Style" or "Exam Level" practice problems that integrate the concepts we have covered in this course. I am having trouble structuring a study plan for this final exam, specifically for the programming portion, as the textbook does not treat these concepts in the same respect we have been approaching them in class (All practice problems in the text are the role of the architect, not the role of the implementer, in my opinion). Also, we haven't had any real practice with searching and sorting algorithms. As you said on the first day of class, the key to success in the course is simple: Practice, Practice, Practice. Can you please help me practice more?
I have question about Lab8. I know that each array is supposed to be placed a single position, however, the Node class only accepts data of type String and we're not allowed to modify that part of the code.
My question is: How do we store the array data at one particular Node if the Node class doesn't accept arrays?
Just to follow up on my question. Are we allowed to write an internal toString() method to convert the array into one string and then store that string as data in the Node?
Hi sir, was wondering if you are going to put up the solutions for Lab 6 and 7 up. it really helped when you posted them up for lab 5 and lab 5a. thanks
This is just me but I think you are supposed to insert each string in the array as a node in the linked list. So you wouldn't need a private toString() method to convert the entire array to a single string.
The thing is, though, you're given only one position value, which is where the entire array should be located. I understand that this means the entire array should be stored at ONE Node. For this to be possible the array needs to be a String or there's probably something I missed and there's another way to do it.
If you read the documentation of the add(int, String[]) method, it says:
"Takes an array of Strings as an argument, and adds them to the list, starting at the given position. Existing data at position and later are moved down by newData.length positions"
So, from my understanding, it wont add at just one position. It will add the first element of newData[] at that position of argument, and each consecutive elements at previous position + 1. Basically, nth position of newData[] will be added at position + n, where (0 <= n < newData.length).
Sir would it be possible to put up the last couple of your in-class methods on the website? the last version available is march 18th, and I find the classes that you do during the lecture very helpful resources
Honestly, I understand that it's a work in progress, but it looks so... stupid. The guy looks like he's dancing in front of his computer.
I can already imagine that Google comes up with a very strict "dance" routine to write out an email and teenagers all over the world will find short cuts by break-dancing instead!
Side note: How in the world does a hand wave translate into Barbados at 1:16?
He said 54,327,921 times in class that the final written test and the final lab test will take place at the same time and on the same day. You write one and then immediately the other.
Yes Can anyone please post the solution to lab 8? I know the add method is similar to the add method already provided but I can't happen to figure out how to do it? Thanks
For the mutate method? I was wondering that we don't have a setData method how would I set the data there? I made it walk from the head to the position and at that position i'm thinking what should I do?
@Woody Why did you delete it? I think we just need to change the data at the given position, No? And what did you check in the if statement?
So basically what you did is you deleted the whole node at the given position and then you created a new Node at the same position with the passed Data. But what if the node is null at the position? I ain't no expert but don't you think there will be something wrong with it if the node is empty at the given position?
@12:44 My method is similar to yours as well. Maybe we both are wrong and maybe Woody is right but lets wait for Professor Eckford for the feedback.
Thanks for the lab sir, this one was a lot more challenging than the last few. I felt I learned a lot more about Linked Lists from this lab than I did about GUI or Recursion from the last two labs. With that being said, is there any possibility of assigning some "Exam Style" or "Exam Level" practice problems that integrate the concepts we have covered in this course. I am having trouble structuring a study plan for this final exam, specifically for the programming portion, as the textbook does not treat these concepts in the same respect we have been approaching them in class (All practice problems in the text are the role of the architect, not the role of the implementer, in my opinion). Also, we haven't had any real practice with searching and sorting algorithms. As you said on the first day of class, the key to success in the course is simple: Practice, Practice, Practice. Can you please help me practice more?
ReplyDeleteI have question about Lab8. I know that each array is supposed to be placed a single position, however, the Node class only accepts data of type String and we're not allowed to modify that part of the code.
ReplyDeleteMy question is: How do we store the array data at one particular Node if the Node class doesn't accept arrays?
I'd appreciate any help/direction.
Thank you.
Just to follow up on my question. Are we allowed to write an internal toString() method to convert the array into one string and then store that string as data in the Node?
ReplyDeleteHi sir, was wondering if you are going to put up the solutions for Lab 6 and 7 up. it really helped when you posted them up for lab 5 and lab 5a. thanks
ReplyDeleteThis is just me but I think you are supposed to insert each string in the array as a node in the linked list. So you wouldn't need a private toString() method to convert the entire array to a single string.
ReplyDelete@Dennis
ReplyDeleteThe thing is, though, you're given only one position value, which is where the entire array should be located. I understand that this means the entire array should be stored at ONE Node. For this to be possible the array needs to be a String or there's probably something I missed and there's another way to do it.
@Anonymous 6:41,
ReplyDeleteIf you read the documentation of the add(int, String[]) method, it says:
"Takes an array of Strings as an argument, and adds them to the list, starting at the given position. Existing data at position and later are moved down by newData.length positions"
So, from my understanding, it wont add at just one position. It will add the first element of newData[] at that position of argument, and each consecutive elements at previous position + 1. Basically, nth position of newData[] will be added at position + n, where (0 <= n < newData.length).
Sir would it be possible to put up the last couple of your in-class methods on the website? the last version available is march 18th, and I find the classes that you do during the lecture very helpful resources
ReplyDeleteMay i know when will we have the 3rd lab test?
ReplyDeleteor does the exam period include that part
http://mail.google.com/mail/help/motion.html
ReplyDelete@Woody
ReplyDeleteHonestly, I understand that it's a work in progress, but it looks so... stupid. The guy looks like he's dancing in front of his computer.
I can already imagine that Google comes up with a very strict "dance" routine to write out an email and teenagers all over the world will find short cuts by break-dancing instead!
Side note: How in the world does a hand wave translate into Barbados at 1:16?
@April 1, 2011 10:43 AM
ReplyDeleteHe said 54,327,921 times in class that the final written test and the final lab test will take place at the same time and on the same day. You write one and then immediately the other.
@2:49 PM
ReplyDeleteYou'll need a movement for every word.
It seems like if position is negative or zero, the node can still be added in front of the head.
ReplyDeleteCan anyone post the full solution for Lab 8 please?
ReplyDeleteYes Can anyone please post the solution to lab 8? I know the add method is similar to the add method already provided but I can't happen to figure out how to do it? Thanks
ReplyDeleteFor the mutate method? I was wondering that we don't have a setData method how would I set the data there?
ReplyDeleteI made it walk from the head to the position and at that position i'm thinking what should I do?
I did this for the mutate method
ReplyDeleteLinkedList.Node m = walk(position);
if(m != null)
{
m.data = newData;
return true;
}
else
return false;
worked fine for me
Mine is like this. Hope this is correct.
ReplyDeletepublic boolean mutate(int position, String newData)
{
if(position <= this.size-1)
{
this.delete(position);
this.add(position, newData);
return true;
}
return false;
}
@Woody
ReplyDeleteWhy did you delete it? I think we just need to change the data at the given position, No? And what did you check in the if statement?
So basically what you did is you deleted the whole node at the given position and then you created a new Node at the same position with the passed Data. But what if the node is null at the position? I ain't no expert but don't you think there will be something wrong with it if the node is empty at the given position?
@12:44
My method is similar to yours as well. Maybe we both are wrong and maybe Woody is right but lets wait for Professor Eckford for the feedback.
Can anyone please post the add method?
Or this.
ReplyDeletepublic boolean mutate(int position, String newData)
{
if(this.delete(position))
{
this.add(position, newData);
return true;
}
return false;
}
@ 1:32 PM
ReplyDeleteI think:
if(position <= this.size-1)
checks if position is there is a node at the position because position is less than than the size of the linked list. I didn't think of your way.
I didn't try your method but what someone described above is working perfect. I'm pretty sure yours is gonna work too
ReplyDeleteIt works I just tested it.
ReplyDelete=)
@ Woody:
ReplyDeleteCan you post your add method please? I'm done with the rest.
public boolean add(int position, String[] newData)
ReplyDelete{
Node n = this.walk(position);
if(n != null)
{
for(int i = 0; i < newData.length; i++)
{
this.add(position, newData[i]);
position++;
}
return true;
}
return false;
}
||Off topic||
ReplyDeleteDoes section M have a class tomorrow(Monday, April 4th)?
I know that we have a make-up class on April 5th. Not so sure about 4th.
We are in class right now (Monday, April 4th) and there is no class tomorrow (Tuesday, April 5th)
ReplyDeleteCan we get an extra practice lab before the exam? Preferably one the involves both recursion and linked lists.
ReplyDeleteThank you
that*
ReplyDelete