// delete duplicate nodes from a linked list
#include<stdio.h>
#include<cstdlib>
// functions
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
import java.util.List; | |
import java.util.ArrayList; | |
import javax.swing.JFrame; | |
import java.awt.Graphics; | |
import java.awt.Color; | |
import java.util.Arrays; | |
// driving code | |
class BrecenhansLineDrawingAlgorithm{ | |
public static void main(String[] args) { |
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<jni.h> | |
#include<stdio.h> | |
#include "NativeDemo.h" | |
JNIEXPORT void JNICALL Java_NativeDemo_test(JNIEnv *env, jobject obj){ | |
jclass cls; | |
jfieldID fid; | |
jint 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
/* DO NOT EDIT THIS FILE - it is machine generated */ | |
#include <jni.h> | |
/* Header for class NativeDemo */ | |
#ifndef _Included_NativeDemo | |
#define _Included_NativeDemo | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
/* |
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 NativeDemo{ | |
public static void main(String[] args){ | |
NativeDemo ob = new NativeDemo(); | |
ob.test(); // call to native method | |
} | |
public native void test(); // native method without body | |
static{ | |
System.loadLibrary("NativeDemo"); | |
} |
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<iostream> | |
#include<string> | |
#include<stdlib.h> | |
using namespace std; | |
struct Header{ | |
string attribute_name; | |
struct Header* link; | |
}; |
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<iostream> | |
#define SIZE 10 | |
using namespace std; | |
char tree[SIZE]; | |
void root(char key); | |
void set_left(char key, int parent); | |
void set_right(char key, int parent); | |
void display(void); | |
int main(){ | |
root('A'); |
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<iostream> | |
#define _size 5 | |
using namespace std; | |
class _queue{ | |
int front = -1; | |
int rear = -1; | |
int A[_size]; | |
public: | |
void enqueue(int); | |
int dequeue(); |
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
// Linkedlist implementation using Classes in C++ | |
#include <iostream> | |
using namespace std; | |
class Node { | |
public: | |
int data; | |
Node* next; | |
}; | |
class LinkedList{ |