473,396 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

can't find time needed to load 6 file in a linked list?

THIS IS WHAT MY PROGRAM SHOULD SHOW:
Please enter the representation to use: List, BST, Hash Maps
BST
Please enter a filename:
files.txt
File loaded successfully. 6 files loaded from the file in 0 seconds and 548 microseconds.


PROBLEM:
"0 seconds and 548 microseconds"

(CAN'T CALCULATE TIME TAKEN IN FILE LOADING)

I am new in c language and in my program what we have to do is to load 6 files of almost 15000+ words total and must calculate the time taken in seconds and microseconds both but there are so many ways to load and show times but none of it work exactly as it shown and i can't think of logic how it going to work so

if someone please provide me idea or help me by suggesting built in function and by showing some code which will work.
Thank You
Nov 8 '16 #1
1 1127
weaknessforcats
9,208 Expert Mod 8TB
Why a linked list? Just use malloc() to allocate enough heap memory to hold your 6 files and read them into that memory.

Then I would put the loading in a loop an run it, say 1000 times.

Then I would get the system time before the loop and again after the loop. Get the difference in times and divide by 1000.

The reason for the loop of 1000 loads is that your computer is so fast there will be no difference between start time and end for a single load. You need enough loading so that the time functions will record a difference. I'm just guessing at 1000 loads. You may need more.

This is a very advanced subject for a beginner. What kind of class are you taking?
Nov 8 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Fabio | last post by:
Hi everyone, Is there anybody who can suggest me a link where I can find information about 'Persistent linked list' ? I need to implement a linked list where every node is a structure like the...
19
by: RAJASEKHAR KONDABALA | last post by:
Hi, Does anybody know what the fastest way is to "search for a value in a singly-linked list from its tail" as oposed to its head? I am talking about a non-circular singly-linked list, i.e.,...
4
by: Henk | last post by:
Hi, I am new to the c-programming language and at the moment I am struggling with the following: I want to read a file using fread() and then put it in to memory. I want to use a (singel)...
4
by: scythemk | last post by:
Hi, I am writing a program that, everytime it executes, first loads all information from a file into a linked list of nodes, using struct to define it. After manipulating the data and receiving...
2
by: semedao | last post by:
Hi All, I developed Outlook add-in with VS 2005 , everything work fine , until the machine reboot unnormally , when I opened the solution again many projects was not there ! (I have more then...
12
by: joshd | last post by:
Hello, Im sorry if this question has been asked before, but I did search before posting and couldnt find an answer to my problem. I have two classes each with corresponding linked lists, list1...
14
by: vikaskumaragrawal | last post by:
hi friends, i have a question plz help me. my question is ... how can i find middle node of linked list in single traverse???????
4
daniel aristidou
by: daniel aristidou | last post by:
Hi i just downloaded and installed the newest version of java. However i can seem to find or open the files it installed can anyone help me? Or give me a link to download again, maybe the...
5
mithuncm
by: mithuncm | last post by:
hai all, any one, can you say how to merge two different linked list. I have 2 linked list where datas, & of corresponding time that datas send. I have to sort out datas according to time, to a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.