#Data Structures

20 posts loaded — scroll for more

Text
aspensmonster
aspensmonster

Nerdsniped by a Bad Update

So apparently Tumblr is making changes. This has made a lot of people very angry and been widely regarded as a bad move.

But! The computer engineer in me is still intrigued by the idea of exposing more of the reblog tree for interaction. Or even using data about the tree for sorting/ranking. So here goes.

The old behaviour exposes only aggregate note counts, no matter what part of the tree you encounter. You see OP? 1,000 reblogs listed. You see a lengthy chain of reblog replies emanating from OP? 1,000 reblogs listed.

The new behaviour dis-aggregates those numbers, doing something like this, BUT ONLY SHOWING 1st-child RBs on any given node!:

4 [1st-child RBs] / 11 [all child-RBs] <– OP
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 1 [1st-child RBs] / 1 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 3 [1st-child RBs] / 5 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 1 [1st-child RBs] / 1 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 1 [1st-child RBs] / 1 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 1 [1st-child RBs] / 1 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]

SO, if a big influx of activity on a post happens deeply in the tree (or really, anywhere deeper than direct-child), like this:

4 [1st-child RBs] / 111 [all child-RBs] <– OP
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 1 [1st-child RBs] / 1 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 3 [1st-child RBs] / 105 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 1 [1st-child RBs] / 1 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 1 [1st-child RBs] / 101 [all child-RBs]
|- 100 [1st-child RBs] / 100 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]

… and so on for 100 of these rows

|- 1 [1st-child RBs] / 1 [all child-RBs]
|- 0 [1st-child RBs] / 0 [all child-RBs]

Then OP’s badges still only show the “4” for the number of 1st-child RBs! There’s no indication of the extra activity! Boo! And apparently, OP might not even get any notification at all about the activity that goes beyond their own 1st-children? Double boo! Maybe? People seem more split on when/how they want notifications than on whether or not they want to see the aggregate numbers. But that, I suppose, is a tunable thing that can be configured per-user.

In any event, I think it makes sense to have the “all child-RBs” number included in the tallies and shown in the interface. I also think only including child reblogs (and not ALL reblogs across the entire tree) helps to identify (1) where interesting conversations and contributions are happening, and (2) how interest is flowing across the userbase.

An aside on comments: apparently, comments are now segmented according to the specific node of the tree they’re on? Rather than being a single comment space for the entire tree? That seems to be a bad move that’s definitely frustrating people too. I’ve never really used the comment feature though, given how paltry its threading interface is.

Text
nishachari
nishachari

Nerds be so bored they come up with logic for the most absurd non existent problems WHAT DO YOU MEAN SPLAY TREE. SPLAY !!!!! SpLAy THAT’S NOT EVEN CREATIVE.

Text
luxorstudyblrcursed
luxorstudyblrcursed

Python Tutorial | Learn Python Programming Language - GeeksforGeeks

Text
arachnidsgrep
arachnidsgrep

I’ve been in CS / Tech for a while now and only just realised that a rope is called that because it is like a string, but bigger.

Text
wuwubean
wuwubean

homestuck is absolutely a product of it’s time but reading it for the first time the jokes that have aged the best are the sylladex data structure ones. because in 2009 the joke was ‘13 year olds using hashmaps’ but today programming interviews are basically just tests on how well you know your data structures. suddenly this nerdy piece of worldbuilding becomes satire on how data structures are seen as the most important thing ever for no reason and it’s hilarious

Text
hackeocafe
hackeocafe

I built a site that can get data from anywhere

Text
mauveh-online
mauveh-online

Coding Blocks is a podcast hosted by two software engineering professionals, each with over a decade of industry experience. In the field of computer engineering, topics like data structures, documentation, and code comments are essential for building and maintaining efficient computer systems. A solid grasp of data structures improves performance, while clear documentation and understandable comments make it easier for others to read, use, and expand on your work. For more insights from experienced software engineers, the podcast episode above offers valuable perspectives and practical advice.

