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 'package:flutter/material.dart'; | |
| import 'package:letutor/mock_data.dart'; | |
| class BookAppointment extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| var title = Padding( | |
| padding: EdgeInsets.only(top: 20.0, left: 12.0), | |
| child: Text( | |
| "Create Appointment", |
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 'package:flutter/material.dart'; | |
| class OneBorderContainer extends StatefulWidget { | |
| @override | |
| _OneBorderState createState() => _OneBorderState(); | |
| } | |
| class _OneBorderState extends State<OneBorderContainer> { | |
| @override | |
| Widget build(BuildContext context) { |
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 operator | |
| import random | |
| # an individual with bigger fitness is more likely to succeed. | |
| def fitness(password, test_word): | |
| if len(test_word) != len(password): | |
| return | |
| score = 0 | |
| for i in range(len(password)): |
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 random | |
| population = 200 | |
| generations = 0 | |
| mutation = 0.01 | |
| alphabet = "abcdefghijklmnopqrstuvwxyz! " | |
| target = "subscribe to howcode!" | |
| output = "" | |
| data = [] |
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 TreeNode: | |
| def __init__(self, key, parent=None, left=None, right=None): | |
| self.key = key | |
| self.parent = parent | |
| self.left = left | |
| self.right = right | |
| class BinarySearchTree: | |
| 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 BinaryMaxHeap: | |
| def __init__(self): | |
| self.size = -1 | |
| self.heap = [] | |
| def parent(self, i): | |
| return (i - 1) // 2 | |
| def left_child(self, i): | |
| return 2 * i + 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
| import ctypes | |
| class DynamicArray: | |
| def __init__(self): | |
| self.capacity = 1 | |
| self.size = 0 | |
| self.array = self._make_array(self.capacity) | |
| def append(self, elt): | |
| if self.size == self.capacity: |
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 Stack: | |
| def pop(self): | |
| pass | |
| def top(self): | |
| pass | |
| def push(self, key): | |
| pass |
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, key, next=None, prev=None): | |
| self.key = key | |
| self.next = next | |
| self.prev = prev | |
| class DoublyLinkedList: | |
| def __init__(self, head=None): | |
| self.head = None | |
| self.tail = 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 BinaryTree: | |
| def __init__(self, key, left=None, right=None): | |
| self.key = key | |
| self.left = left | |
| self.right = right | |
| def insert_left(self, key): | |
| if self.left: | |
| node = BinaryTree(key) | |
| node.left = self.left |
NewerOlder