https://play.golang.org/p/3HpTAxoPC6l

# Category: Data Structure and Algorithm

The term **data structure** refers to the organization of data in a computer’s memory, in order to retrieve it quickly for processing. It is a scheme for data organization to decouple the functional definition of a data structure from its implementation. A data structure is chosen based on **the problem type** and the** operations performed** on the data.

## Create and Print a 2D Slice

https://play.golang.org/p/F5MTsF_Z1J1

## Linked List

Linked lists are linear data structures that hold data in individual objects called nodes. These nodes hold both the data and a reference to the next node in the list. Linked lists are often used because of their efficient insertion and deletion. They can be used to implement stacks, queues, and other abstract data types

## Big-O Chart Comparision

Credits to the contributors from biocheatsheet.com

## Factorial (both not recursive and recursive)

## FizzBuzz

For numbers which are divisible of both 3 and 5, print “FizzBuzz” instead of the number. Divisible by 3 print “Fizz” and divisible by 5 print “Buzz”

## Binary Search

The time complexity of this algorithm is in the order of O(log n). The binary search algorithm compares the input value to the middle element of the sorted collection. func Search(n int, f func(int) bool) int Search uses binary search to find and return the smallest index i in [0, n) at which f(i) is… Continue reading Binary Search

## Linear Search

The time complexity of the linear search algorithm is O(n). This means that the running time increases at most linearly with the size of the input.

## Sorting: Bubble

The bubble sort algorithm is a sorting algorithm that compares a pair of neighboring elements and swaps them if they are in the wrong order. https://play.golang.org/p/1ob1N-sZKmp Note: No nested loop used help in reducing the unnecessary looping of all element even a single pair of the unsorted list.

## Slice, for, len(), cap(), append, copy

Shortcoming of Go array is address by Go slice. It can be appended to elements after the capacity has reached its size. Slices are dynamic and can double the current capacity in order to add more elements. https://play.golang.org/p/_8fqAbg2cUJ Slice and Functions ( call by reference) https://play.golang.org/p/Sc2yD7rXpRl