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
| func linearSearch<T:Equatable>(onArray array: Array<T>, forItem item: T) -> Int { | |
| for (index, i) in array.enumerated() where i == item { | |
| return index | |
| } | |
| return -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
| // Charles Kenney | |
| const isOpening = (b) => b === '{' || b === '[' || b === '('; | |
| const closing = (b) => { | |
| switch(b) { | |
| case '{': | |
| return '}'; | |
| case '[': | |
| return ']'; |
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 "main.h" | |
| using namespace std; | |
| int main() { | |
| Queue q; | |
| for (int i = 1; i < 4; ++i) { | |
| q.enqueue(i); | |
| } |
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
| func isPalindrome(_ s: String) -> Bool { | |
| return s == Array(s.characters).reversed().map{String($0)}.reduce("",+) | |
| } |
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
| // Given a string of space seperated components, | |
| // you can use the following lines to map the | |
| // components to arrays. Useful for reading input | |
| // from the standard input stream in problem sets. | |
| // (Swift 4) | |
| //: Read an array of strings | |
| let strings = readLine()!.split(separator: " ").map { String($0) } | |
| //: Read an array of characters |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <div id="wrapper"> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>jQuery Calculator</title> | |
| <!-- Added link to the jQuery Library --> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
| <!-- Added a link to Bootstrap--> |
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
| // | |
| // main.swift | |
| // Open Applications | |
| // | |
| // Created by Charles Kenney on 10/16/17. | |
| // Copyright © 2017 Charles Kenney. All rights reserved. | |
| // | |
| import Foundation | |
| import Cocoa |
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 axios from 'axios' | |
| import uuid from 'uuid' | |
| import { makeQuery } from '../utils' | |
| /** | |
| * Constants | |
| */ | |
| export const ADD_CITY_AND_FETCH = 'ADD_CITY_AND_FETCH' | |
| export const FETCH_WEATHER_ALL = 'FETCH_WEATHER_ALL' |
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 <vector> | |
| template <class T> | |
| void bubble_sort(std::vector<T> &vec) { | |
| bool didSwap; | |
| do { | |
| didSwap = false; | |
| for (int i = 0; i < vec.size() - 1; i++) { |
OlderNewer