/r/datastructures
What's better than one data structure? Two data structures.
Let's discuss the latest hip and fashionable data structures and conjectures about them:
cache trees, skip-splay trees, the world is our data oyster.
/r/datastructures
Hey everyone,
I’m looking for an accountability partner to stay consistent and motivated while preparing for Data Structures and Algorithms (DSA). I’m a software engineer with a goal of improving my problem-solving skills, staying disciplined, and preparing for coding interviews.
therefore its implementations would be data structures also?for ex could we describe quick find as a algorithm or data structure?
A coach wants to give gold coins to the participants based on their performance. Each participant can see his coins, participate adjacent to him and adjacent to them. I.e, for ith index, participant see coins given from i-2 to i+2. Find the sum of minimum coins given. Eg input: [35, 14, 42, 44, 39] Output: 6 -> [1,0,2,3,0] Input: [26, 10, 45, 35, 38, 41, 16] Output: 14 -> [1, 0, 4, 2, 3, 4, 0]
There's a minimum chocolate program on geeksforgeeks, but in that only i-1, i, and i+1 are visible and I am not getting the same after applying that idea.
I know it is a frequently asked question here but i would like to know how to approach DSA questions as a noobie. I was thinking of starting to watch Greg Hogg DSA playlist in order from arrays to dynamic programming to learn the concepts and then I solve the neetcode 150.
So here are my questions:
You can also share your approach and how you went on solving the neetcode 150 and prep for the interviews !
Hey everyone,
I'm in a challenging situation with a corrupted-21.4GB\multiple MP4 video file(s), and this is actually a recurring problem for me. I could really use some advice on both recovering this file and preventing this issue in the future. Here's the situation:
moov
atom (movie header). it has it but not all of it or maybe corrupted?ftyp
(file type) box, a uuid
(user-defined metadata) box, and an mdat
(media data) box. The mdat
box is partially present.moov
atom before it died.untrunc
*:** This tool specifically designed for repairing truncated MP4/MOV files, recovered only about 1.2 minutes after a long processing time.untrunc
in the past, but that file exhibited some stuttering in editing software.ffmpeg
to repair the corrupted file by referencing the healthy file. The command appeared to succeed and created a new file, but the new file was simply an exact copy of the healthy reference file, not a repaired version of the corrupted file. Here's the commands I used:
ffmpeg -i "corrupted.mp4" -i "reference.mp4" -map 0 -map 1:a -c copy "output.mp4"
* [mov,mp4,m4a,3gp,3g2,mj2 @ 0000018fc82a77c0] moov atom not found
[in#0 @ 0000018fc824e080] Error opening input: Invalid data found when processing input
Error opening input file corrupted.mp4.
Error opening input files: Invalid data found when processing input]
ffmpeg -f concat -safe 0 -i reference.txt -c copy repaired.mp4
* [mov,mp4,m4a,3gp,3g2,mj2 @ 0000023917a24940] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1001
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000023917a24940] st: 0 edit list 1 Cannot find an index entry before timestamp: 1001.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000023917a24940] Auto-inserting h264_mp4toannexb bitstream filter
[concat @ 0000023917a1a800] Could not find codec parameters for stream 2 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[aist#0:1/pcm_s16be @ 0000023917a2bcc0] Guessed Channel Layout: stereo
Input #0, concat, from 'reference.txt':
Duration: N/A, start: 0.000000, bitrate: 97423 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/arib-std-b67, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 95887 kb/s, 29.97 fps, 29.97 tbr, 30k tbn
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Video Media Handler
vendor_id : [0][0][0][0]
encoder : AVC Coding
Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Sound Media Handler
vendor_id : [0][0][0][0]
Stream #0:2: Unknown: none
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Output #0, mp4, to 'repaired.mp4':
Metadata:
encoder : Lavf61.6.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/arib-std-b67, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 95887 kb/s, 29.97 fps, 29.97 tbr, 30k tbn
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Video Media Handler
vendor_id : [0][0][0][0]
encoder : AVC Coding
Stream #0:1(und): Audio: pcm_s16be (ipcm / 0x6D637069), 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
creation_time : 2024-03-02T06:31:33.000000Z
handler_name : Sound Media Handler
vendor_id : [0][0][0][0]
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000023919b48d00] moov atom not foundrate=97423.8kbits/s speed=2.75x
[concat @ 0000023917a1a800] Impossible to open 'F:\\Ep09\\Dr.AzizTheGuestCam\\Corrupted.MP4'
[in#0/concat @ 0000023917a1a540] Error during demuxing: Invalid data found when processing input
[out#0/mp4 @ 00000239179fdd00] video:21688480KiB audio:347410KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.011147%
frame=55530 fps= 82 q=-1.0 Lsize=22038346KiB time=00:30:52.81 bitrate=97439.8kbits/s speed=2.75x
Untrunc analyze
* 0:ftyp(28)
28:uuid(148)
176:mdat(23056088912)<--invalidlength
39575326:drmi(2571834061)<--invalidlength
55228345:sevc(985697276)<--invalidlength
68993972:devc(251968636)<--invalidlength
90592790:mean(4040971770)<--invalidlength
114142812:ctts(1061220881)<--invalidlength
132566741:avcp(2779720137)<--invalidlength
225447106:stz2(574867640)<--invalidlength
272654889:skip(2657341105)<--invalidlength
285303108:alac(3474901828)<--invalidlength
377561791:subs(3598836581)<--invalidlength
427353464:chap(2322845602)<--invalidlength
452152807:tmin(3439956571)<--invalidlength
491758484:dinf(1760677206)<--invalidlength
566016259:drmi(1893792058)<--invalidlength
588097258:mfhd(3925880677)<--invalidlength
589134677:stsc(1334861112)<--invalidlength
616521034:sawb(442924418)<--invalidlength
651095252:cslg(2092933789)<--invalidlength
702368685:sync(405995216)<--invalidlength
749739553:stco(2631111187)<--invalidlength
827587619:rtng(49796471)<--invalidlength
830615425:uuid(144315165)
835886132:ilst(3826227091)<--invalidlength
869564533:mvhd(3421007411)<--invalidlength
887130352:stsd(3622366377)<--invalidlength
921045363:elst(2779671353)<--invalidlength
943194122:dmax(4005550402)<--invalidlength
958080679:stsz(3741307762)<--invalidlength
974651206:gnre(2939107778)<--invalidlength
1007046387:iinf(3647882974)<--invalidlength
1043020069:devc(816307868)<--invalidlength
1075510893:trun(1752976169)<--invalidlength
1099156795:alac(1742569925)<--invalidlength
1106652272:jpeg(3439319704)<--invalidlength
1107417964:mfhd(1538756873)<--invalidlength
1128739407:trex(610792063)<--invalidlength
1173617373:vmhd(2809227644)<--invalidlength
1199327317:samr(257070757)<--invalidlength
1223984126:minf(1453635650)<--invalidlength
1225730123:subs(21191883)<--invalidlength
1226071922:gmhd(392925472)<--invalidlength
1274024443:m4ds(1389488607)<--invalidlength
1284829383:iviv(35224648)<--invalidlength
1299729513:stsc(448525299)<--invalidlength
1306664001:xml(1397514514)<--invalidlength
1316470096:dawp(1464185233)<--invalidlength
1323023782:mean(543894974)<--invalidlength
1379006466:elst(1716974254)<--invalidlength
1398928786:enct(4166663847)<--invalidlength
1423511184:srpp(4082730887)<--invalidlength
1447460576:vmhd(2307493423)<--invalidlength
1468795885:priv(1481525149)<--invalidlength
1490194207:sdp(3459093511)<--invalidlength
1539254593:hdlr(2010257153)<--invalidlength
untrunc
, recover_mp4.exe
, or others that I've mentioned, these tools have not been helpful in my particular case!?!Additional Information and Files I Can Provide:
Is there any possibility of recovering more than just the first portion of this particular 21.4 GB video? While a significant amount of data appears to be missing, could those fragmented "moov" occurrences be used to somehow reconstruct a partial moov
atom, at least enough to make more of the mdat
data (even if incomplete) accessible?
Any insights into advanced MP4 repair techniques, particularly regarding moov
reconstruction?
Recommendations for tools (beyond the usual video repair software) that might be helpful in analyzing the MP4 structure at a low level?
Anyone with experience in hex editing or data recovery who might be able to offer guidance?
Additional Information and Files I Can Provide:
Corrupt file metadata from Mediainfo:
<?xml version="1.0" encoding="UTF-8"?>
<MediaInfo xmlns="<https://mediaarea.net/mediainfo>" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" xsi:schemaLocation="<https://mediaarea.net/mediainfo> <https://mediaarea.net/mediainfo/mediainfo_2_0.xsd>" version="2.0">
<creatingLibrary version="24.11.1" url="<https://mediaarea.net/MediaInfo>">MediaInfoLib</creatingLibrary>
<media ref="Z:\\Penjere\\01Season\\Production\\Ep11\\Dr.AzizTheGuestCam\\Corrupted.MP4">
<track type="General">
<FileExtension>MP4</FileExtension>
<Format>XAVC</Format>
<CodecID>XAVC</CodecID>
<CodecID_Compatible>XAVC/mp42/iso2</CodecID_Compatible>
<FileSize>23056715861</FileSize>
<StreamSize>23056715861</StreamSize>
<HeaderSize>176</HeaderSize>
<DataSize>23056088912</DataSize>
<FooterSize>626773</FooterSize>
<IsStreamable>No</IsStreamable>
<File_Created_Date>2025-01-23 06:05:54.544 UTC</File_Created_Date>
<File_Created_Date_Local>2025-01-23 09:05:54.544</File_Created_Date_Local>
<File_Modified_Date>2024-11-15 09:12:59.754 UTC</File_Modified_Date>
<File_Modified_Date_Local>2024-11-15 12:12:59.754</File_Modified_Date_Local>
</track>
</media>
</MediaInfo>
Metadata from camera itself (auto generated xml file):
<NonRealTimeMeta xmlns="urn:schemas-professionalDisc:nonRealTimeMeta:ver.2.00" xmlns:lib="urn:schemas-professionalDisc:lib:ver.2.00" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" lastUpdate="2024-03-02T12:33:48+05:00">
<TargetMaterial umidRef="060A2B340101010501010D4313000000E8160286710306D2747A90FFFE064421"/>
<Duration value="57810"/>
<LtcChangeTable tcFps="30" halfStep="false">
<LtcChange frameCount="0" value="63263704" status="increment"/>
<LtcChange frameCount="57809" value="60350905" status="end"/>
</LtcChangeTable>
<CreationDate value="2024-03-02T12:33:48+05:00"/>
<VideoFormat>
<VideoRecPort port="DIRECT"/>
<VideoFrame videoCodec="AVC_3840_2160_HP@L51" captureFps="29.97p" formatFps="29.97p"/>
<VideoLayout pixel="3840" numOfVerticalLine="2160" aspectRatio="16:9"/>
</VideoFormat>
<AudioFormat numOfChannel="2">
<AudioRecPort port="DIRECT" audioCodec="LPCM16" trackDst="CH1"/>
<AudioRecPort port="DIRECT" audioCodec="LPCM16" trackDst="CH2"/>
</AudioFormat>
<Device manufacturer="Sony" modelName="ILCE-7RM4" serialNo="4294967295"/>
<RecordingMode type="normal" cacheRec="false"/>
<AcquisitionRecord>
<Group name="CameraUnitMetadataSet">
<Item name="CaptureGammaEquation" value="rec2100-hlg"/>
<Item name="CaptureColorPrimaries" value="rec709"/>
<Item name="CodingEquations" value="rec709"/>
</Group>
</AcquisitionRecord>
</NonRealTimeMeta>
https://i.redd.it/h3vrh6zb1ree1.png
I know this is a complex issue, and I really appreciate anyone who takes the time to consider my problem and offer any guidance. Thank you in advance for your effort and for sharing your expertise. I'm grateful for any help this community can provide.
Hi everyone, I am preparing for my college placements and I'm currently deciding whether to follow the Striver DSA sheet or focus on LeetCode's Interview 150 problems. Which one would you recommend for efficient preparation and better coverage of commonly asked questions?
How to learn and master DSA? I am finding it incredibly hard? Is there any particular approach which will make it easier to learn and understand and crack interviews? How to get consistent? Please Dm
I am 20M
Currently i am learning DSA from a youtube channel
I want some certificates to put on my linkedIn
Can someone please tell me some free platforms where i can get a certificate of completion or anything like that for DSA.
I don't want to watch their specific course as i am doing it already from a youtube channel
I am 20M
Currently i am learning DSA from a youtube channel
I want some certificates to put on my linkedIn
Can someone please tell me some free platforms where i can get a certificate of completion or anything like that for DSA.
I don't want to watch their specific course as i am doing it already from a youtube channel
Hey ,
I’m entering my 3rd semester, and I’ve got Data Structures and Algorithms (DSA) and Object-Oriented Programming (OOP) in my coursework this time. Honestly, my programming fundamentals (Java) weren’t that strong last semester because I didn’t put in enough effort. But now, I want to make a solid comeback and aim to be the best in my class.
I want to develop a strong grip on DSA and OOP concepts, and I’m determined to work hard. I’d really appreciate your guidance on the following:
How to Master DSA and OOP:
Daily Routine/Roadmap:
Best Practices for Coding:
Motivation and Mindset:
I’ve heard that DSA is the backbone of competitive programming and interviews, and I don’t want to miss out on mastering it. The same goes for OOP—understanding concepts like inheritance, polymorphism, and abstraction is crucial for writing clean and efficient code.
To anyone willing to share tips, resources, or even personal experiences, my DMs are open. I’m eager to learn from professionals and enthusiasts here because I know I won’t get this level of insight from anywhere else.
Let me know how you tackled these subjects or how I can make the most of my time. I’m ready to put in the work—I just need some direction!
Thanks in advance!
I have a common question. What is the difference between k-ary and n-ary trees in Data Structures and Algorithms? Are they both the same, or is the k-ary tree always fixed (e.g., k = 10) while n is more dynamic? I asked AI, but sometimes it gives me one answer and sometimes another.
I have tried a couple books but don't know where to begin. I try yt videos, I understand concepts but trying even medium leetcode problems puts me to shame. I can only think of brute force methods and sometimes not even that. Every time I try solving them, I feel like a failure. I am already in my second year of college (half way done) and I am scared about placements. If I can't solve basic sums how can I even begin specializing??
Sorry for venting out here.
TLDR; where do I learn dsa from and how do I get better at problem solving?
Original post: Summary: Summary: Animation video on Floyd-Warshall Algo
Read the full blog post here: https://www.interviewhelp.io/blog/posts/summary_summary_animation_video_on_floyd-warshall_/
Original post: Hash Tables Visually Explained
Read the full blog post here: https://www.interviewhelp.io/blog/posts/hash_tables_visually_explained/
Original post: How much DSA is enough to get a job at a Product based Company as Software Engineer?
Read the full blog post here: https://www.interviewhelp.io/blog/posts/how_much_dsa_is_enough_to_get_a_job_at_a_product_b/
Original post: Upload a full 4 hours animated course on DSA
Read the full blog post here: https://www.interviewhelp.io/blog/posts/upload_a_full_4_hours_animated_course_on_dsa/
Original post: Data structure
Read the full blog post here: https://www.interviewhelp.io/blog/posts/data_structure_/
Original post: Data Structures and Algorithms
Read the full blog post here: https://www.interviewhelp.io/blog/posts/data_structures_and_algorithms/
Original post: Need guidance on where to start DSA
Read the full blog post here: https://www.interviewhelp.io/blog/posts/_need_guidance_on_where_to_start_dsa/
Can anyone solve this question? https://www.hackerearth.com/problem/algorithm/the-pizza-eating-contest-397ec3cd-7df06718/
Hi All, I just started my DSA and wanted to target MAANG. I have a total of 7 years of work exp and it's totally into prod support roles where was no hands on coding. Right now, I want to concentrate more on DSA and will be preparing for System Design in parallel to this. Can someone please guide me how to start. I am an ECE graduate and can code in Python but can't provide optimal solutions. Please experts from this team, please advice...
pls help me find some final exams to solve
I want to make my dsa logic better can you suggest me some ways how can I achieve that
Hi, I want to upgrade my DSA skills so that I could increase my chances of getting a job at a Product Based Company as a Software Engineer, However I am unable to find a definite answer/ resource to this,
I felt these as very confusing, time consuming and sometimes not Trust worthy at all considering some sell these courses for monetary benefit.
Can anyone reading my question draft a solid plan based on real experience which has 90% chance of success irrespective of the company I apply for the role of Software Engineer. My Programming Language of preference is Python.
Original post: Summary: Animation video on Floyd-Warshall Algo
Read the full blog post here: https://www.interviewhelp.io/blog/posts/summary_animation_video_on_floyd-warshall_algo/