This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* C++ program to find LCA of n1 and n2 using one traversal of Binary Tree. | |
It handles all cases even when n1 or n2 is not there in Binary Tree */ | |
#include <iostream> | |
using namespace std; | |
// A Binary Tree Node | |
struct Node | |
{ | |
struct Node *left, *right; | |
int key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python3 program to convert a given Binary | |
# Tree to Doubly Linked List | |
class Node: | |
def __init__(self, data): | |
self.data = data | |
self.left = self.right = None | |
class BinaryTree: | |
root, head = None, None | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A C++ program that returns true if there is a Pythagorean | |
// Triplet in a given array. | |
#include <algorithm> | |
#include <iostream> | |
using namespace std; | |
// Returns true if there is a triplet with following property | |
// A[i]*A[i] = A[j]*A[j] + A[k]*[k] | |
// Note that this function modifies given array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ code for k largest elements in an array | |
#include <bits/stdc++.h> | |
using namespace std; | |
void kLargest(int arr[], int n, int k) | |
{ | |
// Sort the given array arr in reverse | |
// order. | |
sort(arr, arr + n, greater<int>()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Schedule Library imported | |
import schedule | |
import time | |
# Functions setup | |
def sudo_placement(): | |
print("Get ready for Sudo Placement") | |
def good_luck(): | |
print("Good Luck for Test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DSASelectionObserver < Sketchup::SelectionObserver | |
attr_accessor :distance | |
attr_accessor :count | |
attr_accessor :model | |
def initialize(model) | |
@distance = 0.15 | |
@count = 0 | |
@model = model | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sketchup.rb' | |
# unknown origin or usage rights... | |
module BR_push_pull | |
def BR_push_pull.main | |
model = Sketchup.active_model | |
selection = model.selection | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Animations; | |
public class game_animator : MonoBehaviour { | |
[MenuItem("DSALAB/Create Controller")] | |
static void CreateController() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
head -2 $1 | tail -1 > $1_oneline | |
filesize=$(du -b $1 | cut -f -1) | |
linesize=$(du -b $1_oneline | cut -f -1) | |
rm $1_oneline | |
echo $(expr $filesize / $linesize) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=1 | |
for i in *.jpg; do | |
new=$(printf "%04d.jpg" "$a") #04 pad to length of 4 | |
mv -i -- "$i" "$new" | |
let a=a+1 | |
done |