Skip to content

Instantly share code, notes, and snippets.

Hashing

HashMap vs LinkedList

Internal Working

Java HashMap Questions

How To Describe HashMap? HashMap implements Map interface and maintains key and value pairs. HashMap internally works on the principle of Hashing HashMap can only contain unique keys and only one null key.

@kejsiStruga
kejsiStruga / elliptic_curve.py
Last active September 8, 2018 20:17
Addition of Elliptic Curves in Python
from fractions import Fraction
"""
General form of the Curves:
y**2 = x**3 + a*x**2 + b*x + c
So the curve is defined by the tuple (a,b,c).
"""
def on_curve(x, y):
"""Check if (x,y) is on the curve y**2 == x**3+3*x"""
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
@kejsiStruga
kejsiStruga / ImmutableVsMutable.js
Created September 16, 2017 22:19 — forked from sean-roberts/ImmutableVsMutable.js
Immutable vs Mutable in JS - the immutable (unable to change or mutate) values are primitive values - numbers, strings, booleans, null, undefined). While the mutable are all other objects. They are generally referred to as reference types because the object values are references to the location, in memory, that the value resides.
// start with at string
var s = "my string";
//change its value (remember this changing of value is by value not reference)
s.toUpperCase();
// assign it to t
var t = s;
@kejsiStruga
kejsiStruga / ImmutableVsMutable.js
Created September 16, 2017 22:19 — forked from sean-roberts/ImmutableVsMutable.js
Immutable vs Mutable in JS - the immutable (unable to change or mutate) values are primitive values - numbers, strings, booleans, null, undefined). While the mutable are all other objects. They are generally referred to as reference types because the object values are references to the location, in memory, that the value resides.
// start with at string
var s = "my string";
//change its value (remember this changing of value is by value not reference)
s.toUpperCase();
// assign it to t
var t = s;