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 numpy as np | |
| import matplotlib.pyplot as plt | |
| from matplotlib.animation import FuncAnimation | |
| # Create the figure and the axes | |
| fig = plt.figure() | |
| ax = fig.add_subplot(111, title = 'Sine wave animation') | |
| # Initialize the axes | |
| ax.set_xlim(0, 2*np.pi) |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits import mplot3d | |
| # Create the figure and the axes | |
| fig = plt.figure() | |
| ax = fig.add_subplot(111, projection = '3d', title = 'A 3D curve') | |
| # Prepare the data points | |
| z = np.linspace(-4*np.pi, 4*np.pi, 100) |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| # Create the figure and the axes | |
| fig = plt.figure() | |
| ax = fig.add_subplot(111, title = 'Sine wave') | |
| # Prepare the datapoints | |
| x = np.linspace(0, 2*np.pi, 100) | |
| y = np.sin(x) |
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 java.util.Queue; | |
| import java.util.LinkedList; | |
| class Node{ | |
| int data; | |
| Node left, right; | |
| Node(int data){ | |
| this.data = data; | |
| this.left = null; |
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 Node{ | |
| int data; | |
| Node next; | |
| Node(int data){ | |
| this.data = data; | |
| this.next = null; | |
| } | |
| } |
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 Node{ | |
| int data; | |
| Node next; | |
| Node(int data){ | |
| this.data = data; | |
| this.next = null; | |
| } | |
| } |
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 SegmentTree{ | |
| int[] tree; | |
| SegmentTree(int n){ | |
| tree = new int[n]; | |
| } | |
| void build(int[] arr, int node, int start, int end){ | |
| if(start == end){ | |
| tree[node] = arr[start]; |
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 Node: | |
| def __init__(self, data): | |
| self.data = data | |
| self.left = None | |
| self.right = None | |
| class BinaryTree: | |
| def __init__(self): | |
| self.root = None |
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 Node: | |
| def __init__(self, data): | |
| self.data = data | |
| self.left = None | |
| self.right = None | |
| class BinaryTree: | |
| def __init__(self): |
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 Node{ | |
| int data; | |
| Node left, right; | |
| Node(int data){ | |
| this.data = data; | |
| this.left = null; | |
| this.right = null; | |
| } | |
| } |