A data structure is a way of organizing data in a fashion that allows particular properties of that data to be queried and/or updated efficiently.

learn more… | top users | synonyms (1)

5
votes
2answers
179 views

HashTable implementation

I have been trying to implement the Hash Table function in Java and here is what I came up with. I would just like to get an opinion on this work. Would there be a better way or any improvement to ...
0
votes
1answer
45 views

Implementing a stack using a simple array, dynamic array and linked list

I have implemented a stack using simple array, dynamic array and linked list. I am requesting a review of this code. Interface for stack: ...
2
votes
0answers
55 views

Deepest node in tree

I have written two classes, one to represent the tree and a Util class to get the deepest node from the tree. Can you please review the code? Below is the class ...
3
votes
1answer
33 views

AVL tree implementation in C

I have an assignment. I need to write an AVL tree. This is what I have written so far. It works on all of my tests, but suddenly fails in checking system with TL(time limit exceeded). Personally I ...
4
votes
3answers
159 views

Custom SkipList implementation in Java

I recently studied SkipList and thought i would create one on my own. This implementation uses a 2 layer Skip list where the size of the support list is roughly square root of the size of the original ...
2
votes
1answer
33 views

Manipulate JSON data from the client with JavaScript

I am making an application in which the user has the ability to add, remove, and edit JSON data through DOM interaction. I have created a working JavaScript-only prototype that accepts certain ...
3
votes
3answers
129 views

AVL tree for inserting and searching

I have made an AVL tree. It works and does what it needs to do. I only need it to insert and search. I am comparing how long it takes to load and search a dictionary file in relation to other various ...
3
votes
0answers
52 views

Djkistra shortest path implementation for adjacency list represented graph

Please review the implementation of Djkistra algorithms. Points on which I have doubt: My Graph doesn't have any ID for nodes. Nodes are accessed based on their ...
4
votes
1answer
74 views

School which registers students by preferred courses

The point of the application is to create a school, create courses for that school, create students and register them to the school, assigning them courses based off the courses they prefer. There ...
2
votes
1answer
69 views

File input and sorting averages with movies

So far I have Java code that will: take in two .csv files store each line as a string in a string array split it into a 2D string array where a comma would act as the separator sum the number found ...
2
votes
0answers
46 views

Treap with implicit keys

I implemented an implicit treap and tested it a little. It works fine but I'd like to know if there are ways to improve/simplify things and/or if some parts are incorrect. Later, I'll augment code to ...
0
votes
1answer
61 views

Pure fixed length queue

I am modeling an infectious disease with a fixed incubation period. I chose a queue to keep track of when people become symptomatic. I imagined using some operations like so: ...
11
votes
3answers
481 views

Implementation of an Stack without Linked Lists in C

I'm a beginning C programmer. As an exercise, I have attempted to implement a stack of strings in C. This is my first real exercise working with pointers. I looked at some other similar posts on here, ...
2
votes
0answers
57 views

Binary Index tree optimization

I have written code for binary index tree. My problem is there are many functions based on the binary index tree the function stores the sum of element within a given range of binary index tree and my ...
0
votes
0answers
56 views

Freeing a binary tree data structure in C

I have this function that I hope to be a good alternative to the recursive (thus performance expensive) approach. ...
2
votes
2answers
72 views

Assign a unique number to duplicate items in a list

I made a program, but I not happy with the quantity of code. The end result is good, but I believe it can be made much easier, only I don't know how. The functionality: If equal items > 1 in list, ...
4
votes
2answers
108 views

Rotating an array by position n

Input is 1,2,3,4,5,6,7,8 If rotateOrder = 2 Output should be 7,8,1,2,3,4,5,6 If rotateOrder = 3 Output should be 6,7,8,1,2,3,4,5 Here is my program to do it: ...
4
votes
2answers
59 views

Make a map using a splay tree

