#enqueue and dequeue
Explore tagged Tumblr posts
Text
The air is heavy. Loud buzzing noises ring in your ears and the smell of blood is strong.
Your paws hit the dirt. Messy and muddy fur, red and black stain the once pure and perfect white. Your expression remains unchanged as your eyes scan the landscape.
Another failure had hit the Federation. Really, and you think your users would understand that already. A result printed and programmed well into your logic infused systems and the catch had shown the victor of the trialed input— a loss.
You wipe liquid off your face, your paw turns more crimson. Your ears twitch. Noise. The buzzing of warbled and twisted audio of unknown origins play next to you. You translate it as crying. User input. Output; the crying stops.
Your paws turn, following every command your users inflict upon you with perfect precision. Left, forward, forward, right, stop. You show the user your screen. Click. Pop. Forward.
The islanders follow in a simple queue. Enqueued when they were registered, and dequeued on their way out. You had relayed the user's words to them. One client to another, all from the server.
Stop. New command. New recruit. What fun!
What a lucky one it would be! Your lens follow the scene, ah. There it is. You forward a message to your subordinates. They understand completely and enter your area. How beautiful they are. So very good at listening.
The recruit near the ground makes a noise at you. It tries to lunge for you, but gets aprehended by your workers. Ah, how kind of them. It snaps at you, yelling and screaming much like your users when you'd step out of line. It goes quiet at your paws- thank you users. The tazer slips back in and your paw flicks back out.
Your workers nod at you before dragging the lucky one away. You could tell that it would serve a great use for the Federation. A small prize for the overall loss. Shame, this Island was starting to grow on you. You liked the Eggs.
Speaking of, you can't remember what happened to them. Funny, you must've misplaced your recent recordings. Oh you. But you can't help but think, were they sent back onto Egg Island? Or did your higherups have something else in mind?
Your mouth twists into something that is opposite to a smile before defaulting. Cancelled. Apologies. A bug. You should get that fixed. Your fur is a mess. What a failure. You really are the Island's image.
Your users sent you a request to come home. Your dirty and dishelved paws hit the pure white quartz floor. Your office was still here, they haven't started moving yet. A weight leaves your shoulders, and you forget——
"Good Morning."
Another day, another island. Good Morning, Bureau. Better go wash up first. Your paws are dirty and you can not recall why.
Please, follow along. Let's start today right. The Island must be perfect, therefore you must be perfect.
"Good Morning, let's get to work."
#server event#server offline#console log#standalone; dont rb#[log taken: date unknown // location: [CLASSIFIED] Island; pre-Quesadilla]#straightverse#yaoiverse
5 notes
·
View notes
Text
10910EECS204001 Data Structure HW2-Elementary arithmetic
In this homework, you are asked to implement Stack, Queue and certain arithmetic operations (addition, subtraction, multiplication, division and brackets) to evaluate elementary arithmetic expressions, and update the expressions with Dequeue, Enqueue operations. Functions: 1. Implement Queue to store the expression elements Eg: 1+2*3 front back 1 + 2 * 3 Queue 2. Dequeue N: Delete N…
0 notes
Photo
#i'll reblog it for the horny foxgirl specifically
#enqueue and dequeue#i'll admit that i'm so poisoned by something that i didn't even realize the fox was a foxgirl for a while
106K notes
·
View notes
Text
Test Your Knowledge: Quiz Challenge!!! 📝🧠
A list of elements in which enqueue operation takes place from one end, and dequeue operation takes place from one end is__🤔
For more interesting quizzes, check the link below! 📚
https://bit.ly/3WDJhF0
For the explanation of the right answer, you can check Q.No. 25 of the above link. 📖
0 notes
Text
Solved:Lab 4: Circular Queue ADT
Implement Circular Queue ADT using an array. Your Circular Queue ADT has two main operations, Enqueue and Dequeue. In addition, you should implement two more functions for printing the first element and the last element. Enqueue a new element at the end of the element in the queue. If your queue is full, just print an error message. Dequeue the node in the front. If your list does not have any…
View On WordPress
0 notes
Photo
late at night (well, 10pm...) saw oodles of drunk people coming through the paths to this selfsame shrine. i was a little surprised at how devout people must be to go to a shrine at such an hour on a random weeknight. we entered, too, to see what everyone was doing, but the shrine was empty of people and nothing was happening; everyone had disappeared on us.
i checked a map the next morning, and hanazono shrine is right in between two metro exits & golden gai, a famous grid of alleys filled with hole-in-the-wall bars.
the exits in question allow you to walk underground for almost a full kilometer, some hundreds of meters in one hallway, all the way to and from the center of shinjuku station.
#same night i had my first and only experience at a gay bar#(met partner before i was legal drinking age...) (and i'm bad at crowds)#everyone was very nice#enqueue and dequeue
9K notes
·
View notes
Text
ساختمان داده
به عنوان یکی از مهمترین دروس رشته مهندسی کامپیوتر، هدف درس ساختمان داده ها پژوهش در مورد روشهای گوناگون ذخیره، نگهداری و بازیابی اطلاعات در سیستمهای کامپیوتری است، به گونهای که این اطلاعات بتواند بطور کارامد مورد استفاده قرار گیرد. ساختمانهای داده برای دریافت دادهها توسط کامپیوتر جهت پیاده سازی و اجرای الگوریتمها مورد استفاده قرار میگیرند، اما الگوریتمها دستورالعملهایی هستند که بر روی دادهها اعمال میشوند. هر ساختمان داده بسته به طراحی و هدفی که دنبال میکند چگونگی آرایش دادهها در حافظهی کامپیوتر را با مدل خاصی مشخص میکند. طراحی هر ساختمان داده به گونهای انجام میشود که بتواند نیاز خاصی را برطرف کند و برنامه نویس با توجه به نیازهای برنامهای که طراحی میکند، میبایست ساختمان دادههای مناسب خودش را انتخاب کند.
طراحی داشبورد مدیریتی
حال داده های ورودی به کامپیوتر توسط پردازنده و تحت فرمان “واحد کنترل” از حافظه دریافت شده و پس از اجرای الگوریتم های مورد نظر روی آن ها، نتایج روی حافظه ذخیره میشوند و یا به دستگاه های خارجی مانند مانیتور منتقل میشوند.
حافظه و دستگاه های ورودی و خروجی ترتیب انجام کارها را نمیدانند و این واحد کنترل است که با توجه به دستوری که میخواهد اجرا شود، ترتیب کارهایی که این واحد ها باید انجام دهند را در هر پالس ساعت با ارسال سیگنالهایی به نام Command مشخص میکند. به چگونگی کارکرد، طراحی و ساخت اجزای کامپیوتر معماری کامپیوتر گفته می شود.
برنامهای خوب است که هم ساختمان داده مناسبی داشته باید و هم الگوریتم خوبی برای آن نوشته شود. در درس ساختمان داده انواع ساختمان داده ها و اینکه برای هر الگوریتم چه ساختمان داده ای بهتر است آموزش داده میشود و در درس طراحی الگوریتم دانشجویان آموزش می بینند که چگونه راه حل های بهینه برای حل مسائل پیدا کنند. یکی از بزرگترین دغدغه هایی که درس طراحی الگوریتم سعی در پاسخ به آن دارد، آموزش بدست آوردن راه حل های سریع، بهینه و عملی برای مسائل گوناگون است. در ادامه به معرفی ساختمان داده هایی پرداختهایم که برنامه نویسان از آنها زیاد استفاده میکنند
آموزش علم داده
ساختمان های داده ابتدایی Boolean
Integer
Floating-point numbers
Fixed-point numbers
Character
String
برای کسب اطلاعات بیشتر درباره هریک از انواع داده های ابتدایی، به سایت کنکور کامپیوتر مراجعه کنید.
ساختارهایی از داده وجود دارند که روی انواع داده های ابتدایی ساخته می شوند. از جمله ساختمان داده های پرکاربرد می توان به موارد زیر اشاره کرد:
مشاوره و اجرای علم داده
آرایه (Array) لیست پیوندی (Linked List) پشته (Stack or Push Down List or Pile) صف (Queue) درخت های ساده (Binary Tree) درخت جستجوی دودویی (Binary Search Tree) ساختمان داده و هر آنچه باید در مورد آن بدانید آرایه به عنوان مهمترین ساختار ذخیره داده، اکثر برنامه نویس ها از آرایه بهره می برند. آرایه مجموعهای از دادههایی است که خصوصیات زیر را داشته باشد :
همگی از یک نوع داده باشند در خانههای پیوسته حافظه قرار گیرند دو نوع آرایه داریم:
آرایه تک بعدی آرایه های چند بعدی لیست پیوندی ساختمان داده ای که از تعدادی نود تشکیل شده است در حالی که هر نود در برگیرنده دیتا و آدرس نود بعدی است.
مشاوره بلوغ داده
ساختمان داده و هر آنچه باید در مورد آن بدانید پشته پشته مجموعه ای پویا از داده ها است که هنگام حذف عنصر از این مجموعه، آخرین عنصر اضافه شده به مجموعه از آن حذف میشود. اصطلاحا به این روش حذف داده های LIFO (Last In First Out) گفته میشود. بنابراین پشته ترتیب خروج عناصر را کنترل میکند. در نتیجه برای دسترسی به یک عنصر، ابتدا باید عناصری را که پس از آن به پشته وارد شدهاند از پشته خارج کرد.
ساختمان داده و هر آنچه باید در مورد آن بدانید صف ساختمان داده صف یک لیست است که عناصر جدید به انتهای صف اضافه میشوند و در هنگام حذف، عناصر از ابتدای صف حذف می شوند. ساختمان داده صف برای مدیریت نوبت عناصر از الگوریتم FIFO(First In First Out) استفاده میکند که بر طبق آن هر عنصری که زودتر وارد صف شود زودتر سرویس میگیرد
عملیات اصلی که روی صف انجام میگیرد
ENQUEUE (Q,X) : اضافه کردن عنصر x به انتهای صف Q
DEQUEUE (Q) : حذف یک عنصر از ابتدای صف Q و بازگرداندن آن عنصر بعنوان خروجی
درخت مجموعه ای از عناصر که گره نام دارند را درخت می نامند. یکی از این گره ها در جایگاه ریشه درخت و سایر گره ها در زیر ریشه قرار دارند. از درخت به منظور آنالیز مدارهای الکترونیکی، بیان رابطهها، سازماندهی دادهها در پایگاه های دادهای و بیان ساختارهای گرامری در کامپایلرها استفاده میشود.
درخت جستجوی دودویی (BST: Binary Search Tree) درختی است که در درون هر نودش یک عدد وجود دارد و اعداد همگی متمایزاند، در این درخت هر نودی از تمامی نودهای زیر درخت چپ اش بزرگتر و از تمامی نودهای زیر درخت راست اش کوچکتر است
مقایسه ساختمان های داده انواع ساختمان های داده دارای معایب و مزایایی هستند که در این بحث معمولا سه عملیات درج، حذف و بازیابی عنصر مد نظر قرار می گیرند. برای کسب اطلاعات بیشتر در این زمینه، مطالعه بحث ساختمان داده در سایت کنکور کامپیوتر خالی از لطف نیست.
بنا بر ارتباط تنگاتنگ ساختمان های داده و طراحی الگوریتم و از آنجایی که داده های خروجی، حاصل اجرای الگوریتمی خاص روی داده های ورودی هستند، مراحل حل مساله و طراحی الگوریتم به صورت زیر خواهد بود:
تبدیل مسئله به یک مدل ریاضی که توسط کامپیوتر قابل حل باشد طرح یک الگوریتم برای حل آن مسئله انتخاب ساختمان داده مناسب برای الگوریتمی که طرح کرده ایم از آن جا که برنامه خوب برنامه ای است که هم ساختمان داده مناسبی داشته باید و هم از الگوریتمهای بهینه تری استفاده کند، در اینجا به بررسی دو مورد زیر میپردازیم:
چگونگی تحلیل الگوریتم بررسی ساختمان دادهها تحلیل الگوریتم ها در تحلیل الگوریتم ها، از آنجا که تعداد عملیات هر الگوریتم برای اجرا شدن رابطه مستقیمی با زمان اجرای آن دارد و با در نظر گرفتن این که زمان اجرا وابسته به معیارهای متفاوتی نظیر پردازنده کامپیوتر، نوع کامپایلر، سرعت پردازنده، چگونگی پیاده سازی الگوریتم و بسیاری موادر دیگر است، با در دست داشتن معیاری مشخص می توانیم کارایی الگوریتمها از نظر مدت زمان اجرا را، مستقل از عوامل مذکور با هم مقایسه کنیم.
از آنجا که حجم داده های ورودی همواره متغیر است، در تحلیل زمان اجرای الگوریتمها تابعی نیاز است که تعداد عملیات انجام شده توسط یک الگوریتم را بر حسب اندازه ورودی بیان کند. حال محاسبه این تابع کاری دشوار و در مواقعی غیر ممکن است؛ به همین علت برای مقایسه الگوریتمها از معیاری به نام نرخ رشد توابع استفاده میکنند.
نرخ رشد میزان افرایش تعداد عملیات یک الگوریتم بر اثر افزایش اندازه ورودی را نشان میدهد.
ساختمان داده و هر آنچه باید در مورد آن بدانید
علم داده بررسی ساختمان داده ها عملیات روی هر ساختمان داده را میتوان در دو دسته کلی طبقه بندی کرد: 1) Query ها یا درخواست ها
2) Update ها
Queryها آن دسته از عملیات هستند که تغییری در محتویات ساختمان داده ها ایجاد نمیکنند، مانند جستجوی یک عنصر، شمارش تعداد عناصر موجود در ساختمان داده و … Update ها عملیاتی هستند که سبب تغییر در مقدار یا چینش عناصر ساختمان داده میشوند، مانند اضافه کردن یک عنصر جدید، حذف عناصر موجود و …
منبع: همیار ای تی
0 notes
Text
Solved:Lab 4: Circular Queue ADT
Implement Circular Queue ADT using an array. Your Circular Queue ADT has two main operations, Enqueue and Dequeue. In addition, you should implement two more functions for printing the first element and the last element. Enqueue a new element at the end of the element in the queue. If your queue is full, just print an error message. Dequeue the node in the front. If your list does not have any…
View On WordPress
0 notes
Text
#avoidplastics #FollowTrafficRules #ourbestqualityproduct #ontimematerialdispatch #bestproducts #goodwillenginnering #DrugFreeSociety #GuideElements Guide elements absorb transverse forces that occur and prevent contact between the piston rod and cylinder cover and between the piston and cylinder barrel in hydraulic and pneumatic cylinders. As nouns, the difference between disadvantage and advantage is that disadvantage is a weakness or undesirable characteristic; a con while the advantage is any condition, circumstance, opportunity, or means, particularly favorable to success, or any desired end. The major advantage of using a priority queue is that you will be able to quickly access the highest priority item with a time complexity of just O(1). The only disadvantage of using Priority Queues are that the enqueue and dequeue operations are slow and have a time complexity
#avoidplastics#FollowTrafficRules#ourbestqualityproduct#ontimematerialdispatch#bestproducts#goodwillenginnering#DrugFreeSociety#GuideElements#Guide elements absorb transverse forces that occur and prevent contact between the piston rod and cylinder cover and between the piston and#As nouns#the difference between disadvantage and advantage is that disadvantage is a weakness or undesirable characteristic; a con while the advanta#circumstance#opportunity#or means#particularly favorable to success#or any desired end.#The major advantage of using a priority queue is that you will be able to quickly access the highest priority item with a time complexity o
0 notes
Text
lovely friend yells NIGHTMARE SCENARIO whenever we encounter some sort of frantic but low-stakes disaster (i need to dump out a pot of pasta into a colander but they're all dirty!, etc) which has wedged itself into the ecolect
i highly recommend you get silly and overdramatic with it whenever possible. when someone announces they're going to the bathroom, tell them "godspeed". friend experiences a run of moderately shitty events? lost the mandate of heaven. today i announced to everyone in the house "besties, romans, countrymen: this is literally our last roll of toilet paper"
#enqueue and dequeue#it looks wrong as NIGHTMARE SCENARIO#in my head it's NITEMARE SCENARIO#but NITEMARE looks wrong as well. but that's how i pronounce it. in my head. there's no difference though.
96 notes
·
View notes
Link
Data Structures and Algorithms from Zero to Hero and Crack Top Companies 100+ Interview questions (Java Coding)
What you’ll learn
Java Data Structures and Algorithms Masterclass
Learn, implement, and use different Data Structures
Learn, implement and use different Algorithms
Become a better developer by mastering computer science fundamentals
Learn everything you need to ace difficult coding interviews
Cracking the Coding Interview with 100+ questions with explanations
Time and Space Complexity of Data Structures and Algorithms
Recursion
Big O
Dynamic Programming
Divide and Conquer Algorithms
Graph Algorithms
Greedy Algorithms
Requirements
Basic Java Programming skills
Description
Welcome to the Java Data Structures and Algorithms Masterclass, the most modern, and the most complete Data Structures and Algorithms in Java course on the internet.
At 44+ hours, this is the most comprehensive course online to help you ace your coding interviews and learn about Data Structures and Algorithms in Java. You will see 100+ Interview Questions done at the top technology companies such as Apple, Amazon, Google, and Microsoft and how-to face Interviews with comprehensive visual explanatory video materials which will bring you closer to landing the tech job of your dreams!
Learning Java is one of the fastest ways to improve your career prospects as it is one of the most in-demand tech skills! This course will help you in better understanding every detail of Data Structures and how algorithms are implemented in high-level programming languages.
We’ll take you step-by-step through engaging video tutorials and teach you everything you need to succeed as a professional programmer.
After finishing this course, you will be able to:
Learn basic algorithmic techniques such as greedy algorithms, binary search, sorting, and dynamic programming to solve programming challenges.
Learn the strengths and weaknesses of a variety of data structures, so you can choose the best data structure for your data and applications
Learn many of the algorithms commonly used to sort data, so your applications will perform efficiently when sorting large datasets
Learn how to apply graph and string algorithms to solve real-world challenges: finding shortest paths on huge maps and assembling genomes from millions of pieces.
Why this course is so special and different from any other resource available online?
This course will take you from the very beginning to very complex and advanced topics in understanding Data Structures and Algorithms!
You will get video lectures explaining concepts clearly with comprehensive visual explanations throughout the course.
You will also see Interview Questions done at the top technology companies such as Apple, Amazon, Google, and Microsoft.
I cover everything you need to know about the technical interview process!
So whether you are interested in learning the top programming language in the world in-depth and interested in learning the fundamental Algorithms, Data Structures, and performance analysis that make up the core foundational skillset of every accomplished programmer/designer or software architect and is excited to ace your next technical interview this is the course for you!
And this is what you get by signing up today:
Lifetime access to 44+ hours of HD quality videos. No monthly subscription. Learn at your own pace, whenever you want
Friendly and fast support in the course Q&A whenever you have questions or get stuck
FULL money-back guarantee for 30 days!
This course is designed to help you to achieve your career goals. Whether you are looking to get more into Data Structures and Algorithms, increase your earning potential, or just want a job with more freedom, this is the right course for you!
The topics that are covered in this course.
Section 1 – Introduction
What are Data Structures?
What is an algorithm?
Why are Data Structures And Algorithms important?
Types of Data Structures
Types of Algorithms
Section 2 – Recursion
What is Recursion?
Why do we need recursion?
How does Recursion work?
Recursive vs Iterative Solutions
When to use/avoid Recursion?
How to write Recursion in 3 steps?
How to find Fibonacci numbers using Recursion?
Section 3 – Cracking Recursion Interview Questions
Question 1 – Sum of Digits
Question 2 – Power
Question 3 – Greatest Common Divisor
Question 4 – Decimal To Binary
Section 4 – Bonus CHALLENGING Recursion Problems (Exercises)
power
factorial
products array
recursiveRange
fib
reverse
palindrome
some recursive
flatten
capitalize first
nestedEvenSum
capitalize words
stringifyNumbers
collects things
Section 5 – Big O Notation
Analogy and Time Complexity
Big O, Big Theta, and Big Omega
Time complexity examples
Space Complexity
Drop the Constants and the nondominant terms
Add vs Multiply
How to measure the codes using Big O?
How to find time complexity for Recursive calls?
How to measure Recursive Algorithms that make multiple calls?
Section 6 – Top 10 Big O Interview Questions (Amazon, Facebook, Apple, and Microsoft)
Product and Sum
Print Pairs
Print Unordered Pairs
Print Unordered Pairs 2 Arrays
Print Unordered Pairs 2 Arrays 100000 Units
Reverse
O(N) Equivalents
Factorial Complexity
Fibonacci Complexity
Powers of 2
Section 7 – Arrays
What is an Array?
Types of Array
Arrays in Memory
Create an Array
Insertion Operation
Traversal Operation
Accessing an element of Array
Searching for an element in Array
Deleting an element from Array
Time and Space complexity of One Dimensional Array
One Dimensional Array Practice
Create Two Dimensional Array
Insertion – Two Dimensional Array
Accessing an element of Two Dimensional Array
Traversal – Two Dimensional Array
Searching for an element in Two Dimensional Array
Deletion – Two Dimensional Array
Time and Space complexity of Two Dimensional Array
When to use/avoid array
Section 8 – Cracking Array Interview Questions (Amazon, Facebook, Apple, and Microsoft)
Question 1 – Missing Number
Question 2 – Pairs
Question 3 – Finding a number in an Array
Question 4 – Max product of two int
Question 5 – Is Unique
Question 6 – Permutation
Question 7 – Rotate Matrix
Section 9 – CHALLENGING Array Problems (Exercises)
Middle Function
2D Lists
Best Score
Missing Number
Duplicate Number
Pairs
Section 10 – Linked List
What is a Linked List?
Linked List vs Arrays
Types of Linked List
Linked List in the Memory
Creation of Singly Linked List
Insertion in Singly Linked List in Memory
Insertion in Singly Linked List Algorithm
Insertion Method in Singly Linked List
Traversal of Singly Linked List
Search for a value in Single Linked List
Deletion of a node from Singly Linked List
Deletion Method in Singly Linked List
Deletion of entire Singly Linked List
Time and Space Complexity of Singly Linked List
Section 11 – Circular Singly Linked List
Creation of Circular Singly Linked List
Insertion in Circular Singly Linked List
Insertion Algorithm in Circular Singly Linked List
Insertion method in Circular Singly Linked List
Traversal of Circular Singly Linked List
Searching a node in Circular Singly Linked List
Deletion of a node from Circular Singly Linked List
Deletion Algorithm in Circular Singly Linked List
A method in Circular Singly Linked List
Deletion of entire Circular Singly Linked List
Time and Space Complexity of Circular Singly Linked List
Section 12 – Doubly Linked List
Creation of Doubly Linked List
Insertion in Doubly Linked List
Insertion Algorithm in Doubly Linked List
Insertion Method in Doubly Linked List
Traversal of Doubly Linked List
Reverse Traversal of Doubly Linked List
Searching for a node in Doubly Linked List
Deletion of a node in Doubly Linked List
Deletion Algorithm in Doubly Linked List
Deletion Method in Doubly Linked List
Deletion of entire Doubly Linked List
Time and Space Complexity of Doubly Linked List
Section 13 – Circular Doubly Linked List
Creation of Circular Doubly Linked List
Insertion in Circular Doubly Linked List
Insertion Algorithm in Circular Doubly Linked List
Insertion Method in Circular Doubly Linked List
Traversal of Circular Doubly Linked List
Reverse Traversal of Circular Doubly Linked List
Search for a node in Circular Doubly Linked List
Delete a node from Circular Doubly Linked List
Deletion Algorithm in Circular Doubly Linked List
Deletion Method in Circular Doubly Linked List
Entire Circular Doubly Linked List
Time and Space Complexity of Circular Doubly Linked List
Time Complexity of Linked List vs Arrays
Section 14 – Cracking Linked List Interview Questions (Amazon, Facebook, Apple, and Microsoft)
Linked List Class
Question 1 – Remove Dups
Question 2 – Return Kth to Last
Question 3 – Partition
Question 4 – Sum Linked Lists
Question 5 – Intersection
Section 15 – Stack
What is a Stack?
What and Why of Stack?
Stack Operations
Stack using Array vs Linked List
Stack Operations using Array (Create, isEmpty, isFull)
Stack Operations using Array (Push, Pop, Peek, Delete)
Time and Space Complexity of Stack using Array
Stack Operations using Linked List
Stack methods – Push, Pop, Peek, Delete, and isEmpty using Linked List
Time and Space Complexity of Stack using Linked List
When to Use/Avoid Stack
Stack Quiz
Section 16 – Queue
What is a Queue?
Linear Queue Operations using Array
Create, isFull, isEmpty, and enQueue methods using Linear Queue Array
Dequeue, Peek and Delete Methods using Linear Queue Array
Time and Space Complexity of Linear Queue using Array
Why Circular Queue?
Circular Queue Operations using Array
Create, Enqueue, isFull and isEmpty Methods in Circular Queue using Array
Dequeue, Peek and Delete Methods in Circular Queue using Array
Time and Space Complexity of Circular Queue using Array
Queue Operations using Linked List
Create, Enqueue and isEmpty Methods in Queue using Linked List
Dequeue, Peek and Delete Methods in Queue using Linked List
Time and Space Complexity of Queue using Linked List
Array vs Linked List Implementation
When to Use/Avoid Queue?
Section 17 – Cracking Stack and Queue Interview Questions (Amazon, Facebook, Apple, Microsoft)
Question 1 – Three in One
Question 2 – Stack Minimum
Question 3 – Stack of Plates
Question 4 – Queue via Stacks
Question 5 – Animal Shelter
Section 18 – Tree / Binary Tree
What is a Tree?
Why Tree?
Tree Terminology
How to create a basic tree in Java?
Binary Tree
Types of Binary Tree
Binary Tree Representation
Create Binary Tree (Linked List)
PreOrder Traversal Binary Tree (Linked List)
InOrder Traversal Binary Tree (Linked List)
PostOrder Traversal Binary Tree (Linked List)
LevelOrder Traversal Binary Tree (Linked List)
Searching for a node in Binary Tree (Linked List)
Inserting a node in Binary Tree (Linked List)
Delete a node from Binary Tree (Linked List)
Delete entire Binary Tree (Linked List)
Create Binary Tree (Array)
Insert a value Binary Tree (Array)
Search for a node in Binary Tree (Array)
PreOrder Traversal Binary Tree (Array)
InOrder Traversal Binary Tree (Array)
PostOrder Traversal Binary Tree (Array)
Level Order Traversal Binary Tree (Array)
Delete a node from Binary Tree (Array)
Entire Binary Tree (Array)
Linked List vs Python List Binary Tree
Section 19 – Binary Search Tree
What is a Binary Search Tree? Why do we need it?
Create a Binary Search Tree
Insert a node to BST
Traverse BST
Search in BST
Delete a node from BST
Delete entire BST
Time and Space complexity of BST
Section 20 – AVL Tree
What is an AVL Tree?
Why AVL Tree?
Common Operations on AVL Trees
Insert a node in AVL (Left Left Condition)
Insert a node in AVL (Left-Right Condition)
Insert a node in AVL (Right Right Condition)
Insert a node in AVL (Right Left Condition)
Insert a node in AVL (all together)
Insert a node in AVL (method)
Delete a node from AVL (LL, LR, RR, RL)
Delete a node from AVL (all together)
Delete a node from AVL (method)
Delete entire AVL
Time and Space complexity of AVL Tree
Section 21 – Binary Heap
What is Binary Heap? Why do we need it?
Common operations (Creation, Peek, sizeofheap) on Binary Heap
Insert a node in Binary Heap
Extract a node from Binary Heap
Delete entire Binary Heap
Time and space complexity of Binary Heap
Section 22 – Trie
What is a Trie? Why do we need it?
Common Operations on Trie (Creation)
Insert a string in Trie
Search for a string in Trie
Delete a string from Trie
Practical use of Trie
Section 23 – Hashing
What is Hashing? Why do we need it?
Hashing Terminology
Hash Functions
Types of Collision Resolution Techniques
Hash Table is Full
Pros and Cons of Resolution Techniques
Practical Use of Hashing
Hashing vs Other Data structures
Section 24 – Sort Algorithms
What is Sorting?
Types of Sorting
Sorting Terminologies
Bubble Sort
Selection Sort
Insertion Sort
Bucket Sort
Merge Sort
Quick Sort
Heap Sort
Comparison of Sorting Algorithms
Section 25 – Searching Algorithms
Introduction to Searching Algorithms
Linear Search
Linear Search in Python
Binary Search
Binary Search in Python
Time Complexity of Binary Search
Section 26 – Graph Algorithms
What is a Graph? Why Graph?
Graph Terminology
Types of Graph
Graph Representation
The graph in Java using Adjacency Matrix
The graph in Java using Adjacency List
Section 27 – Graph Traversal
Breadth-First Search Algorithm (BFS)
Breadth-First Search Algorithm (BFS) in Java – Adjacency Matrix
Breadth-First Search Algorithm (BFS) in Java – Adjacency List
Time Complexity of Breadth-First Search (BFS) Algorithm
Depth First Search (DFS) Algorithm
Depth First Search (DFS) Algorithm in Java – Adjacency List
Depth First Search (DFS) Algorithm in Java – Adjacency Matrix
Time Complexity of Depth First Search (DFS) Algorithm
BFS Traversal vs DFS Traversal
Section 28 – Topological Sort
What is Topological Sort?
Topological Sort Algorithm
Topological Sort using Adjacency List
Topological Sort using Adjacency Matrix
Time and Space Complexity of Topological Sort
Section 29 – Single Source Shortest Path Problem
what is Single Source Shortest Path Problem?
Breadth-First Search (BFS) for Single Source Shortest Path Problem (SSSPP)
BFS for SSSPP in Java using Adjacency List
BFS for SSSPP in Java using Adjacency Matrix
Time and Space Complexity of BFS for SSSPP
Why does BFS not work with Weighted Graph?
Why does DFS not work for SSSP?
Section 30 – Dijkstra’s Algorithm
Dijkstra’s Algorithm for SSSPP
Dijkstra’s Algorithm in Java – 1
Dijkstra’s Algorithm in Java – 2
Dijkstra’s Algorithm with Negative Cycle
Section 31 – Bellman-Ford Algorithm
Bellman-Ford Algorithm
Bellman-Ford Algorithm with negative cycle
Why does Bellman-Ford run V-1 times?
Bellman-Ford in Python
BFS vs Dijkstra vs Bellman Ford
Section 32 – All Pairs Shortest Path Problem
All pairs shortest path problem
Dry run for All pair shortest path
Section 33 – Floyd Warshall
Floyd Warshall Algorithm
Why Floyd Warshall?
Floyd Warshall with negative cycle,
Floyd Warshall in Java,
BFS vs Dijkstra vs Bellman Ford vs Floyd Warshall,
Section 34 – Minimum Spanning Tree
Minimum Spanning Tree,
Disjoint Set,
Disjoint Set in Java,
Section 35 – Kruskal’s and Prim’s Algorithms
Kruskal Algorithm,
Kruskal Algorithm in Python,
Prim’s Algorithm,
Prim’s Algorithm in Python,
Prim’s vs Kruskal
Section 36 – Cracking Graph and Tree Interview Questions (Amazon, Facebook, Apple, Microsoft)
Section 37 – Greedy Algorithms
What is a Greedy Algorithm?
Well known Greedy Algorithms
Activity Selection Problem
Activity Selection Problem in Python
Coin Change Problem
Coin Change Problem in Python
Fractional Knapsack Problem
Fractional Knapsack Problem in Python
Section 38 – Divide and Conquer Algorithms
What is a Divide and Conquer Algorithm?
Common Divide and Conquer algorithms
How to solve the Fibonacci series using the Divide and Conquer approach?
Number Factor
Number Factor in Java
House Robber
House Robber Problem in Java
Convert one string to another
Convert One String to another in Java
Zero One Knapsack problem
Zero One Knapsack problem in Java
Longest Common Sequence Problem
Longest Common Subsequence in Java
Longest Palindromic Subsequence Problem
Longest Palindromic Subsequence in Java
Minimum cost to reach the Last cell problem
Minimum Cost to reach the Last Cell in 2D array using Java
Number of Ways to reach the Last Cell with given Cost
Number of Ways to reach the Last Cell with given Cost in Java
Section 39 – Dynamic Programming
What is Dynamic Programming? (Overlapping property)
Where does the name of DC come from?
Top-Down with Memoization
Bottom-Up with Tabulation
Top-Down vs Bottom Up
Is Merge Sort Dynamic Programming?
Number Factor Problem using Dynamic Programming
Number Factor: Top-Down and Bottom-Up
House Robber Problem using Dynamic Programming
House Robber: Top-Down and Bottom-Up
Convert one string to another using Dynamic Programming
Convert String using Bottom Up
Zero One Knapsack using Dynamic Programming
Zero One Knapsack – Top Down
Zero One Knapsack – Bottom Up
Section 40 – CHALLENGING Dynamic Programming Problems
Longest repeated Subsequence Length problem
Longest Common Subsequence Length problem
Longest Common Subsequence problem
Diff Utility
Shortest Common Subsequence problem
Length of Longest Palindromic Subsequence
Subset Sum Problem
Egg Dropping Puzzle
Maximum Length Chain of Pairs
Section 41 – A Recipe for Problem Solving
Introduction
Step 1 – Understand the problem
Step 2 – Examples
Step 3 – Break it Down
Step 4 – Solve or Simplify
Step 5 – Look Back and Refactor
Section 41 – Wild West
Download
To download more paid courses for free visit course catalog where 1000+ paid courses available for free. You can get the full course into your device with just a single click. Follow the link above to download this course for free.
3 notes
·
View notes
Text
300+ TOP SAP ABAP Objective Questions and Answers
SAP ABAP Multiple Choice Questions :-
1. This data type has a default length of one and a blank default value. A: I B: N C: C D: D Ans:C 2. A DATA statement may appear only at the top of a program, before START-OFSELECTION. A: True B: False Ans:B 3. If a field, NAME1, is declared as a global data object, what will be output by the following code? report zabaprg. DATA: name1 like KNA1-NAME1 value 'ABAP programmer'. name1 = 'Customer name'. CLEAR name1. perform write_name. FORM write_name. name1 = 'Material number'. WRITE name1. ENDFORM. A: Customer name B: ABAP programmer C: Material number D: None of the above Ans:C 4. All of these allow you to step through the flow of a program line-by-line except: A: Enter /h then execute B: Execute in debug mode C: Enter /i then execute D: Set a breakpoint Ans: C 5. Which of the following may NOT be modified using the ABAP Dictionary transaction? A: Type groups B: Search help C: Lock objects D: Function groups Ans:D 6. In a line of code, text-100, is an example of which type of text element? A: Text symbol B: Selection text C: Text title D: Text identifier Ans:A 7. The editor function that formats and indents the lines of code automatically is called ____. A: Auto align B: Pretty printer C: Generate version D: Syntax check Ans:B 8. A DO loop increments the system field ____. A: SY-LOOPI B: SY-TABIX C: SY-LSIND D: SY-INDEX Ans: D 9. The event that is processed after all data has been read but before the list is displayed is: A: END-OF-PAGE. B: START-OF-SELECTION. C: END-OF-SELECTION. D: AT LINE-SELECTION. Ans:A ? C 10. The field declared below is of what data type? DATA: new_fld(25). A: P B: N C: I D: C Ans: D
SAP ABAP MCQs 11. In regard to the INITIALIZATION event, which of the following is NOT a true statement? A: Executed before the selection screen is displayed. B: You should use SET PF-STATUS here. C: You can assign different values to PARAMETERS and SELECT-OPTIONS here. D: Executed one time when you start the report. Ans: B 12. The event AT SELECTION-SCREEN OUTPUT. occurs before the selection screen is displayed and is the best event for assigning default values to selection criteria. A: True B: False Ans: B 13. The business (non-technical) definition of a table field is determined by the field's ____. A: domain B: field name C: data type D: data element Ans: D 14. In regard to the three-tier client/server architecture, which of the following is a true statement? A: The presentation server processes the SAP program logic. B: An application server is responsible for updating database tables. C: Typically, there is a one-to-one ratio of database servers to presentation servers. D: The application server layer is the level between a presentation server and a database server. Ans: D,B 15. What will be output by the code below? DATA: alph type I value 3. write: alph. WHILE alph > 2. write: alph. alph = alph - 1. ENDWHILE. A: 3 B: 3 2 C: 3 3 2 D: 3 3 Ans: D 16. To allow the user to enter a single value on a selection screen, use the ABAP keyword ____. A: SELECT-OPTIONS. B: PARAMETERS. C: RANGES. D: DATA. Ans: B 17. What will be output by the following code? DATA: BEGIN OF itab OCCURS 0, fval type i, END OF itab. itab-fval = 1. APPEND itab. itab-fval = 2. APPEND itab. REFRESH itab. WRITE: /1 itab-fval. A: 1 B: 2 C: blank D: 0 Ans: B 18. You can define your own key fields when declaring an internal table. A: True B: False Ans: A 19. When modifying an internal table within LOOP AT itab. _ ENDLOOP. you must include an index number. A: True B: False Ans : B 20. If itab contains 20 rows, what will SY-TABIX equal when the program reaches the WRITE statement below? SY-TABIX = 10. LOOP AT itab. count_field = count_field + 1. ENDLOOP. WRITE: /1 count_field. A: 0 B: 10 C: 20 D: 30 Ans: C 21. Adding a COMMIT WORK statement between SELECT_ENDSELECT is a good method for improving performance. A: True B: False Ans:B 22. To select one record for a matching primary key, use ____. A: SELECT B: SELECT INTO C: SELECT SINGLE D: SELECT ENTRY Ans: C 23. In regard to MOVE-CORRESPONDING, which of the following is NOT a true statement? A: Moves the values of components with identical names. B: Fields without a match are unchanged. C: Corresponds to one or more MOVE statements. D: Moves the values of components according to their location. Ans: D 24. The ABAP keyword for adding authorizations to a program is ____. A: AUTH-CHECK B: AUTHORITY-CHECK C: AUTHORIZATION-CHECK D: AUTHORITY-OBJECT Ans:B 25. To read an exact row number of an internal table, use this parameter of the READ TABLE statement. A: INDEX B: TABIX C: ROW D: WHERE Ans: B ? A 26. To remove lines from a database table, use ____. A: UPDATE B: MODIFY C: ERASE D: DELETE Ans: D 27. Which table type would be most appropriate for accessing table rows using an index. A: Hashed table B: Standard table C: Sorted table D: None of these may be accessed using an index. Ans: C 28. The following code indicates: SELECTION-SCREEN BEGIN OF BLOCK B1. PARAMETERS: myparam(10) type C, Myparam2(10) type N, SELECTION-SCREEN END OF BLOCK. A: Draw a box around myparam and myparam2 on the selection screen. B: Allow myparam and myparam2 to be ready for input during an error dialog. C: Do not display myparam and myparam2 on the selection screen. D: Display myparam and myparam2 only if both fields have default values. Ans: A 29. The following code reorders the rows so that: DATA: itab LIKE kna1 OCCURS 0 WITH HEADER LINE. itab-name1 = 'Smith'. itab-ort01 = 'Miami'. APPEND itab. itab-name1 = 'Jones'. itab-ort01 = 'Chicago'. APPEND itab. itab-name1 = 'Brown'. itab-ort01 = 'New York'. APPEND itab. SORT itab BY name1 ort01. A: Smith appears before Jones B: Jones appears before Brown C: Brown appears before Jones D: Miami appears before New York Ans: C 30. If a table contains many duplicate values for a field, minimize the number of records returned by using this SELECT statement addition. A: MIN B: ORDER BY C: DISTINCT D: DELETE Ans:C 31. When writing a SELECT statement, you should place as much load as possible on the database server and minimize the load on the application server. A: True B: False Ans: B 32. All of the following pertain to interactive reporting in ABAP except: A: Call transactions and other programs from a list. B: Secondary list shows detail data. C: Good for processing lists in background. D: AT USER-COMMAND Ans:C 33. In regard to a function group, which of the following is NOT a true statement? A: Combines similar function modules. B: Shares global data with all its function modules. C: Exists within the ABAP workbench as an include program. D: Shares subroutines with all its function modules. Ans: D 34. Errors to be handled by the calling program are defined in a function module's ____. A: exceptions interface B: source code C: exporting interface D: main program Ans :A 35. In regard to the START-OF-SELECTION event, which of the following is a true statement? A: Executed before the selection screen is displayed. B: This is the only event in which a SELECT statement may be coded. C: Executed when the user double-clicks a list row. D: Automatically started by the REPORT statement. Ans:D 36. The order in which an event appears in the ABAP code determines when the event is processed. A: True B: False Ans: B 37. The SAP service that ensures data integrity by handling locking is called: A: Update B: Dialog C: Enqueue/Dequeue D: Spool Ans: C 38. What standard data type is the following user-defined type? TYPES: user_type. A: N B: C C: I D: Undefined Ans: B 39. Which ABAP program attribute provides access protection? A: Status B: Application C: Development class D: Authorization group Ans:D 40. Page headers for a secondary list should be coded in which event? A: TOP-OF-PAGE. B: START-OF-SELECTION. C: TOP-OF-PAGE DURING LINE-SELECTION. D: AT USER-COMMAND. Ans: C 41. Given: PERFORM subroutine USING var. The var field is known as what type of parameter? A: Formal B: Actual C: Static D: Value Ans:B 42. The following statement will result in a syntax error.DATA: price(3) type p decimals 2 value '100.23'. A: True B: False Ans: B 43. The following code indicates:CALL SCREEN 300. A: Start the PAI processing of screen 300. B: Jump to screen 300 without coming back. C: Temporarily branch to screen 300. * D: Exit screen 300. Ans:C 44. Which of the following would be stored in a table as master data? A: Customer name and address B: Sales order items C: Accounting invoice header D: Vendor credit memo Ans: A 45. In relation to an internal table as a formal parameter, because of the STRUCTURE syntax, it is possible to: A: Use the DESCRIBE statement within a subroutine. B: Loop through the internal table within a subroutine. C: Access the internal table fields within a subroutine. D: Add rows to the internal table within a subroutine. Ans: C 46. This data type has a default length of one and a default value = '0'. A: P B: C C: N D: I Ans: C 47. To prevent duplicate accesses to a master data field: A: Create an index on the master data field. B: Remove nested SELECT statements. C: Use SELECT SINGLE. D: Buffer the data in an internal table. Ans: A ? C 48. In regard to the code below, which of the following is not a true statement? TABLES: KNA1. GET KNA1. Write: /1 kna1-kunnr. END-OF-SELECTION. A: The GET event is processed while a logical database is running. B: All the fields from table KNA1 may be used in the GET event. C: You can code the GET event elsewhere in the same program. D: None of the above. Ans: D 49. The following code indicates: SELECT fld1 FROM tab1 INTO TABLE itab UP TO 100 ROWS WHERE fld7 = pfld7. A: Itab will contain 100 rows. B: Only the first 100 records of tab1 are read. C: If itab has less than 100 rows before the SELECT, SY-SUBRC will be set to 4. D: None of the above. Ans: D 50. To place a checkbox on a list, use A: WRITE CHECKBOX. B: FORMAT CHECKBOX ON. C: WRITE fld AS CHECKBOX. D: MODIFY LINE WITH CHECKBOX. Ans:C 51. Which of the following is NOT a true statement in regard to a sorted internal table type? A: May only be accessed by its key. B: Its key may be UNIQUE or NON-UNIQUE. C: Entries are sorted according to its key when added. D: A binary search is used when accessing rows by its key. Ans: A 52. The following code indicates: CALL SCREEN 9000 STARTING AT 10 5 ENDING AT 60 20 A: Screen 9000 is called with the cursor at coordinates (10,5)(60,20). B: Screen 9000 must be of type "Modal dialog box." C: Display screen 9000 in a full window. D: Screen 9000 may only contain an ABAP list. Ans:A 53. After a DESCRIBE TABLE statement SY-TFILL will contain A: The number of rows in the internal table. B: The current OCCURS value. C: Zero, if the table contains one or more rows. D: The length of the internal table row structure. Ans:A 54. Function module source code may not call a subroutine. A: True B: False Ans: B 55. This data type has a default length of eight and a default value = '00000000'. A: P B: D C: N D: C Ans: B 56. Within the source code of a function module, errors are handled via the keyword: A: EXCEPTION B: RAISE C: STOP D: ABEND Ans:B 57. Which of these is NOT a valid type of function module? A: Normal B: Update C: RFC D: Dialog Ans:D 58. To call a local subroutine named calculate answer, use this line of code: A: PERFORM calculate answer. B: CALL calculate answer. C: USING calculate answer. D: SUB calculate answer. Ans:A 59. Given: DO. Write: /1 'E equals MC squared.'. ENDDO. This will result in ____. A: output of 'E equals MC squared.' on a new line one time B: an endless loop that results in an abend error C: output of 'E equals MC squared.' on a new line many times D: a loop that will end when the user presses ESC Ans.B 60. The following code indicates write: /5 'I Love ABAP'. A: Output 'I Lov' on the current line B: Output 'I Love ABAP' starting at column 5 on the current line C: Output 'I Lov' on a new line D: Output 'I Love ABAP' starting at column 5 on a new line Ans: D 61. Which of the following is NOT a component of the default standard ABAP report header? A: Date and Time B: List title C: Page number D: Underline Ans: A 62. A select statement has built-in authorization checks. A: True B: False Ans:B 63. A BDC program is used for all of the following except: A: Downloading data to a local file B: Data interfaces between SAP and external systems C: Initial data transfer D: Entering a large amount of data Ans:B 64. Page footers are coded in the event: A: TOP-OF-PAGE. B: END-OF-SELECTION. C: NEW-PAGE. D: END-OF-PAGE. Ans:D 65. Page headers for a secondary/details list can be coded in the event: A: GET. B: INITIALIZATION. C: TOP-OF-PAGE DURING LINE-SELECTION. D: NEW-PAGE. Ans:C 66. To both add or change lines of a database table, use ____. A: INSERT B: UPDATE C: APPEND D: MODIFY Ans:D 67. To select one record for a matching primary key, use ____. A: SELECT B: SELECT INTO C: SELECT SINGLE D: SELECT ENTRY Ans:C 68. After adding rows to an internal table with COLLECT, you should avoid adding More rows with APPEND. A: True B: False Ans:A 69. The output for the following code will be report zabaprg. DATA: my_field type I value 99. my_field = my_field + 1. clear my_field. WRITE: 'The value is', my_field left-justified. A: The value is 99 B: The value is 100 C: The value is 0 D: None of the above Ans: C 70. If this code results in an error, the remedy is SELECT * FROM tab1 WHERE fld3 = pfld3. WRITE: /1 tab1-fld1, tab1-fld2. ENDSELECT. A: Add a SY-SUBRC check. B: Change the * to fld1 fld2. C: Add INTO (tab1-fld1, tab1-fld2). D: There is no error. Ans: C,D 71. To summarize the contents of several matching lines into a single line, use this SELECT statement clause. A: INTO B: WHERE C: FROM D: GROUP BY Ans:D 72. What is output by the following code? DATA: BEGIN OF itab OCCURS 0, letter type c, END OF itab. itab-letter = 'A'. APPEND itab. itab-letter = 'B'. APPEND itab. itab-letter = 'C'. APPEND itab. itab-letter = 'D'. APPEND itab. LOOP AT itab. SY-TABIX = 2. WRITE itab-letter. EXIT. ENDLOOP. A: A B: A B C D C: B D: B C D Ans: A 73. All of the following are considered to be valid ABAP modularization techniques except: A: Subroutine B: External subroutine C: Field-group D: Function module Ans:C 74. To create a list of the top 25 customers, you should use A: DELETE ADJACENT DUPLICATES B: READ TABLE itab INDEX 25 C: LOOP AT itab FROM 25 D: APPEND SORTED BY Ans:D 75. Which of these sentences most accurately describes the GET VBAK LATE. event? A: This event is processed before the second time the GET VBAK event is processed. B: This event is processed after all occurrences of the GET VBAK event are completed. C: This event will only be processed after the user has selected a basic list row. D: This event is only processed if no records are selected from table VBAK. Ans:B 76. In an R/3 environment, where is the work of a dialog program performed? A: On the application server using a dialog work process service. B: On the presentation server using a dialog work process service. C: On the database server using a dialog work process service. D: None of the above. Ans: A 77. In regard to Native SQL, which of the following is NOT a true statement? A: A CONNECT to the database is done automatically. B: You must specify the SAP client. C: The tables that you address do not have to exist in the ABAP Dictionary. D: Will run under different database systems. Ans:D 78. To change one or more lines of a database table, use ____. A: UPDATE B: INSERT C: INTO D: MOD Ans:A 79. Which is the correct sequence of events? A: AT SELECTION-SCREEN, TOP-OF-PAGE, INITIALIZATION B: START-OF-SELECTION, AT USER-COMMAND, GET dbtab C: INITIALIZATION, END-OF-SELECTION, AT LINE-SELECTION D: GET dbtab, GET dbtab LATE, START-OF-SELECTION Ans:B 80. Which of the following is NOT a numeric data type? A: I B: N C: P D: F Ans: B SAP ABAP Questions and Answers pdf Download Read the full article
2 notes
·
View notes
Text
messing with descriptors for fun and profit (mostly fun)
from collections import deque class ExampleAutoDelegate: _queue = AttrDelegate() __iter__, __len__, __repr__ = _queue.inherit(3) enqueue = _queue.append dequeue = _queue.popleft size = property(__len__) def __init__(self, q): self._queue = deque(q)
it just works(tm)
2 notes
·
View notes
Text
i went to pt for a foot injury a few years ago, and i was like "yeah, I hurt my left foot recently. help. it hurts."
they had me walk in front of them, and then said "your left foot? really? not your right foot?"
well, now that you mention it, i had spectacularly fucked up my right foot years prior; my ankle swelled like a balloon. and it does splay out substantially more than my left foot. and it does interfere with riding a bike n'at. i just thought i was naturally duckfooted and there was nothing to be done about it.
they made me do some really boring exercises for a few weeks, and now my feet both point forward, i don't get sore ankles from walking long distances, and my heel doesn't smack into the chainstays on my bike anymore.
If I could give one piece of life advice to my fellow humans, it would be this highly specific little chestnut: "If you ever sprain your ankle, get medical care."
One of the most common things I've heard from older people than myself is, "Oh yeah, I twisted my ankle in (insert grade of school here) and it's never been the same." Or, "I have a bad ankle. I can't tell you how many times I've sprained it." And one of the most common things I've heard from younger people is some variation on, "Yeah, I think I just twisted my ankle. I think I have some old crutches from high school at my parents' house. I'll just use those for a few days."
I didn't learn this until after I sprained my ankle last year, but 20% of ankle sprains lead to chronic ankle instability, which was grimly defined by my doctor as, "an unending cycle of ankle sprains."
Another thing I didn't fully understand is that "sprain" is an umbrella term for any of those ligament injuries. Yeah, you could simply stretch the ligament-- twist it. Or you could tear it. Or you could completely sever it, and those are all sprains. If you're not a doctor, it's likely hard to tell what degree of sprain you have. The worse the sprain, the higher the chance of it healing weird and becoming unstable. If you are having trouble putting weight on your ankle and it's not feeling better the next day, please get it checked out!
I know medical care is expensive and many of us don't have health insurance, but it might cost you more in the long run if you don't get care for a hurt ankle. Otherwise you might spend a lifetime of having to get MORE ankle injuries checked out, missing work or social opportunities due to ankle injury, having to limit exercise, surgeries later in life, and more.
When I hurt my ankle and foot last year, I assumed the broken foot bone would be the bigger concern, but my treatment plan was almost entirely centered around the ankle ligament tear. My doctor said that was the more serious injury and the more finicky bit to heal. I worry when I hear a friend mention they sprained their ankle and were just treating it at home, 'trying to stay off it as much as I can.' That usually means a few days, but I had to stay completely off mine for 4 weeks, followed by a walking boot, a brace, and months of physical therapy. It was intense!
Ankles are annoying because they support your entire darn body and you don't realize how much you need them until you hurt one. So that is the one nugget of wisdom I hope to leave all of you with!
14K notes
·
View notes
Text
Prerequisites I - DS 101
Abstract Data Type
An abstract piece of code that is re-usable and serves the purpose by hiding the inner workings of it and only exposing the interface for generic usage is known as an abstract data type.
For example, a user who needs to implement a railway booking engine to serve the user requests based on first-in, first-out (FIFO) method, will have to implement the queue for the specific use-case with operations such as enqueue & dequeue. The disadvantage of this approach is that the queue will have to be reimplemented for other use-cases that simulate the queue. This can be solved by having an abstract data type queue which implements the basic functionality (operations) of the queue and can be imported anywhere else it is required.
An abstract data type (ADT) can be thought of as a data declaration packaged along with the operations that are meaningful for the data.
ADT Implementations
Most data is required to be stored as either as linear or as a non-linear structure. An example of a linear and non-linear data structure would be an array and a tree respectively.
We have two basic structures to implement complex ADT list (both linear and non-linear): arrays and linked-lists.
Arrays can be used to store sequential data, where the data in a specific cell can be accessed efficiently if the index (address) is known, but it is very inefficient to add or remove new/existing elements. On the other hand, linked-lists do us a great favor in efficiently adding and removing nodes (atomic units of linked-lists), but are inefficient at accessing a node directly.
Node: It is a data structure that has a data part and link part (holds multiple links if it is non-linear), pointing to the next element(s).
Analysis of Algorithms
When there are no loops in a program (it is linear, which means it is a set of instructions), the efficiency of the program directly depends on the speed of the CPU. Hence, algorithm analysis focuses mostly on the loops (given that recursion can always be converted to a loop). The efficiency of a program (or an algorithm) is always a function of the number of elements to be processed/accessed.
Example:
n = 11 for i in range(n): # will create a list of numbers from 0 to 10 for j in range(i): # some code here return
The above code would run 55 times, as the inner loop would be a dependant on the value of i for each ith loop. When the value of i is 0, the inner loop runs 0 times, when i is 1, the inner loop runs 1 times and so on till the value of i is 10. If we choose the see the pattern, it would basically be: 1 + 2 + 3 + ... + 10. And if we consider it as a function of n, then: f(n) = n*(n+1)/2.
Big-O Notation
It is a notation to describe/represent the worst case runtime of an algorithm. The Big-O, as in "on the order of" is an approximate measure of efficiency and since it is only an estimate, we can focus only on the dominant factor in the equation.
Considering the previous example, the worst case scenario would be O(n^2).
Significance and other notations.
There are other notations of different measures of efficiency such as the theta notation and the omega notation. As with the Big-O notation defines the upper bound of the function, the omega function defines the lower bound or the best case runtime.
The theta notation is basically a function with 2 constants, where one represents an upper bound and the other represents the lower bound. Given a function f(n), there exists k and K such that n*k
2 notes
·
View notes