This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| struct node { | |
| int value; | |
| node* next; | |
| }; | |
| int add_to_all(node** top_ref, int num) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test_remove(self): | |
| self.tree = self.build_big_tree() | |
| expected = [ 6, 8, 9, 10, 11, 12, 14, 20, 27, 28 ] | |
| # ensure it starts out as intended. this should always pass | |
| actual = [] | |
| self.private_inorder_fetch(self.tree.root_node, actual) | |
| self.assertEqual(expected, actual, "Initial tree was malformed. Our fault, not yours") | |
| # remove the top node, 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print "Hello World" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void remove(node** parent, int offset) { | |
| node* cursor = *parent; | |
| if (cursor->next==NULL || offset > size(*parent)) { | |
| return; | |
| } else if (offset==0) { | |
| cursor=cursor->next; | |
| } else { | |
| for (int i=1;i<offset;i++) { | |
| cursor=cursor->next; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ cd ~/Projects/retrograde/master_grade_script/ | |
| ~/Projects/retrograde/master_grade_script $ ./grade.py -h | |
| usage: grade.py [-h] | |
| instructor_dir assignment student_id student_file | |
| [student_file ...] | |
| positional arguments: | |
| instructor_dir top level directory for instructor assignments | |
| assignment specify the homework assignment (e.g. 'linked list') | |
| student_id specify the student (e.g. '978675643') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <iostreams> | |
| int main() | |
| cout << "Hi"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String[] args) { | |
| System.out.println("This is almost the simplest Java program possible."); | |
| } |
NewerOlder