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
class ListNode: | |
def __init__(self, x): | |
self.val = x | |
self.next = None | |
def reverseList(head: ListNode) -> ListNode: | |
previous = None | |
current = head | |
while current: | |
n = current.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
#include <iostream> | |
#include "queue.h" | |
#include <cstring> | |
#include <cstdlib> | |
#include <cmath> | |
#include <ctime> | |
#include <locale.h> | |
using namespace std; | |
int main() { |
NewerOlder