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
package datastructure; | |
/** | |
* | |
* @author yadha02 | |
* | |
*/ | |
public class Stack_ArrayImplementation { | |
//declare global variable | |
static int stackSize = 11; | |
static int[] stack = new int[stackSize]; |
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
public class Rajat { | |
static int fun(int[] ary, int l, int r) { | |
int mid = l + (r-l+1)/2; | |
if(ary[mid-1]>ary[mid] && ary[mid] < ary[mid+1]) {//found index | |
return mid; | |
} | |
if(ary[mid-1]>ary[mid] && ary[mid] > ary[mid+1]) {//go right | |
return fun(ary, mid, r); | |
} |
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
/** | |
* | |
* @author Hariom Yadav - Nov 3, 2019 | |
* | |
*/ | |
class Stack1{ | |
//know something | |
int top; | |
int size; | |
String[] stack; |
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
package ds9thNovNight; | |
/** | |
* | |
* @author Hariom Yadav - Nov 9, 2019 | |
*build max heap from array, build min heap, delete root node i.e. delete 1st node and internally calls heapify (min or max) | |
*/ | |
//data structure used is array | |
public class Heap_BuildHeap_heapifyMin_Max_Delete { | |
public static void main(String[] args) { | |
int[] arr = {12,1,3,34,9,5}; |
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
package ds9thNovNight; | |
/** | |
* | |
* @author Hariom Yadav - Nov 9, 2019 | |
* | |
*/ | |
//Data structure | |
class Node{ | |
//know something | |
int 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
package ds_10th_Nov; | |
import java.util.Vector; | |
/** | |
* | |
* @author Hariom Yadav - Nov 10, 2019 | |
* | |
*/ | |
public class Heap_insert { | |
static final int MAX = 1000; |
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
package ds_collection_n_LRU_23rd_nov; | |
import java.util.Deque; | |
import java.util.HashSet; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
/** | |
* | |
* @author Hariom Yadav - Nov 23, 2019 | |
* |
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
{ | |
"Comment": "A simple AWS Step Functions state machine that automates a call center support session.", | |
"StartAt": "ProcessTransaction", | |
"States": { | |
"ProcessTransaction": { | |
"Type" : "Choice", | |
"Choices": [ | |
{ | |
"Variable": "$.TransactionType", | |
"StringEquals": "PURCHASE", |
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
{ | |
"Comment":"Transaction Processor State Machine Using SQS", | |
"StartAt":"ProcessTransaction", | |
"States":{ | |
"ProcessTransaction":{ | |
"Type":"Pass", | |
"Next":"BroadcastToSqs" | |
}, | |
"BroadcastToSqs":{ | |
"Type":"Task", |
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
select * from movies; | |
-- create table + insert data + drop delete table | |
create table emp( | |
id int primary key auto_increment, | |
depid int default 1, | |
salary float default 0, | |
name varchar(5) not null | |
); | |
insert into emp(depid, salary, name) |
OlderNewer