I recently had my Amazon interview for SDE. I was asked to design a stack which does push, pop and min in O(1). I got the logic and implemented the push of the
An undirected graph having 'n' number of edges, then find out number of vertices that graph have?
Given a undirected graph that it has ordinary edges and specific edges, our goal is to find the sum of the shortest path's weight between two vertices(start ve
I want iterate over items's data and create a a new list of SomeData based on item.type however when type is UNKNOWN I need skip that element and not add to lis
I'm working on a project with 6 huge mapping tsv files. In most cases they look like this: First: ID which is a unique String which starts with a char and goes
I am getting 500k records per request from the Database then mapping the data to a list of POJO classes then writing the records to an excel sheet (I have the r
Okay, so in-order traversal of threaded binary tree by using threads goes something like this: Start at leftmost node and print it Follow thread to right and
An evil scientist has developed an injection that induces insatiable hunger in a fish. On giving this injection, a fish of size x can eat another fish of smalle
I have this question that is medium level and couldn't even think on how to solve this problem, my solution could be overkill as I have no idea on how to traver
I just started to learn data structure and getting an error when executing malloc(): memory corruption (fast) what can be the issue and how to resolve it? I h
This question is about the Bloomier filter, which is not the same as a standard Bloom filter. I'm learning about the Bloomier filter and I don't see the advanta
I have been following a tutorial at cplusplus.com/doc/tutorial. Near the end of the Functions page, it discussed prototyping a function. Later on, I read about
i have the following structure typedef struct { char data1[10]; char data2[10]; AnotherStruct stData; }MyData; for some reason the imple
According to these: http://docs.oracle.com/javase/6/docs/api/java/util/HashMap.html Difference between HashMap, LinkedHashMap and TreeMap java beginner : How k
I am working on a tree problem and not able to figure out how to solve the problem at hand. I've googled and also checked on SO, but could not find a suitable a
I'm looking for an efficient way of storing sets of objects that have occurred together during events, in such a way that I can generate aggregate stats on them
Is there a way to performance-efficiently insert a key-value pair in a specific place of a Map object? The problem I'm trying to solve is sto
Given an array of integers, what is the length of the longest subarray containing no more than two distinct values such that the distinct values differ by no mo
for(int i = 0; i < n; i++) { for(int j = 0; j < i; j++){ // do swap stuff, constant time } } I read that single for loop is O(N) and trav
I have a dataset of images saved in 97 .tfrecord-files. Each example includes image data as well as groundtruth data (classes and bounding boxes) for object det