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
Credits to the contributors from biocheatsheet.com
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”
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
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.
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.
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