Tag: struct

56 votes
26 answers
1.7K views
How to detect a loop in a linked list?

Say you have a linked list structure in Java. It's made up of Nodes: class Node { Node next; //

avatar
Shantay
0 1 0 9
asked 07 September, 2021
61 votes
16 answers
1.5K views
How does a hash table work?

I'm looking for an explanation of how a hash table works - in plain English for a simpleton like me! Fo

avatar
Thurman
0 1 0 9
asked 07 September, 2021
50 votes
24 answers
694 views
How to implement a tree data-structure in Java?

Is there any standard Java library class to represent a tree in Java? Specifically I need to represent the fo

avatar
Chaya
0 1 0 9
asked 07 September, 2021
65 votes
5 answers
1.7K views
53 votes
8 answers
625 views
How to check if a specific key is present in a hash or not?

I want to check whether the "user" key is present or not in the session hash. How can I do this? Note that I

avatar
Cortez
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.5K views
Simplest code for array intersection in javascript

What's the simplest, library-free code for implementing array intersections in javascript? I want to writ

avatar
Clarice
0 1 0 9
asked 07 September, 2021
53 votes
27 answers
1.2K views
How do you implement a Stack and a Queue in JavaScript?

What is the best way to implement a Stack and a Queue in JavaScript? I'm looking to do the shunting-yard

avatar
Tuan
0 1 0 9
asked 07 September, 2021
59 votes
7 answers
2.1K views
Ukkonen's suffix tree algorithm in plain English

I feel a bit thick at this point. I've spent days trying to fully wrap my head around suffix tree constru

avatar
Wilber
0 1 0 9
asked 07 September, 2021
50 votes
19 answers
3K views
Why is Dictionary preferred over Hashtable in C#?

In most programming languages, dictionaries are preferred over hashtables. What are the reasons behind that?

avatar
Louetta
0 1 0 9
asked 07 September, 2021
63 votes
13 answers
2.8K views
How can I remove a key from a Python dictionary?

When deleting a key from a dictionary, I use: if 'key' in my_dict: del my_dict['key']

avatar
Jeff
0 1 0 9
asked 07 September, 2021
60 votes
18 answers
1K views
How do I sort a list of dictionaries by a value of the dictionary?

I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the

avatar
Nereida
0 1 0 9
asked 07 September, 2021
57 votes
1 answers
2.3K views
Using struct variables in functions - Conflicting types

i'm trying to pass struct variables to a function, but i receive: error: conflicting types for 'refe

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
54 votes
23 answers
2.1K views
How do I call one constructor from another in Java?

Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? An

avatar
Yolando
0 1 0 9
asked 07 September, 2021