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
/* | |
* Copyright © 2013 – 2015 Ricki Hirner (bitfire web engineering). | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the GNU Public License v3.0 | |
* which accompanies this distribution, and is available at | |
* http://www.gnu.org/licenses/gpl.html | |
*/ | |
package at.bitfire.davdroid; |
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
/* | |
DEPTH FIRST SEARCH | |
Recursive Approach | |
Save File as DFS.java | |
*/ | |
public class DFS{ | |
private static final int V = 8; |
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
/* | |
BINARY SEARCH TREE | |
Iterative Approach | |
Keeps a track of parent too | |
** for TURBO C, remove // from commented statements | |
*/ | |
#include<stdio.h> | |
#include<malloc.h> | |
//#include<conio.h> |
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
/* | |
MAX MIN in array | |
0 based indexing | |
Save File as Maxmin.java | |
*/ | |
class Maxmin_wrapper{ | |
/* Since java's call by reference needs a reference to a object, this class will be used as a wrapper */ | |
public int maximum; | |
public int minimum; |
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
/* | |
MINIMUM in array | |
0 based indexing | |
Save File as Minimum.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |
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
/* | |
MAXIMUM in array | |
0 based indexing | |
Save File as Maximum.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |
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
/* | |
BINARY SEARCH | |
0 based indexing | |
array as iterable | |
presorted in increasing order | |
recursive method | |
Save File as BinarySearch.java | |
*/ | |
import java.io.BufferedReader; |
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
/* | |
LINEAR SEARCH | |
0 based indexing | |
array as iterable | |
iterative method | |
Save File as LinearSearch.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; |
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
/* | |
Linked List | |
dynamic memory allocation | |
Save File as LinkedMain.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |
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
/* | |
STACK using array | |
0 based indexing | |
Save File as Stack.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
NewerOlder