Tag: c

62 votes
6 answers
1.3K views
Preserving order with LINQ

I use LINQ to Objects instructions on an ordered array. Which operations shouldn't I do to be sure the o

avatar
Keila
0 1 0 9
asked 07 September, 2021
55 votes
14 answers
808 views
Why does the C++ STL not provide any "tree" containers?

Why does the C++ STL not provide any "tree" containers, and what's the best thing to use instead? I want

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
2.9K views
Split List into Sublists with LINQ

Is there any way I can separate a List<SomeObject> into several separate lists of SomeObject, using the

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
58 votes
16 answers
2.9K views
When should I use a List vs a LinkedList

When is it better to use a List vs a LinkedList?

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
54 votes
21 answers
2.7K views
How to implement a queue using two stacks?

Suppose we have two stacks and no other temporary variable. Is to possible to "construct" a queue data struct

avatar
Yolando
0 1 0 9
asked 07 September, 2021
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
695 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&apos;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
48 votes
1 answers
2.7K views
Function not working on c program selection sort

Why this function is not working here? It's not sorting on output. Suppose if I enter 1 4 2 the output is

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
47 votes
1 answers
1.8K views
C Program can find (via fopen) in gdb but not release (a.out)

Here's a C simple program, that reads a user input for a file location and prints the first line if such

avatar
Wei
0 1 0 9
asked 07 September, 2021