Skip to content

Instantly share code, notes, and snippets.

@arrayed
arrayed / TemperatureTracker.cpp
Created February 25, 2017 05:44
interview-cake Temperature Tracker Problem Solution
/* Website: Arrayed.Net
* You decide to test if your oddly-mathematical heating company is fulfilling its All-Time Max, Min, Mean and Mode Temperature Guarantee™.
* Write a class TempTracker with these methods:
*
* insert()—records a new temperature
* get_max()—returns the highest temp we've seen so far
* get_min()—returns the lowest temp we've seen so far
* get_mean()—returns the mean of all temps we've seen so far
* get_mode()—returns the mode of all temps we've seen so far
@arrayed
arrayed / AdjacencyMatrixGraphImp.cpp
Last active April 29, 2022 21:59
Adjacency Matrix Graph Implementation in C++
//============================================================================
// Name : AdjacencyMatrixGraphImp.cpp
// Author : Amritpal Singh
// Copyright : arrayed.net
// Description : Array based Adjacency Matrix Graph Implimentation
//============================================================================
#include <iostream>
#include <vector>
#include <string>
@arrayed
arrayed / DheapDriver.java
Created December 30, 2016 18:51
D-ary Heap Driver Software Implementation
/* DheapDriver.java
* Class - heap
* Authors - Amritpal Singh
* Website - arrayed.net
* Class description - Insert random priority integer values and random string values in heap and print out from max to minimum by using delete_max method
*/
public class DheapDriver {
private static final String ALPHANUMERIC_STRING = "0123456789abcdefghijklmnopqrstuvwxyz";
@arrayed
arrayed / heap.java
Created December 30, 2016 18:48
Implement D-ary Heap 4-way
/* heap.java
* Class - heap
* Authors - Amritpal Singh
* Website - arrayed.net
* Description - Implement D-ary Heap (4-way in this case each node has 4 children) max heap, each node has priority level and string value associated.
*/
public class heap {
private heapNode[] heapArray; // heap array of nodes
private int maxCapacity; // max capacity of heap set in constructor
@arrayed
arrayed / DLinkedListDriver.java
Created December 30, 2016 18:31
Linked List Based List Driver Software Implementation in Java
//============================================================================
// Name : DLinkedListDriver.java
// Author : Amritpal Singh
// Version : v0.1
// Copyright : arrayed.net
// Description : Linked List Based List Driver Software Implementation in Java
//============================================================================
public class DLinkedListDriver {
public static void main (String[] args) {
@arrayed
arrayed / DLinkedList.java
Created December 30, 2016 18:20
Linked List Base List Implementation in Java
//============================================================================
// Name : DLinkedList.java
// Author : Amritpal Singh
// Version : v0.1
// Copyright : arrayed.net
// Description : Linked List Based List Implementation in Java
//============================================================================
public class DLinkedList<E> {
@arrayed
arrayed / MaxSubarray.cpp
Created December 26, 2016 18:46
Find maximum of subarray - Arrayed.Net
//============================================================================
// Name : MaxSubarray.cpp
// Author : Amritpal Singh
// Version : v0.1
// Copyright : arrayed.net
// Description : Find maximum of subarray.
//============================================================================
#include <iostream>
using namespace std;