View circular-linked-list.c
#include <stdio.h>
#include <malloc.h>
typedef struct node {
int data;
struct node* next;
} Node;
View add-node-double-linked-list.c
#include <stdio.h>
#include <malloc.h>
typedef struct node {
int data;
struct node* next,
* prev;
} Node;
View doubly-linked-list-pointer-to-pointer.c
#include <stdio.h>
#include <malloc.h>
typedef struct node {
int data;
struct node* next,
* prev;
} Node;
View Boundary-traversal-of-binary-tree.c
#include <stdio.h>
#include <malloc.h>
typedef struct node {
int data;
struct node *left,
*right;
} Node;
Node* create_binary_tree(int data) {
View CountSortedRows.c
#include<stdio.h>
int checkSort(int v[101],int c);
int main()
{
int T,
i,j,mat[101][101],rows,cols;
scanf("%d", &T);
while(T--) {
View lcs.c
int findLongestConseqSubseq(int arr[], int n)
{
int vec[100000]={0},
max = 0;
for(int i = 0; i < n; i++){
if(arr[i] > max) max = arr[i];
vec[arr[i]] = 1;
View binary_tree_to_BST.c
/* The Node structure is
struct Node
{
int data;
Node* left;
Node* right;
}; */
vector<int> vec;
View lca.c
#include<bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node * right, * left;
};
void insert(Node ** tree, int val)
{
View print_leafs_bst.c
#include <stdio.h>
#include <malloc.h>
struct Node {
int data;
struct Node *left,
*right;
};
struct Node *newNode(int data) {
View find_duplicates.js
var arr = [5, 5, 5, 2, 2, 2, 2, 2, 9, 4];
var arr = arr.reduce(function(acc,curr){
acc[curr] ? acc[curr]++ : acc[curr]=1
return acc
},{})
console.log(arr);
var str = "ABRACADABRA",