Goal of analysis is to identify trends and relationships within data so you can accurately answer the questions you're asking. Most data is organized in tables, always have data in the right format. Definition : Analysis // process used to make sense of the data collected Sorting // involves arranging data into a meaningful order to make it easier to understand, analyze, visualize Outliers // data points that are very different from similarly collected data and might not be reliable values Filtering // extracting specific data that meet certain criteria while hiding the rest Customized sort order // when you sort data in a spreadsheet using multiple conditions The 4 phases of analysis: 1. Organize data // getting the right data in the right size and order - Sorting : arrange data in meaningful order ...
Dynamic Programming - Parts PART 1 - Memoization P ART 2 - Tabulation Dynamic Programming with Fibonacci Example Recursion: Slow because time complexity is O(2^n) func fibR (x int ) int { if x <= 2 { return 1 } return fibR (x- 1 ) + fibR (x- 2 ) } Dynamic Way Example Recursion with Stored Value: // Fast because it removes duplicate processes by checking map. // Tail recursion-ish // Results are hitchhiking each recursive call func fibR2 (x int , y map [ int ] int ) int { if _ , ok := y[x]; ok { return y[x] } if x <= 2 { return 1 } y[x] = fibR2 (x- 1 , y) + fibR2 (x- 2 , y) return y[x] }
Lists: // are like array but flexible. arrays are fixed lengths while list can be flexible with adding and removing. List Declaring: List<dataType> variableName = new List<dataType>(); // initialize empty list List<int> variableName = new List<int>{5,1,3,5,3}; // initializes a filled list List Indexing: // Same as array listName[0]; List Methods: Add() Method: listVariable.Add(newValueToAdd); // adds a new value to the list at the end of the list Count Method: listVariable.Count; // returns the length of the list Insert() Method: listVariable.Insert(index, value); // inserts a value at a specified location, moving other values up/down to make space Remove() Method: listVariable.Remove(value); // removes the FIRST appearance of a value from the list RemoveAt() Method: listVariable.RemoveAt(index); // removes the value at the specified index Contains() Method: listVariable.Contains(valueToSearch); // returns true or false if found Clear() Method: listVariable...
Comments
Post a Comment