In my data structures and algorithms class, we were introduced to the splay tree, a BST with the additional property that recently accessed elements are quick to access (because they stay at the top ...
5
votes
1answer
43 views

Retrieve annotation from a tree annotated with a Monoid

Working on this homework from 2013 for self-learning. For the following Algebraic Data Type: ...
2
votes
2answers
72 views

Parse a value to a given datatype

For our (internal) automated test project, I am writing a part where parameters can be passed to an SSIS Package before it gets executed. The tester delivers the parameter name, value and desired ...
5
votes
0answers
66 views

A reversed-string Trie data structure

This is a simple Trie data structure for strings, except it puts the strings into the structure backwards. The insert method simply iterates over chars from the string-to-be-inserted backwards, and ...
6
votes
2answers
161 views

Limited memory priority queue

I'm trying to implement a highly efficient limited memory priority queue. The interface is the same as a std::priority_queue. Can anyone suggest any performance ...
3
votes
1answer
114 views

Public interface for nearest neighbor data structures

I am making a small library of metric data structures. That is data structures, which associate points in the n-dimensional space with objects and allow the user to find objects which are closest to a ...
2
votes
1answer
106 views

Graph Implementation in Java 8

Here is my code which implements a simple directed graph in Java 8. Here are some of the things I am unsure about: I am fairly new to Java 8 concepts. Have I used the new API correctly (and not ...
6
votes
1answer
202 views

Generate Cartesian product of List in Java

My code, which generates Cartesian product of all lists given as arguments: ...
2
votes
1answer
53 views

Binary Search in C

The standard C library function bsearch wasn't giving me correct results, apparently. So I decided to implement a binary searching function in place of it. It ...
0
votes
2answers
143 views

Optimizing Dijkstra implementation using PriorityQueue in Java

I am trying to make Dijkstra implementation more efficient. Below is the code for class Node which implements Comparable so it ...
2
votes
0answers
105 views

Binary Search Tree in Ruby

Binary Search Tree, with preorder traverse. What other methods should I add? How can I improve it? ...
3
votes
1answer
65 views

Bloom filter implementation using a BitArray

I am following the Wikipedia definition of the Bloom filter. My implementation uses the BitArray I created in Bit Array in Ruby using integer as a storage. An ...
3
votes
1answer
96 views

Bit Array in Ruby using integer as a storage

Ruby's Fixnum & Bignum can hold very large integers and automatically handle overflow. I decided to implement BitArray using an integer as storage. Please let me know what you think about code and ...
1
vote
0answers
25 views

Multiset implementation in Ruby -Take 2

This is a follow up to question. I fixed the issues mentioned in the answer as far as my understanding. The union and intersection now return new object instances with new implementation. I also wrote ...
2
votes
1answer
43 views

Multiset implementation in Ruby

I am trying to implement the wikipedia definition of a MultiSet. Need feedback on implementation. Also I am not sure how to implement cartesian product. ...
6
votes
3answers
359 views

Making backtracking Knight's Tours solution more efficient

This was a previous homework assignment I was required to do. While I did the assignment and turned it in for credit, I am not completely satisfied with the result I have. The rule for the assignment ...
18
votes
2answers
212 views

Wait, is this… LINQ?

Context I'm working on a little project that consists in a series of Microsoft Excel add-ins (.xlam). The code being submitted for review here, is located in the ...
0
votes
2answers
80 views

Populate inorder successor for all nodes

Given a binary tree where each node has following structure, write a function to populate next pointer for all nodes. The next pointer for every node should be set to point to inorder ...
1
vote
1answer
41 views

Get Height of Tree

Given the following Abstact Data Type: ...
1
vote
1answer
88 views

Create a complete binary tree

Write a program to create a complete binary tree, which includes an addItem method such that an individual element can be inserted into the tree to maintain the ...
4
votes
3answers
161 views

Implementing an ArrayList

I implemented ArrayList functionality in C as follows: ...
3
votes
3answers
133 views

Speeding up storage of about 220000 values in Core Data

I use this code on the app's first run to save about 220000 values into core data. The file Navaids.txt has about 200000 and Waypoints.txt has about 20000 lines, where I get data from each line and ...
-1
votes
1answer
101 views

ArrayList implementation in C [closed]

Although I know I can use calloc then realloc to make a dynamic array in C, and that I also need a variable to keep track of the ...
2
votes
2answers
29 views

Enforcing Type with Boiler Plates

This is an implementation of Mat's List using by Pseudo-inheriting my Pythonic-List. Inheritance is not built into VBA, but it can be simulated by composing the inherited class and mimicking all it's ...
1
vote
1answer
84 views

Creating a Custom Set Data Structure in Ruby

I wrote a set DS with some useful functions. Not sure if it is a good implementation and if there are other essential functions that a set should support. ...
10
votes
2answers
293 views

Simple key-value store in C, take 2

Followup to Simple key-value store in C. Response to previous reviews You may want to hide the KVSstore structure Done. Add a comparison function pointer to KVSstore. If this pointer is ...
5
votes
2answers
134 views

Simple key-value store in C

I needed a simple key-value store. Here's what I came up with. Usage Use kvs_create and kvs_destroy to create stores and clean ...
4
votes
2answers
115 views

Traversing and printing complex Dictionary types (Scripting.Dictionary) - Dictionary inside of a Dictionary

Based on this SO post - also reposted on vba4all.com with a few more details and explanations. Please notice there currently is no error handling whatsoever as I didn't analyse and consider any traps ...
2
votes
1answer
112 views

Autocomplete Trie Optimization

I'm currently playing with the Typeahead problem on Talentbuddy. There are already 2 questions on this subject (Typeahead Talent Buddy and Typeahead autocomplete functionality challenge), but none of ...
10
votes
3answers
157 views

VBA Python-like List Class

VBA's Collection class is lacking so I created a basic List class using Python's as a template. This could make future derived ...
5
votes
4answers
111 views

Dynamically-sized stack - follow-up 3

Follow up of - Dynamically-sized stack - follow-up 2 I've took the tips given to me, and what I did now is: Use same case type for type stack and it's functions Returning 1 if push failed due to an ...
4
votes
1answer
2k views

Queue Implementation using a Linked List

For understanding the concepts, I've implemented the Queue data structures using a linked list. Is there anything to improve? LinkList.java ...
9
votes
1answer
75 views

Yet Another Fraction

A recent question inspired me to implement a Fraction class. I decided to write this one in vba, because I like writing tools for the poor souls that still have to ...