Text
coding-quark
coding-quark

Heaps in Python : https://pythonguides.com/priority-queue-in-python/

Note: Heapq is a min heap so in order to solve max heap questions, i can tak negative values

Text
coding-quark
coding-quark
Text
contentsmith
contentsmith

Binary Search in Java (Made Super Simple)

Hey folks!

If you’re new to programming or just getting started with Java, you might’ve come across the term Binary Search. It might sound a little intimidating at first, but trust me, once you get the hang of it, it’s actually a pretty neat and efficient way to search through data.

Let’s break it down in a super simple way.

Imagine you have a sorted list of numbers — something like [2, 5, 8, 12, 16, 23, 38, 45, 56, 72, 91]. Now, let’s say you want to find out if the number 23 is in that list. You could go one by one, checking each number (this is called linear search), but that would take time — especially if the list is super long.

Enter Binary Search. Instead of checking each number, binary search cuts the list in half, checks the middle value, and then decides whether to go left or right, depending on whether the number you’re looking for is smaller or bigger than the middle value. This continues until the number is found, or until the list can’t be split anymore.

It’s kind of like playing a number guessing game. Say you’re told to guess a number between 1 and 100, and after every guess, you’re told whether your guess was too high or too low. Instead of guessing randomly, you’d usually go for the middle, like 50, then adjust based on the feedback. That’s basically how binary search works!

In Java, writing a binary search algorithm is pretty straightforward. It usually involves using a while loop, checking the middle index of the array, and updating the start and end points based on your comparisons. With just a few lines of code, you get a fast and efficient way to search.

If you want a clear and beginner friendly explanation along with the Java code, do check out this page: Binary Search in Java.

It explains the logic step-by-step, and the example makes it easy to follow even if you’re just starting out with coding. Practicing small programs like this is a great way to build your confidence and understanding of how algorithms work.

So yeah, binary search isn’t scary at all. Give it a shot, play around with the code, and see how it works in action. Once you get it, you’ll feel pretty good about adding it to your programming toolbox.

Text
coding-quark
coding-quark

Cheat Sheet for python data structure time complexity:

