Today you will learn the basics of what a stack and a queue are. Stacks and queues are ordered lists of things. They could be strings, numbers, or anything else you can think of. Stacks and queues each have a unique way of adding and removing elements from their data structure. In a stack, you push elements when you add them and pop elements when you remove them. In a queue, you enqueue elements when you add them and dequeue elements when you remove them.
You are about to wield the full power of the blockchain. All hail the all mighty censorship-resistent integer. Okay, the contract you will make is not going to be very useful for any real world applications, but it will be useful for the knowledge you gain from it. You may not solve all the world’s problems with this smart contract, but your journey can start with the small step you take here.
Your dog is a lovable furry thing, and so are you. Maybe you are not as furry, but you are definitely as lovable. Your imagination is a powerful tool that you can leverage to impact your life. Even if you do not think you are as lovable as your dog, you can imagine you are and gain some benefits in in your life. You can use what your dog thinks of you to change your self image and improve your life.
Do you love doughnuts? Do you love describing the efficiency of algorithms in the language of mathematics? If math is not your strong suit, no need to worry. Math is not so scary when you have doughnuts. Imagine one thousand doughnuts in front of you. Now imagine you want to eat a doughnut. What is the runtime of eating a doughnut? You pick up a doughnut and eat it. That would be constant time, or \(O(1)\). The amount of time it takes to eat a doughnut is unaffected by how many doughnuts there are. Now imagine instead one of your favorite doughnuts is hidden among the thousand doughnuts. The amount of doughnuts you have to look through increases linearly, so the runtime of finding your favorite doughnut is \(O(n)\). Big O allows you to compare how algorithms speeds change based on how the inputs change. An \(O(1)\) algorithm is not necessarily always faster than an \(O(n)\) algorithm. All it means is that some input exists where the \(O(n)\) algorithm is more or less efficient than the \(O(1)\) function. In this case, the \(O(n)\) algorithm is slower in almost every case than the \(O(1)\) algorithm. See the doughnut below:
You want to ace that technical interview, but you feel like technical interviewers do not realize search engines exist. After spending hours studying, you wonder why the interview process is the way it is. Why is it so difficult? Writing code on a whiteboard does not make any sense. That is why we have computers, right? Why do you need to write answers on a whiteboard when you have access to all of the world’s information in your pocket? Why are technical interviews designed this way?