import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.TargetDataLine;
/**
* Reads data from the input channel and writes to the output stream
*/
public class MicrophoneRecorder implements Runnable {
// record microphone && generate stream/byte array
private AudioInputStream audioInputStream;
Java Sound Capture from Microphone working code
Sound Capture / Record from Microphone and Save : working java source code example
Java Reflection - Getting name of color without comparision
In this tutorial I am describing how get value of field/ property defined in class dynamically using Java Reflection.
And i am using it to get name of color (java.awt.Color) using Reflection.
Instead of doing lengthy comparison (shown below), we can do this easily by using java reflection:
Getting name of color by Comparision
One solution to get name of color may be by comparison like this :
And i am using it to get name of color (java.awt.Color) using Reflection.
Instead of doing lengthy comparison (shown below), we can do this easily by using java reflection:
public static String getNameReflection(Color colorParam) {
try {
//first read all fields in array
Field[] field = Class.forName("java.awt.Color").getDeclaredFields();
for (Field f : field) {
String colorName = f.getName();
Class<?> t = f.getType();
// System.out.println(f.getType());
// check only for constants - "public static final Color"
if (t == java.awt.Color.class) {
Color defined = (Color) f.get(null);
if (defined.equals(colorParam)) {
System.out.println(colorName);
return colorName.toUpperCase();
}
}
}
} catch (Exception e) {
System.out.println("Error... " + e.toString());
}
return "NO_MATCH";
}
Getting name of color by Comparision
One solution to get name of color may be by comparison like this :
public static String getNameByComparision(Color color) {
if (color.equals(Color.RED)) {
return "RED";
}
if (color.equals(Color.BLACK)) {
return "BLACK";
}
// ..
return "NOT_DEFINED";
}
cygwin: access windows disk, directories and files
Cygwin is a Open-source Linux-like environment for Windows. In this tutorial, I am going to show how we can access the windows directories and files using cygwin.
Java: Screen Capture using Robot and save
Robot : java.awt.Robot
is used to take control of the mouse and keyboard. It is used for test automation, self-running demos and screen capture at various state of execution of the program.Java Code for detecting screen size and capturing whole screen using Robot and saving :
Java Collision Detection and bounce - Complete example source code download
Complete example of simple collision detection and bounce between circle-circle and ball-rectangular wall.
Download Full source code : - Can be used in building simple games
Similar posts with little explanations :
![]() |
java collision detection |
Similar posts with little explanations :
Java Collision Detection and bounce- two circles collision and response
Collision detection between two circles and their response - Java source code - working
public static void intersect(Ball a, Ball b) {
//ref http://gamedev.stackexchange.com/questions/20516/ball-collisions-sticking-together
double xDist, yDist;
xDist = a.x - b.x;
yDist = a.y - b.y;
double distSquared = xDist * xDist + yDist * yDist;
// Check the squared distances instead of the the distances, same
// result, but avoids a square root.
if (distSquared <= (a.radius + b.radius) * (a.radius + b.radius)) {
double speedXocity = b.speedX - a.speedX;
double speedYocity = b.speedY - a.speedY;
double dotProduct = xDist * speedXocity + yDist * speedYocity;
// Neat vector maths, used for checking if the objects moves towards
// one another.
if (dotProduct > 0) {
double collisionScale = dotProduct / distSquared;
double xCollision = xDist * collisionScale;
double yCollision = yDist * collisionScale;
// The Collision vector is the speed difference projected on the
// Dist vector,
// thus it is the component of the speed difference needed for
// the collision.
double combinedMass = a.getMass() + b.getMass();
double collisionWeightA = 2 * b.getMass() / combinedMass;
double collisionWeightB = 2 * a.getMass() / combinedMass;
a.speedX += (collisionWeightA * xCollision);
a.speedY += (collisionWeightA * yCollision);
b.speedX -= (collisionWeightB * xCollision);
b.speedY -= (collisionWeightB * yCollision);
}
}
}
Java Collision Detection and bounce - Circle and rectangle
Collision detection between circle(any object) and rectangular wall is simple.
For collision detection we simply compare the distances. And if collision between ball and wall is detected, we change the directions of their speeds for bouncing the ball.
Here is the code:
For collision detection we simply compare the distances. And if collision between ball and wall is detected, we change the directions of their speeds for bouncing the ball.
Here is the code:
Collision Detection of two circles - Simple Java Code
Java : Drawing of two circles, mouse motion event handler on one circle, and detect collision with other.
Determining whether or not two circles intersect or overlap or collide is done by comparing the distance between the two circles to the sum of radius of the two circles.
Full working code for collision detection only download here:
Steps
1)Find the distance between the centers of the two circles(a and b) using the distance formula
2)Then the distance is compared with the radii .
Collision detection and response - bounce examples
Determining whether or not two circles intersect or overlap or collide is done by comparing the distance between the two circles to the sum of radius of the two circles.
Full working code for collision detection only download here:
Steps
1)Find the distance between the centers of the two circles(a and b) using the distance formula
float dxSq = (a.x - b.x) * (a.x - b.x);
float dySq = (a.y - b.y) * (a.y - b.y);
int d = (int) Math.sqrt(dxSq + dySq);
2)Then the distance is compared with the radii .
int r1Pr2 = (int) (a.radius + b.radius);
if (d < r1Pr2) {
System.out.println("Collided");
} else if (d == r1Pr2) {
System.out.println("Just touching");
}
Collision detection and response - bounce examples
Tracking Path of Moving Object by Color Based Image Segmentation
Codes(using JavaCV) available here (two parts):
Thresholding operation and position detection in an image
Capturing the video frames from webcam
Demo Video 42 Secs.
Thresholding operation and position detection in an image
Capturing the video frames from webcam
Demo Video 42 Secs.
JavaCV - Color based thresholding in image using OpenCV
JavaCV - Red color based thresholding (RGB-A space) in image using OpenCV : Full working java source code
Note that the order of colors is BGR-A not RGB-A.
Read it more from http://stackoverflow.com/questions/367449/bgr-color-space
Note that the order of colors is BGR-A not RGB-A.
Read it more from http://stackoverflow.com/questions/367449/bgr-color-space
//static imports
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
//non-static imports
import com.googlecode.javacv.cpp.opencv_core.CvScalar;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
JavaCV capture-save-flip-show live camera
NOTE: Updated code with configuration and example is available here:
--
JavaCV: Capture/save/flip image and show live image on CanvasFrame from camera
JAVA CODE:
import static com.googlecode.javacv.cpp.opencv_core.cvFlip;
import static com.googlecode.javacv.cpp.opencv_highgui.cvSaveImage;
import com.googlecode.javacv.CanvasFrame;
import com.googlecode.javacv.FrameGrabber;
import com.googlecode.javacv.VideoInputFrameGrabber;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
public class GrabberShow implements Runnable {
//final int INTERVAL=1000;///you may use interval
IplImage image;
CanvasFrame canvas = new CanvasFrame("Web Cam");
public GrabberShow() {
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
}
@Override
public void run() {
FrameGrabber grabber = new VideoInputFrameGrabber(0); // 1 for next camera
int i=0;
try {
grabber.start();
IplImage img;
while (true) {
img = grabber.grab();
if (img != null) {
cvFlip(img, img, 1);// l-r = 90_degrees_steps_anti_clockwise
cvSaveImage((i++)+"-aa.jpg", img);
// show image on window
canvas.showImage(img);
}
//Thread.sleep(INTERVAL);
}
} catch (Exception e) {
}
}
public static void main(String[] args) { GrabberShow gs = new GrabberShow(); Thread th = new Thread(gs); th.start(); } }
public static void main(String[] args) { GrabberShow gs = new GrabberShow(); Thread th = new Thread(gs); th.start(); } }
Java Code : Capture Image from webcam using JavaCV
Java Code for capturing image from webcam- uses JavaCV (java wrapper for OpenCV) library
Working CODE:
import com.googlecode.javacv.OpenCVFrameGrabber;
Working CODE:
import com.googlecode.javacv.OpenCVFrameGrabber;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
public class CaptureImage {
private static void captureFrame() {
// 0-default camera, 1 - next...so on
final OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0);
try {
grabber.start();
IplImage img = grabber.grab();
if (img != null) {
cvSaveImage("capture.jpg", img);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
captureFrame();
}
}
JavaCV- Image load, smooth and save
Static Imports:
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
Image Smoothing:
public static void smoothSave(String filename) throws Exception {
IplImage image = cvLoadImage(filename);
System.out.println(image.nSize());
if (image != null) {
cvSmooth(image, image, CV_BLUR, 3);
cvSaveImage("smoothed_" + filename, image);
cvReleaseImage(image);
}
}
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
Image Smoothing:
public static void smoothSave(String filename) throws Exception {
IplImage image = cvLoadImage(filename);
System.out.println(image.nSize());
if (image != null) {
cvSmooth(image, image, CV_BLUR, 3);
cvSaveImage("smoothed_" + filename, image);
cvReleaseImage(image);
}
}
OpenCV-JavaCV : eclipse project configuration windows 7
NOTE: A Easier and Simpler version of the installation step is available !! Check the latest ( Jan , 2017) article.
---Eclipse (windows 7) project setup for JNA wrapper of OpenCV : JavaCV - getting started.
OpenCV (Open Source Computer Vision Library) is library of programming functions for real time computer vision. JavaCV provides wrappers to commonly used libraries for OpenCV and few others.Download the Essentials :
CSS Format Source Code in blog articles - blogger, wordpress
CSS script to format source code in blog posting in blogger, wordpress... articles.
The working css script : Source Code Formatter CSS Script
The working css script : Source Code Formatter CSS Script
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace;
color: #000000; background-color: #eee;
font-size: 12px; border: 1px dashed #999999;
line-height: 14px; padding: 5px;
overflow: auto; width: 100%">
<code style="color:#000000;word-wrap:normal;">
<<<<YOUR CODE HERE>>>>
</code>
</pre>
HTML/XML Tag Parsing using Regex in Java
This time, I am going to show how to parse the html tags like :
xx <tag a ="b" c= 'd' e=f> yy </tag> zz
xx <tag a ="b" c= 'd' e=f> yy </tag> zz
(Did you noticed the single,double and no-quote attribute
values and spaces ? It is important to consider all these variations.)
Android Reverse Engineering - decompile .apk-.dex-.jar-.java
By reverse engineering of android app (.apk file) we can get following :
NTC Nepal Telecom gprs setting via sms - free
Activating GPRS in NTC (for both prepaid and postpaid service) FREE
- Type vgprs (in your Message Box) & Send to 1400 for GPRS Activation. :)
To get GPRS configuration for your mobile set : FREE
- Send SMS to 1404 - you need to enter following different code according to your mobile set and send it to 1404
- Type gprs (nokia, lg, motorolla, indian etc) (in your Msg Box)
- Type sagprs (samsung mobiles) (in your Message Box)
- Type segprs (sony ericsson mobiles)
- Type chgprs (chinese mobiles)
- After few minutes you will get setting and save it using pin code 1234.
- You might need to restart your set. Enjoy Browsing !!!
Java- extract / unzip a zip file - working code example
How to Extract / unzip a zip file in Java - complete source code example .
import java.io.*;
import java.util.zip.*;
public class UnzipTest {
public static void unzipFile(File f) throws ZipException, IOException {
ZipInputStream zin = new ZipInputStream(new FileInputStream(f));
System.out.println(f.getAbsoluteFile());
String workingDir = f.getPath() + File.separator + "unziped";
byte buffer[] = new byte[4096];
int bytesRead;
Java: using recursion to read a folder and its content in tree format sub-folders/files in tree format
Java CODE: Using recursion to read a folder and its content - sub-folders/files in tree format.
public class TreeTest {
public static void main(String[] args) {
showDir(1, new File("D:\\test"));
}
static void showDir(int indent, File file) {
for (int i = 0; i < indent; i++)
System.out.print(' ');
System.out.println(file.getName());
if (file.isDirectory()) {
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++)
showDir(indent + 4, files[i]);
}
}
}
Java : Generate JTree from XML dynamically - code example
In this post, i am going to describe how to generate JTree in swing according to an XML document dynamically.
Used XML File : catalog.xml
Used XML File : catalog.xml
Java : Html form parser return map of (name,value) pair of input attribute
Simple HTML Form Parser which parses the given string of HTML and returns Map of (name,value) pair of form's input attribute.
CODE : MyHtmlFormParser class
Java : Counting frequency of word in a string using Map
Use a Map to map Map<String,Integer> the words with frequency.
Then you can find out for a particular word with:
String SPACE =" ";
String [] words = input.split(SPACE);
Map<String,Integer> frequency = new HashMap<String,Integer>();
for (String word:words){
Integer f = frequency.get(word);
frequency.put(word,f+1);
}
Then you can find out for a particular word with:
frequency.get(word);
Java: ping an URL from java application - code example
The code to ping a URL from java application is as follows :
public static void pingUrl(final String address) {
try {
final URL url = new URL("http://" + address);
final HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.setConnectTimeout(1000 * 10); // mTimeout is in seconds
urlConn.connect();
if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
System.out.println("Ping to "+address +" was success");
}
} catch (final IOException e) {
e.printStackTrace();
}
}
try {
final URL url = new URL("http://" + address);
final HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.setConnectTimeout(1000 * 10); // mTimeout is in seconds
urlConn.connect();
if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
System.out.println("Ping to "+address +" was success");
}
} catch (final IOException e) {
e.printStackTrace();
}
}
With response time:
public static void pingUrlWithResponseTime(final String address) {
try {
final URL url = new URL("http://" + address);
final HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.setConnectTimeout(1000 * 10); // mTimeout is in seconds
final long startTime = System.currentTimeMillis();
urlConn.connect();
final long endTime = System.currentTimeMillis();
if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
System.out.println("Time (ms) : " + (endTime - startTime));
System.out.println("Ping to "+address +" was success");
}
} catch (final IOException e) {
e.printStackTrace();
}
}
try {
final URL url = new URL("http://" + address);
final HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.setConnectTimeout(1000 * 10); // mTimeout is in seconds
final long startTime = System.currentTimeMillis();
urlConn.connect();
final long endTime = System.currentTimeMillis();
if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
System.out.println("Time (ms) : " + (endTime - startTime));
System.out.println("Ping to "+address +" was success");
}
} catch (final IOException e) {
e.printStackTrace();
}
}
Android: Killing a running process with processid(pid) and package name
After analysis of
source code of Android's package manager application, i found forceStopPackage
method is used by system image to kill the processes- which uses android.Manifest.permission.FORCE_STOP_PACKAGES permission.
But problem is that this permission is granted only for system level application.
Android: Code for detecting if specific application or service running
For checking a application is running or not :
For checking a service is running or not :
Required Permission :
<uses-permission android:name="android.permission.GET_TASKS" />
public static boolean isThisApplicationRunning(final Context context, final String appPackage) {
if (appPackage == null) {
return false;
}
final ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
final List<RunningAppProcessInfo> runningAppProcesses = manager.getRunningAppProcesses();
for (final RunningAppProcessInfo app : runningAppProcesses) {
if (appPackage.equals(app.processName)) {
return true;
}
}
return false;
}
For checking a service is running or not :
public static boolean isThisServiceRunning( final Context context, final String servicePackageName) {
final ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (final RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (servicePackageName.equals(service.service.getClassName())) {
return true;
}
}
return false;
}
Required Permission :
<uses-permission android:name="android.permission.GET_TASKS" />
Android code for reading phone contacts detail
Here is code for reading all phone contacts(phone number, email etc with their type) stored in android phone programmatically.
Android Reading Call Log from Phone Programmatically
Here is the code to read all call log data (MISSED, OUTGOING, INCOMING) from android phone programmatically.
Permission in AndroidManifest.xml:
Add the READ_CONTACTS permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_CONTACTS" />
Code :
Permission in AndroidManifest.xml:
Add the READ_CONTACTS permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_CONTACTS" />
Code :
Calling JavaScript Function from Android and Handling Result
In this tutorial I am going to describe JavaScriptInterface for Calling Android Function from JavaScript i.e., JavaScript Binding to Android.
Setting up WebView
First add JavaScriptInterface to webView as follows. Here "MyAndroid" will be used later to call functions in JavaScriptInterface later.
Setting up WebView
First add JavaScriptInterface to webView as follows. Here "MyAndroid" will be used later to call functions in JavaScriptInterface later.
google adsense payment in nepal - western union quick cash
Google recommend
Electronic Fund Transfer (EFT) as a faster and more reliable form of payment. But, EFT are currently only available to a limited number of countries. Which doesn't include Nepal. So we have the only good option : Western Union Quick Cash.
Your Western Union Quick Cash payment will be made in US dollars. Conversion rates will be calculated according to the rate used by the Western Union Agent on the day you pick up your payment.
Receiving payments by Western Union Quick Cash:
Western Union Quick Cash is a payment method that allows you to receive your AdSense payments in cash using the worldwide Western Union money transfer service. Payments will be available for pick up at your local Western Union Agent the day after they are sent according to our normal payment schedule.Your Western Union Quick Cash payment will be made in US dollars. Conversion rates will be calculated according to the rate used by the Western Union Agent on the day you pick up your payment.
Steps :
1) Setup Google Adsense payment to Western Union Quick Cash:
- Sign in to your account at www.google.com/adsense.
- Visit the Home tab and click Account settings in the left hand panel.
- Click 'edit payment method' under the 'Payment settings' header.
- Select the Western Union Quick Cash radio button.
- Click Continue.
- Click Save changes to save your payment type.
2) Picking up WU payment
In order to pick up your payment by Western Union Quick Cash, please complete the following steps:- Find a Western Union Agent located in the country where your payments are sent.
- Call the Western Union Agent to confirm that they offer the Quick Cash service.
- Bring the following information with you:
- a valid government-issued photo ID (Passport, Driver's license, National ID etc)
- sender's information: To determine which sender's information you should bring to your WU branch, please check the 'details' link on the payment line of your Payments page.- Google Inc. 1600 Amphitheatre Parkway, Mountain View, California 94043, USA. Phone Number: 650-253-4000
- your unique MTCN (Money Transfer Control Number) which you can find by clicking on the 'details' link next to the Payment Issued line on your Payment History page
Hurrahs ------- Lets have a party ...
java find path of current executing jar
Best solution :
String path = Test.class.getProtectionDomain().getCodeSource().getLocation().getPath();
String decodedPath = URLDecoder.decode(path, "UTF-8");
You can use your own class name instead of 'Test'
Android JavaScriptInterface tutorial and example for calling JavaScript function from Android
In this tutorial I am going to describe JavaScriptInterface for calling JavaScript function from Android i.e., JavaScript Binding to Android.
I have written a blog post about : Calling JavaScript Function from Android and Handling Result
Setting up WebView
First add JavaScriptInterface to webView as follows. Here "MyAndroid" will be used later to call functions in JavaScriptInterface later.
I have written a blog post about : Calling JavaScript Function from Android and Handling Result
Setting up WebView
First add JavaScriptInterface to webView as follows. Here "MyAndroid" will be used later to call functions in JavaScriptInterface later.
Android WebView WebChromeClient example tutorial
WebChromeClient is used to handle a JavaScript events in Android App which are produced by WebView. The examples of such events are :
- onCloseWindow
- onProgressChanged
- onJsAlert
- onJsConfirm
- onJsPrompt
- onJsTimeout
Android WebView Complete Example Tutorial
The
In this tutorial I am going to demonstrate usage of WebView.
WebView
class allows you to display web pages as a part of your activity layout. WebView becomes helpful when your application frequently displays content from online resources.It simplifies task of performing a network request, parsing the data and rendering it in other Android layout. We can directly make HTTP request to an URL and load the returned HTML into WebView.In this tutorial I am going to demonstrate usage of WebView.
XSLT : Using reusable XSL to generate HTML Form dynamically
In this article , am going to describe how to generate html form dynamically using reusable xsl file.
Problem Statement :
Problem Statement :
Suppose I have large number of xml files : There is one condition that : there won't be any more nested tags . But the name of property tag will be different for each xmldata file.
First xml:
Xsl transform in Java working example (xml to html)
In order to display XML documents, it is necessary to have a mechanism to describe how the document should be displayed. One of these mechanisms is Cascading Style Sheets (CSS), but XSL (eXtensibleStylesheet Language) is the preferred style sheet language of XML.
XSL can be used to define how an XML file should be displayed by transforming the XML file into a format such as HTML, PDF, etc..
XSL can be used to define how an XML file should be displayed by transforming the XML file into a format such as HTML, PDF, etc..
Java - Single instance of application - working source code example
Having a single instance of an application is crucial in most of the software. In this article, I am giving an example on how to implement single instance of an Application.
How it works :
How it works :
- New instance of application tries to connect to a specific ServerSocket (localhost, port#) to detect running applications. And a running application must have a ServerThread to detect possible run of new instance of the same application
- The main Logic in steps
- Find existing server socket running on localhost
- If found(another instance was already running) --> exit current instance of application
- else --
- start a new Server thread to detect run of future applications
- and start the application
Some useful Regular Expressions for Find/Replace in Eclipse IDE
Regular expressions is powerful tool mostly used in search, edit and manipulate text. A regular expression define a search pattern for strings. The abbreviation for regular expression is "regex".Regular expressions are used in several programming languages. But, unfortunately each language / program supports regex slightly different.
In this blog, I am going to explain the use of Regular Expression(regex) in Eclipse IDE. There are eleven examples in total.
In this blog, I am going to explain the use of Regular Expression(regex) in Eclipse IDE. There are eleven examples in total.
Singly Linked list with all operations in C++
Linked list with all operations. Insert, Delete items at various position.
#include <iostream.h>
#include <conio.h>
//singly link list
class linklist
{
Dynamic Implementation of Queue in C++ using linked list
Dynamic Implementation of Queue in C++ using linked list
#include <iostream.h>
#include <conio.h>
class queue
{
struct node
{
Dynamic Implementation of Stack in C++
Dynamic Implementation of Stack in C++ using linked list
#include <iostream.h>
#include <conio.h>
class stack
{
Recursion : Tower of Hanoi in C++
Tower of Hanoi by recursion
#include <iostream>
using namespace std;
int main()
{
C++ implementation of Circular Queue
C++ implementation of Circular Queue
#include <iostream.h>
#include <conio.h>
#define size 10
class queue
{
C++ implementation of front end fix and rear end vary queue
C++ implementation of front end fix and rear end vary queue
#include <iostream.h>
#include <conio.h>
#define size 10
class queue
{
C++ implementation of front and rear end varying queue
C++ implementation of front and rear end varying queue
#include <iostream.h>
#include <conio.h>
#define size 10
class queue
{
C++ implementation of top varying stack
C++ implementation of top varying stack
#include <iostream.h>
#include <conio.h>
#define size 10
using namespace std;
class stack
{
C++ implementation of fixed top stack
C++ implementation of fixed top stack
#include<iostream.h>
#include<conio.h>
#definesize 10
class stack
{
int tos;
int item[size];
int pos;
Subscribe to:
Posts
(
Atom
)