Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

invert

// invert binary tree : (right node >> left node && left node >> right node )
 const invertTree =(root)=>{
if(root===null) return root;
  let queue =[root] ; 
  while(queue.length>0){

let node =queue.shift() ; 
if(node !=null){
  let hold = node.left ;
  node.left =node.right; 
  node.right =hold ; 
  if(node.left) queue.push(node.left) ;

  if(node.right) queue.push(node.right) ;
}
  }
  
return root;

 }
Comment

invert

#!/bin/sh

# Make an inverse binary image mask (switch the 1s and 0’s)

# Create the inverse mask (Mark Jenkinson's approach. Very clever:
# Multiply by negative 1, then add 1). Make sure you pass in a binary mask)

fslmaths mask -mul -1 -add 1 -bin mask_inverse 

# OR use -binv flag

fslmaths mask -binv mask_inverse
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu startup takes longer after swap file changed 
Shell :: how to configure a drive as hotspare linux 
Shell :: fsl fslmath mask sphere 
Shell :: git conflicts in yarn-lock 
Shell :: command line filters 
Shell :: watchman fatal error: openssl/sha.h: No such file or directory 
Shell :: scan network ip powershell comands 
Shell :: create json from cmd 
Shell :: how to install minfied js 
Shell :: How do I push a new local branch to a remote Git repository and track it too? 
Shell :: cannot spawn askpass: No such file or directory 
Shell :: conan set option in command line 
Shell :: intergrete $var in the middle of a file name bash 
Shell :: edit powershell profiles (linux) 
Shell :: installing heroku for deployment through command line 
Shell :: unrar into directory 
Shell :: visidata save file 
Shell :: apache terminal count files in folder 
Shell :: Basic auth HTTP Powershell 
Shell :: Create github repo in command line 
Shell :: vscode command line run 
Shell :: install lua in ubuntu 
Shell :: autoreconf: command not found 
Shell :: npm otp-generator 
Shell :: Errors were encountered while processing: ubuntu 
Shell :: grep Matching options 
Shell :: Turn On Nested Virtualization If You’Re Running The Host System In A Windows Box 
Shell :: 1password cli install 
Shell :: hyper-v mobylinuxvm primary ubuntu what is the login 
Shell :: uepic games github 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =