Skip to content

Instantly share code, notes, and snippets.

View VizShaT's full-sized avatar
🎯
Focusing

Vijay Shankar Gupta VizShaT

🎯
Focusing
View GitHub Profile
// Scope - Where are you in the code and what you can see from there.
// Closure- function can always remeber the variables that they could see at creation.
/*
var name = "Veer";
function sayName(){
console.log(name);
}
<style id="jsbin-css">
div {
height: 40px;
padding: 20px;
border: 8px solid green;
background: yellow
}
/*
.two {
@VizShaT
VizShaT / JavaScriptLearning.md
Created November 27, 2018 21:10
JavaScript Learning Resource
@VizShaT
VizShaT / Absolute-List-Sorting.cpp
Created September 3, 2016 11:39
Sort linked list which is already sorted on absolute values - GeeksforGeeks
/*
http://www.practice.geeksforgeeks.org/problem-page.php?pid=700234
http://www.geeksforgeeks.org/sort-linked-list-already-sorted-absolute-values/
*/
/* The structure of the Linked list Node is as follows:
struct Node
{
Node* next;
int data;
}; */
@VizShaT
VizShaT / Insert-Node-In-DLL.cpp
Created September 2, 2016 16:52
Insert a node in Doubly linked list - GeeksforGeeks
/*
http://www.practice.geeksforgeeks.org/problem-page.php?pid=700232
http://quiz.geeksforgeeks.org/doubly-linked-list/
*/
/* a node of the doubly linked list
struct node
{
int data;
struct node *next;
struct node *prev;
@VizShaT
VizShaT / Cycle-Detection.cpp
Created September 1, 2016 17:22
Cycle Detection - Hackerrank
/*
http://www.geeksforgeeks.org/write-a-c-function-to-detect-loop-in-a-linked-list/
*/
bool has_cycle(Node* head) {
Node *slow = head;
Node *fast = head;
while(slow && fast && fast->next){
slow = slow->next;
@VizShaT
VizShaT / Deleted-Duplicate-Node-LL.cpp
Created September 1, 2016 16:36
Delete duplicate-value nodes from a sorted linked list - Hackerrank
Node* RemoveDuplicates(Node *head)
{
Node *prev = head;
Node *current = head->next;
Node *temp = NULL;
while(current != NULL){
if(current->data == prev->data){
temp = current;
prev->next = current->next;
@VizShaT
VizShaT / Get-Node-Value.cpp
Created September 1, 2016 16:22
Get Node Value - Hackerrank
int GetNode(Node *head,int positionFromTail)
{
Node *current = head;
int count = 0;
while(current != NULL){
count++;
current = current->next;
}
int position = count - positionFromTail;
current = head;
@VizShaT
VizShaT / Clock-Multipication.cpp
Created August 12, 2016 08:42
12 hour clock Multiplication - GeeksforGeeks
/*
http://ideone.com/NzL6KP
http://www.practice.geeksforgeeks.org/problem-page.php?pid=981
*/
#include <iostream>
using namespace std;
int main() {