(https://www.geeksforgeeks.org/complexity-cheat-sheet-for-python-operations/)

Text
unicminds-codingforkids
unicminds-codingforkids
Text
cant-think-of-a-good-one
cant-think-of-a-good-one

how do you decide which project or thing to do next?

queue - continue the thing you started earliest

stack - continue the thing you started most recently

tape - other system

Text
webthreecorp
webthreecorp

Mastering Linked Lists: Beginner’s Guide

Hey Tumblr friends 👋

After learning about Arrays, it’s time to level up!
Today we’re diving into Linked Lists — another fundamental building block of coding! 🧱✨

So… What is a Linked List? 🤔

Imagine a treasure hunt 🗺️:

  • You find a clue ➡️ it points you to the next clue ➡️ and so on.

That’s how a Linked List works!

🔗 Each element (Node) holds data and a pointer to the next Node.

It looks something like this:
[data | next] -> [data | next] -> [data | next] -> NULL


Why Use a Linked List? 🌈

✅ Dynamic size (no need to pre-define size like arrays!)
✅ Easy insertions and deletions ✨
✅ Great for building stacks, queues, and graphs later!

❌ Slower to access elements (you can’t jump straight to an item like arrays).


Basic Structure of a Linked List Node 🛠️

data -> stores the actual value

next -> points to the next node

📚 CRUD Operations on Linked Lists

Let’s build simple CRUD functions for a singly linked list in C++!
(🚀 CRUD = Create, Read, Update, Delete)


Create (Insert Nodes)

Read (Display the list)

Update (Change a Node’s Value)

Delete (Remove a Node)

🌟 Final Thoughts

🔗 Linked Lists may look tricky at first, but once you master them, you’ll be ready to understand more powerful structures like Stacks, Queues, and even Graphs! 🚀

🌱 Mini Challenge:

  • Build your own linked list of your favorite songs 🎶
  • Practice inserting, updating, and deleting songs!

If you loved this explainer, give a follow and let’s keep leveling up together! 💬✨
Happy coding, coder fam! 💻🌈


For more resources and help join our discord server

Text
webthreecorp
webthreecorp

🌟 Understanding Arrays: A Beginner’s Deep Dive! 🌟

Hey Tumblr friends 👋

Today I want to break down something super important if you’re getting into coding: Arrays.
(Yes, those weird-looking brackets you’ve probably seen in code snippets? Let’s talk about them.)

So… What Exactly Is an Array? 🤔

Imagine you have a bunch of favorite songs you want to save. Instead of creating a new playlist for each song (chaotic!), you put them all into one single playlist.

That playlist? That’s what an Array is in programming! 🎶✨

An array is basically a container where you can store multiple values together under a single name.

Instead of doing this:

You can just do:


Why Are Arrays Useful? 🌈

✅ You can group related data together.
✅ You can loop through them easily.
✅ You can dynamically access or update data.
✅ You keep your code clean and organized. (No messy variables 👀)

How Do You Create an Array? ✨

Here’s a simple array:

Or create an empty array first (you must specify size in C++):

Note: C++ arrays have a fixed size once declared!

How Do You Access Items in an Array? 🔎

Arrays are zero-indexed. That means the first element is at position 0.

Example:

Changing Stuff in an Array 🛠️

You can update an item like this:

Looping Through an Array 🔄

Instead of writing:

Use a loop:

Or a range-based for loop (cleaner!):


Some Cool Things You Can Do With Arrays 🚀

In C++ you don’t have built-in methods like push, pop, etc. for raw arrays, but you can use vectors (dynamic arrays)!
Example with vector:

Quick Tip: Arrays Can Store Anything 🤯

You can store numbers, booleans, objects (structures/classes), and even arrays inside arrays (multidimensional arrays).

Example:


Real-World Example 🌍

A To-Do list:

Output:

👏 See how clean and readable that is compared to hardcoding every single task?

🌟 Final Thoughts

Arrays are the foundation of so much you’ll do in coding — from simple projects to complex apps.
Master them early, and you’ll thank yourself later!

🌱 Start practicing:

  • Make a list of your favorite movies
  • Your favorite foods
  • Songs you love
  • …all in an array!

If you liked this C++ explainer, let’s connect! 💬✨
Happy coding, coder fam! 💻🌈

Text
vic-sinclair-96
vic-sinclair-96

Yeah man I know all about data structures, I read Homestuck

Text
attitudetallyacademy
attitudetallyacademy

Top 10 C Programming Tips to Write Efficient & Error-Free Code

Introduction

C programming is one of the most powerful languages, forming the foundation of modern software development. Whether you are a beginner or an experienced coder, writing efficient and error-free code is crucial. Here are 10 expert tips to help you improve your C programming skills and write optimized code with ease.

1. Master the Basics Before Diving into Advanced Concepts

Before exploring advanced topics like Data Structure Training in Yamuna Vihar or C++ Coaching Institute in Uttam Nagar, ensure you have a strong foundation in C programming basics. Understanding variables, loops, functions, and pointers will make complex topics easier.

2. Use Meaningful Variable and Function Names

Descriptive variable names improve code readability. Instead of writing:

c

CopyEdit

int x = 10; 

Use:

c

CopyEdit

int studentCount = 10; 

Similarly, functions should clearly indicate their purpose, making debugging and collaboration easier.

3. Keep Your Code Simple and Structured

Avoid writing lengthy, complex code. Break your program into small functions, making it more readable and reusable. If you’re preparing for Java Training in Uttam Nagar, learning structured coding will be highly beneficial.

4. Use Comments to Explain Your Code

Comments help in understanding the logic behind the code. Always include meaningful comments, especially for complex logic or functions.

c

Copy Edit

// Function to calculate area of a rectangle 

int calculateArea(int length, int width) { 

    return length * width; 

5. Avoid Using Too Many Global Variables

Excessive use of global variables can lead to unwanted bugs and memory issues. Instead, prefer local variables and pass values through function arguments. This is especially important when learning Data Structure Course in Yamuna Vihar or C++ Training Institute in Uttam Nagar.

6. Optimize Memory Usage

Efficient memory management ensures smooth execution. Use malloc() and free() wisely to allocate and deallocate memory dynamically. If you’re considering Computer Science Training in Uttam Nagar, mastering memory management will be a great advantage.

c

CopyEdit

int *ptr = (int*) malloc(sizeof(int) * 10); 

free(ptr); // Always free allocated memory  

7. Always Initialize Variables Before Use

Uninitialized variables can lead to unpredictable results. For example:

c

CopyEdit

int num; 

printf(“%d”, num);  // Undefined behavior 

To avoid errors, always initialize variables before using them.

8. Debugging: Use Print Statements & Debuggers

Using debugging tools like gdb or adding printf() statements can help you quickly identify errors. Debugging is a key skill, whether you’re learning SQL Classes in Yamuna Vihar or preparing for MySQL Training in Uttam Nagar.

9. Follow Standard Coding Practices

Consistent coding style makes programs easier to read. Maintain proper indentation, spacing, and structured loops to keep your code clean.

Example of well-structured code:

c

CopyEdit

for(int i = 0; i < 10; i++) { 

    printf(“Number: %d\n”, i); 

10. Practice, Practice & More Practice!

The best way to master C programming is through constant practice. Work on projects, build small applications, and enroll in C++ Classes in Yamuna Vihar or Data Structure Training Institute in Uttam Nagar to sharpen your skills.

Final Thoughts

By following these 10 essential tips, you can write optimized, bug-free, and efficient C programs. Whether you are learning Java Coaching in Yamuna Vihar or preparing for MySQL Coaching Institute in Uttam Nagar, strong C programming skills will help you succeed in the world of coding.

If you’re looking for structured training in C, C++, Java, SQL, and Data Structures, explore expert-led computer science courses in Uttam Nagar to enhance your programming expertise! For that Visit Us

Suggested Links

Text
ultrasemiautomatic
ultrasemiautomatic

Fixing stuff that was never meant to be broken

I am cs student, gradating in a month. I got no job yet, haven’t been consistent with DSA, and learning things. My goals? barely started. So I decided to use this blog as my accountability tracker(?)

What I’ll post about:

(Weekly or twice a week)

  • My DSA struggles
  • Research papers I read
  • Rants, reflections and maybe some new things I did that day which turned out to be productive :)

No idea if this will work, but I’ll keep on trying, one day or the other.

Would love to interact with my fellow people who are stuck, struggling like me, or trying to improving their career or just grinding.

I have wasted a lot of my time as a student. I am now regretting, but I still am young, I think I’ll take my chances.

Text
tutort-academy
tutort-academy

📊 Are Your Data Visualizations Misleading People? 🚨

A well-designed chart can tell a powerful story, but a poorly designed one can mislead your audience—intentionally or not. Misrepresenting data through distorted scales, missing context, or cherry-picked insights can lead to wrong decisions and lost trust.

Good data visualization isn’t just about aesthetics; it’s about clarity, accuracy, and transparency. Whether you’re creating dashboards, reports, or presentations, always ask yourself:
✅ Does this chart represent the data fairly?
✅ Could someone misinterpret this?
✅ Am I focusing on insights, not just design?

Let’s be responsible storytellers with data! 📉📈

Text
justnshalom
justnshalom

Mastering Medium Level LeetCode Problems: A Comprehensive Guide for Interview Preparation

Introduction
Are you preparing for technical interviews and looking to strengthen your problem-solving skills? Look no further than medium level LeetCode problems. These problems strike the perfect balance between complexity and accessibility. They require a deeper understanding of algorithms and data structures while still being manageable within a reasonable time frame.
In this guide, we will…