GithubHelp home page GithubHelp logo

eating247 / assignment_data_structures Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vikingeducation/assignment_data_structures

0.0 2.0 0.0 192 KB

Buckets and buckets of data!

Ruby 100.00%

assignment_data_structures's Introduction

assignment_data_structures

Buckets and buckets of data!

A Ruby-based data structures assignment for the Viking Code School which uses arrays, hashes, linked lists, structs, graphs and trees

Tingting Wang

Determine the Big O of the following (and ideally explain briefly why):

Accessing an item by index in an array O(1); The process locating the correct position in memory doesn't change or become more intensive as the size of the array changes. Unshifting a new item into the beginning of an array O(n); involves rebuilding entire array because indexes of other values have also changed Pushing an item onto the end of an array O(n); also involves rebuilding because array must find new place in memory to accomodate added memory of new value Upcasing a String O(n); analogous to tranversing and updating all values in an array Reversing a String O(n); process involves traversing through all values of the string, therefore dependent on size of structure The Enumerable#each method O(n); iterations increase as elements increase The Enumerable#include? method O(n) Finding the max of an array O(n) splitting a String O(n) Inserting a value to a Hash O(1) Retrieving the keys of a Hash ({ foo: "bar" }.keys) O(1)

assignment_data_structures's People

Contributors

eating247 avatar eriktrautman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.