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
| /* Write a function that computes Hamming | |
| distance (# of characters that differ between | |
| two strings. | |
| example: | |
| abcd | |
| abdd | |
| --X- = 1 | |
| */ |
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
| /* Write a function that computes Hamming | |
| distance (# of characters that differ between | |
| two strings. | |
| example: | |
| abcd | |
| abdd | |
| --X- = 1 | |
| */ |
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
| /* Write a function that computes Hamming | |
| distance (# of characters that differ between | |
| two strings) except instead of strings it | |
| takes 2 integers that it converts to binary. | |
| example: 5 is 101, 3 is 011 so the Hamming distance is 2. | |
| // Input is going to be two positive integers | |
| // Output is going to be the total number of characters |
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
| /* Write a function that accepts a singly linked list and returns a | |
| * reversed version of the original linked list "in place" (i.e. without | |
| * creating a second linked list in memory). | |
| * A -> B -> C | |
| * C -> B -> A | |
| * var nodeA = Node('A'); | |
| * var nodeB = nodeA.next = Node('B'); | |
| * var nodeC = nodeB.next = Node('C'); |
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
| /* Write a function that accepts a singly linked list and returns a | |
| * reversed version of the original linked list "in place" (i.e. without | |
| * creating a second linked list in memory). | |
| * A -> B -> C | |
| * C -> B -> A | |
| * var nodeA = Node('A'); | |
| * var nodeB = nodeA.next = Node('B'); | |
| * var nodeC = nodeB.next = Node('C'); |