New: data-structuresAll contenthive-129948hive-196917krhive-180932hive-150122steemzzanhive-183959hive-185836hive-144064photographyhive-101145hive-166405hive-184714hive-188619hive-145157uncommonlabhive-183397hive-103599bitcoinhive-180301hive-139150hive-193637steem-atlashive-179660TrendingNewHotLikerscryptoizotx (40)in programming • 6 years agoOne algorithm a day: Keeping track of the largest element in a stackImagine that you want to be able to access the largest element in a stack. I know you were dying to do it ! You already have implementation of the stack class: class Stack {cryptoizotx (40)in swift • 6 years agoOne algorithm a day. Write a function that returns best profit you could made from trading.Write an efficient function that takes stockPrices and returns the best profit I could have made from one purchase and one sale of one share of Apple stock yesterday.cryptoizotx (40)in programming • 6 years agoOne algorithm a day: floor of the square root of the inputDescription Implement a function that takes in a 32 bit integer and returns another 32 bit unsigned integer that is the floor of the square root of the input Implementation Function can be…jordaan01 (25)in dmania • 7 years agoLinked listView post on dManiaivlad (25)in programming • 7 years agoThe Sieve of Eratosthenes Part 1: efficiently generating primes up to nThe Sieve of Eratosthenes is an algorithm for finding prime numbers in a range. Conceptually, it's a very simple algorithm. Let's assume our range is always [2, n]. In our examples, we'll consider…black-ice (25)in computer-science • 7 years agosteemCreated with Sketch.What's a Merkle Tree?Each node in the Merkle tree performs MD5 hashing of input data. Parent nodes concatenate the hashes of their children before hashing. (Credit: T. L. Oliver CC BY-SA 4.0 ) If you've tried to…orcunland (6)in data-structures • 7 years agoWhy do we only use C in data structures and not C++?Data Structures are particular way of organizing data in a computer so that it can be used efficiently. (Wikipedia Definition) So you can not state that it must be done only in one programming…