This file contains hidden or 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 datastructures; | |
import java.util.ArrayList; | |
public class checkLoop { | |
Node head = null; | |
Node last = null; | |
int size = 0; | |
static class Node { |
This file contains hidden or 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 datastructures; | |
public class StackUsingLL { | |
private Node top = null; | |
private Node head = null; | |
private int size = 0; | |
class Node { | |
int data; |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
struct node { | |
struct node* parent; | |
struct node* left; | |
int value; | |
struct node* right; | |
}; |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
#define MAX 5 | |
int front = 0; | |
int last = 0; | |
int queue[MAX]; | |
void enqueue(int val) { | |
queue[last++] = val; |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
#define MAX 10 | |
int top = -1; | |
int stack[MAX]; | |
void push(int val) { | |
stack[++top] = val; | |
printf("Value Pushed!\n"); |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
// circular linked list using Singly Linked list | |
struct circular { | |
int value; | |
struct circular* next; | |
}; |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
struct doubly { | |
struct doubly* prev; | |
int value; | |
struct doubly* next; | |
}; | |
typedef struct doubly* node; |
This file contains hidden or 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<stdio.h> | |
#include<stdlib.h> | |
struct list { | |
int value; | |
struct list* next; | |
}; | |
struct list* root = NULL; | |
struct list* lastNodeAddr = NULL; |