Skip to content

Instantly share code, notes, and snippets.

View ayusinghi96's full-sized avatar

AYUSH SINGHI ayusinghi96

  • Varanasi
View GitHub Profile
class Car {
private let brand: String
var owner: Owner?
init(brand: String) {
self.brand = brand
}
deinit { print("Car deallocated") }
}
import Foundation
///
/// A file reader class.
///
/// - Note: Here we will decode JSON data from a static file contaning Movies.
///
final class FileReader {
@ayusinghi96
ayusinghi96 / Tree.swift
Last active October 31, 2020 17:15
A swift implementation to create a basic Binary tree and perform inOrder, preOrder and postOrder traversals on the tree.
import Foundation
// MARK: - A node
final class Node {
/// Value of the node
var value: Int
/// Left child node
var left: Node?