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
#include <bits/stdc++.h> | |
using namespace std; | |
/* Link list Node */ | |
struct Node { | |
int data; | |
struct Node* next; | |
}; | |
// A utility function to create a new node |
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 Node: | |
# initialize a node | |
def __init__(self, item): | |
self.item = item | |
self.next = None | |
class LinkedList: | |
def __init__(self): |
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
/* Creating Linked List in C++ */ | |
#include <bits/stdc++.h> | |
// Node | |
class Node { | |
public: | |
int data; | |
Node* next; | |
Node(int data=0){ | |
this->data = data; | |
} |
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
def bubbleSort(array): | |
for i in range(len(array)): | |
# track of swapping | |
swapped = False | |
for j in range(0, len(array) - i - 1): |
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
def selectionSort(array, size): | |
for step in range(size): | |
min_idx = step | |
for i in range(step + 1, size): | |
# to sort in descending order, change > to < in this line | |
# select the minimum element in each loop |
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
// | |
template <class T> | |
int indexOfMax(T a[], int size) { | |
int temp = 0; | |
int index = 0; | |
for ( int i = 0; i < size; i++ ) { | |
if ( a[i] > temp ) { | |
temp = a[i]; | |
index = i; |
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
#![no_std] | |
#![no_main] | |
use panic_halt; | |
use cortex_m::asm::delay; | |
use cortex_m_rt::entry; // The runtime | |
use embedded_hal::digital::v2::OutputPin; // the `set_high/low`function | |
// Hardware abstract Layer | |
use stm32f1xx_hal::{delay::Delay, pac, prelude::*,serial::{Config, Serial}}; // STM32F1 specific functions | |
use stm32f1xx_hal::usb::{Peripheral, UsbBus}; |
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
#![no_std] | |
#![no_main] | |
use panic_halt; | |
use cortex_m::asm::delay; | |
use cortex_m_rt::entry; // The runtime | |
use embedded_hal::digital::v2::OutputPin; // the `set_high/low`function | |
use stm32f1xx_hal::{delay::Delay, pac, prelude::*}; // STM32F1 specific functions | |
use stm32f1xx_hal::usb::{Peripheral, UsbBus}; |
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] | |
2975c.v.fwmrm.net=127.0.0.1 | |
2mdn.net=127.0.0.1 | |
ad.doubleclick.net=127.0.0.1 | |
ad-g.doubleclick.net=127.0.0.1 | |
ad.mo.doubleclick.net=127.0.0.1 | |
ads.doubleclick.net=127.0.0.1 | |
adservice.google.com=127.0.0.1 | |
ads.youtube.com=127.0.0.1 | |
ad.youtube.com=127.0.0.1 |
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 | |
echo "Select any one interface :"; | |
interface="" | |
for iface in $(ifconfig | cut -d ' ' -f1| tr ':' '\n' | awk NF) | |
do | |
interface+="$iface" | |
interface+=" " | |
done | |
# it splits strings using whitespace as delimeter and shows us which one to select using digits |
NewerOlder