HTTP The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, and hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web. HTTP is an application layer protocol designed within the framework of the Internet protocol suite. Its definition presumes an underlying and reliable transport layerprotocol, and Transmission Control Protocol (TCP) is commonly used. However HTTP can be adapted to use unreliable… Continue reading HTTP, TCP/IP and …
Category: Random Topics
Caching Algorithm
DS Discussion
Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists?
Shuffle an array
The general method for shuffling is biased. Check this - https://spin.atomicobject.com/2014/08/11/fisher-yates-shuffle-randomization-algorithm/ and http://www.i-programmer.info/programming/theory/2744-how-not-to-shuffle-the-kunth-fisher-yates-algorithm.html When shuffling the maximum number of possible outcome can't be more then n!( n is the number of items being shuffled). So if the algo generate more then n! possible outcome then the algo is biased. The Knuth Fisher-Yates Algorithm produces unbiased shuffled outcome. It… Continue reading Shuffle an array
UUID
How is UUID unique(version 1 ) There is more than one type of UUID, so "how safe" depends on which type (which the UUID specifications call "version") you are using. Version 1 is the time based plus MAC address UUID. The 128-bits contains 48-bits for the network card's MAC address (which is uniquely assigned by… Continue reading UUID
Stack vs Heap
Link Stack: Stored in computer RAM just like the heap. Variables created on the stack will go out of scope and automatically deallocate. Much faster to allocate in comparison to variables on the heap. Implemented with an actual stack data structure. Stores local data, return addresses, used for parameter passing Can have a stack overflow… Continue reading Stack vs Heap