Posts

Showing posts with the label programming

height checker better option

 Leetcode question of height checker given an array of integers, not in ascending order, find mismatch nodes count https://leetcode.com/problems/height-checker/description/ Typical solution is regular array sort and compare - O(n logn) Counting sort or use approach of buckets then scan again - O(n) counting sort approach - https://leetcode.com/problems/height-checker/solutions/299910/java-o-n-no-sort/ bucket based solution - https://leetcode.com/problems/height-checker/solutions/299910/java-o-n-no-sort/

Installing packages for R in windows

R is a statistical programming language. It is Dynamically typed. There are many ways to install packages for R. 1. Command line 2. R GUI     a. Launch R gui console     b. Direct install thru Internet Packages -> Install Packages -> Select a HTTPS CRAN mirror -> select the package you wish to install.         This will install dependency packages also.                                                                 OR        Install from Zip file. Use this option when there is a proxy level rejection to contact to Internet from R Gui.         Download the binary zip file related to 'R' package Packages -> Install package from Local Zip file 3. R studio