This file contains 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
Download from https://www.openssl.org/source/ | |
Open terminal | |
Move to directory holding OpenSSL files | |
Type "open INSTALL" | |
Type "./config" | |
Type "make" | |
Type "make test" | |
Type "make install" |
This file contains 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
// pretends Node is like this: | |
/* Node { | |
int data; | |
List<Integer> neighbors; | |
} | |
*/ | |
public Node bfs(Node head, int findInt) { | |
Node result = new Node(-1); // null node basically | |
if (head == null) { |
This file contains 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
// Uses Node class like below | |
/*Node(int val) { | |
Node next; | |
int val = val; | |
}*/ | |
public HashMap<Integer,Node<Integer>> adjList(Pair pairArr) { | |
if (pairArr.length == 0) { | |
return null; | |
} |
This file contains 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
Node newNode = new Node(yourString); | |
if (table[hashLocation] == null ) { | |
table[hashLocation] = newNode; | |
} else { | |
// iterate through nodes | |
currNode = table[hashLocation]; | |
while (currNode.next != null ) { | |
currNode = currNode.next; | |
} | |
currNode.next = newNode; |
This file contains 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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode(int x) { val = x; } | |
* } | |
*/ | |
public class Solution { | |
public ListNode partition(ListNode head, int x) { |
This file contains 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 class Solution { | |
public int sumNumbers(TreeNode root) { | |
if (root == null) { | |
return 0; | |
} | |
int sum = 0; | |
return dfs(root,sum); | |
} | |
public int dfs(TreeNode root, int sum) { |
This file contains 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 ListNode reverseBetween(ListNode head, int m, int n) { | |
if(m==n) { | |
return head; | |
} | |
ListNode curr = head; | |
ListNode tempM = null; | |
ListNode tempAfterN = null; | |
ListNode tempBeforeM = null; |
This file contains 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 class Solution { | |
public int lengthOfLongestSubstring(String s) { | |
if (s.length() == 0 ) { | |
return 0; | |
} | |
if (s.length() == 1) { | |
return 1; | |
} |
This file contains 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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode(int x) { val = x; } | |
* } | |
*/ | |
public class Solution { | |
public ListNode partition(ListNode head, int x) { |
This file contains 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 Inorder(Node root) { | |
if (root == null) { return;} | |
Inorder(root.left); | |
System.out.print(root.data + " "); | |
Inorder(root.right); | |
} |
NewerOlder